Hi all,
some time ago we discussed where and how we should share
"Tips&Tricks" for YaST users and developers.
IIRC there was no clear conclusion so I decided to start
a wiki [1] to collect all our tricks we know or use.
For now it's just a place for dumping your ideas, links, short
howtos, etc... When we collect enough data we can probably
split it to several categories or move it somewhere else.
We just need the data first.
I have added there some my tricks from my personal "knowledgebase"
file. If you have better tricks or find something wrong simply
change it, it's a wiki ;-)
Ladislav
[1] https://github.com/yast/yast.github.io/wiki/YaST-Tips-and-Tricks
--
Ladislav Slezák
YaST Developer
SUSE LINUX, s.r.o.
Corso IIa
Křižíkova 148/34
18600 Praha 8
--
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: yast-devel+owner(a)opensuse.org
Hi,
please add the new YaST package yast2-usbauth from
https://github.com/kochstefan/yast-usbauth or
https://build.opensuse.org/package/show/home:kochstefan/yast2-usbauth to
openSUSE Tumbleweed.
This work was initially created for SUSE in 2015. Part of it was the USB
interface authorization for the Linux kernel. It's contained in Linux
since kernel version 4.4. The packages libusbauth-configparser, usbauth
and usbauth-notifier are already part of openSUSE Tumbleweed.
packages from the usbauth development:
- libusbauth-configparser is a library that is used to parse the usbauth
config file.
- usbauth is a firewall against BadUSB attacks. It allows/denies USB
interfaces using a config file. The needed USB interface authorization
is part of Linux 4.4 and newer.
- usbauth-notifier is a graphical notifier for user interaction to allow
or deny USB devices.
- yast2-usbauth: is a YaST module to edit the usbauth configuration file
Thank you.
Best regards
Stefan Koch
--
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: yast-devel+owner(a)opensuse.org
[shundhammer @ morgul] ~/tmp % cat weird.rb
#!/usr/bin/ruby
class Weird
attr_accessor :foo
def initialize
@foo = "foo"
end
def doit1
puts "doit1"
puts foo + "bar"
end
def doit2
puts "doit2"
puts foo +"bar"
end
end
weird = Weird.new
weird.doit1
weird.doit2
[shundhammer @ morgul] ~/tmp % ./weird.rb
doit1
foobar
doit2
Traceback (most recent call last):
1: from ./weird.rb:23:in `<main>'
./weird.rb:17:in `doit2': wrong number of arguments (given 1, expected 0)
(ArgumentError)
What's going on here?
Why does it crash?
What's the difference between "doit1" and "doit2"?
(Spoiler alert: solution after the blank lines)
Yes, it's just that one blank after the plus operator, and it makes all the
difference.
It turns out that some time ago (with Ruby 2.3), the Ruby string class got a
brand new unary plus operator (which is what we had all been missing for so
long, of course). That unary plus calls String.unfreeze on that string.
And in Ruby, the parentheses for a function call are optional.
This is an accident waiting to happen, and it happened right here:
Ruby interpreted this as a function call because the plus can be interpreted
as an unary plus here, so it decided to unfreeze the constant "bar" string
and pass it as an argument to the foo() method - which exists; it is the
getter to the @foo member variable (implicitly created by attr_accessor:
foo). Of course, this getter does not accept any parameter, so it complains.
Actually it's pure luck that it does not accept a parameter and complains
instead; if it had been a function that can accept a parameter, it would have
happily called it with the unfrozen "bar" string and just done random garbage
with that unintended parameter.
ARGH.
This is when "meaning good" (as in "the opposite of doing good") meets duck
typing and happily executing any random garbage.
If I really want to unfreeze a frozen string, I will happily tell Ruby to do
just that. But no, there was a chance to make a cryptic scripting language
even more cryptic by introducing stuff like an unary plus operator for
strings, of all things.
Tricky programming is soooo cool.
Readable and maintainable code is sooo overrated.
ARGH.
Kind regards
--
Stefan Hundhammer <shundhammer(a)suse.de>
YaST Developer
SUSE Linux GmbH
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)
Maxfeldstr. 5, 90409 Nürnberg, Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: yast-devel+owner(a)opensuse.org
Hi everyone,
I have noticed in the past few releases of openSUSE Tumbleweed, and in
openSUSE Leap, that there is no way to configure the hostname, dns, and
IP address of a machine during the installation process. I am aware that
it can be set after the installation using YAST, etc, but it used to be
available in previous builds. I was just curious if there was a reason
behind why this was taken out?
Thanks,
--
Larry Dewey
Software Engineer - Virtualization Specialist
SUSE
1800 Novell Place
(P)+1 801.861.7605
ldewey(a)suse.com