Gimp 2.9.4 now in Gentoo 2016-07-18 No Comments

Hi there!

Just a quick heads up that Gimp 2.9.4 is now available in Gentoo.

Upstream has an article on what’s new with Gimp 2.9.4: GIMP 2.9.4 Released

Fwd: The Glitch Mob – Love Death Immortality 2016-07-01 No Comments


The Glitch Mob – Love Death Immortality

Loop variable collisions in Bash 2016-04-30 No Comments

Let’s have a look at this simple Bash script:

#! /bin/bash
inner() {
    for i in {1..4}; do
        echo "  $i"
    done
}

outer() {
    for i in {1..3}; do
        echo "$i"
        inner
    done
}

outer

The output is ..

1
  1
  2
  3
  4
2
  1
  2
  3
  4
3
  1
  2
  3
  4

.. as expected. Now if we turn the for loops to C-style, we end up with this code:

#! /bin/bash
inner() {
    for ((i = 1; i <= 4; i++)); do
        echo "  $i"
    done
}

outer() {
    for ((i = 1; i <= 3; i++)); do
        echo "$i"
        inner
    done
}

outer

Before you continue, take a moment: What output do you expect?

The same?

The output we get is:

1
  1
  2
  3
  4

Why?

By default, in Bash variables a global unless declared local, explicitly. That includes loop variables.
The initial code had inner modify the global $i already; the collision did not show, because the master loop for i in {1..3}; do resets $i to the next value from list “1 2 3” rather than adding 1 to $i‘s current value. So right after inner returns, $i is “corrupted” for a brief moment in the original code, already.

If we were to fix the C-style loop version, falling back to plain for loops is addressing symptoms more than causes. For addressing causes, I would like to propose both a soft and a hard fix:

#! /bin/bash
inner() {
    local i  # soft fix
    for ((i = 1; i <= 4; i++)); do
        echo "  $i"
    done
}

outer() {
    local i
    for ((i = 1; i <= 3; i++)); do
        echo "$i"
        ( inner )  # hard fix
    done
}

outer

The soft fix is declaring $i as local (to inner) so that it does not modify the global $i (“shadowing”). (The new local i in outer is for hygiene, and not taking part in this particular fix.)

The hard fix is calling inner from a subshell so that outer does not have to trust inner on globals.

To summarize:

  • Loop variables are global by default, too: Better turn them local.
  • Declare as many variables local as possible, in general.

Disable Komodo IDE debugger (bound to 0.0.0.0, run by default) 2016-03-14 No Comments

Komodo IDE starts a debugger bound to 0.0.0.0, by default. Maker ActiveState’s reaction was rather unprofessional at the time when I asked for an option to bind to 127.0.0.1, instead. I can no longer add links to that post, but I can link to my demo Komodo IDE exploit script up here.
Now it seems like the option to disable or even customize debugger settings was removed from the GUI: I cannot find it in version 9.3.2. I found a workaround when reading the source code that allows to still plug that hole in my setup. If I tweak the config file to an invalid port (outside of 0..65535 range), the debugger will just not start-up but Komodo starts up with no complaints. Nice 🙂

# fgrep debuggerListenerPort ~/.komodoide/*/prefs.xml
/home/user/.komodoide/9.3/prefs.xml:
  <long id="debuggerListenerPort">77777</long>
/home/user/.komodoide/9.3/prefs.xml:
  <string id="debuggerListenerPortType">specific</string>

If you use that trick, be sure to check the version number in the path so you edit the latest / actually used version, 9.3 in my case.

Fwd: Amazon’s customer service backdoor 2016-01-26 No Comments

https://medium.com/@espringe/amazon-s-customer-service-backdoor-be375b3428c4#.lds36jwqp

Check the image links in the first reply up there, too.

Uses Gentoo: PS4 Linux demo by fail0verflow at 32c3 2016-01-05 No Comments

Demo start:
https://www.youtube.com/watch?v=2A7V3GLWF6U&feature=youtu.be&t=37s

Where “OpenRC 0.19.1 is starting up Gentoo Linux (x86_64)” scrolls into display:
https://www.youtube.com/watch?v=2A7V3GLWF6U&feature=youtu.be&t=1m21s

XScreenSaver unlock dialog tuning 2015-12-19 No Comments

I’m having a bit of trouble accepting that one of the dialogs that is presented to me as frequently as the XScreenSaver unlock window below is by far the least shiny part of my daily Linux desktop experience.


Tuning just the knobs that XScreenSaver already comes with, I eventually got to this point:


The logo still is too much noise and the font still lacks anti-aliasing. However most of the text noise, the pre-90s aesthetics and the so-called thermometer are gone.

To bring it to your desktop, use this content for ~/.Xdefaults

xscreensaver.dateFormat:
xscreensaver.passwd.body.label:
xscreensaver.passwd.heading.label:
xscreensaver.passwd.login.label:
xscreensaver.passwd.thermometer.width: 2
xscreensaver.passwd.uname: False 
xscreensaver.passwd.unlock.label:

xscreensaver.Dialog.background:         #000000
xscreensaver.Dialog.foreground:         #ffffff
xscreensaver.Dialog.Button.background:  #000000
xscreensaver.Dialog.Button.foreground:  #ffffff
xscreensaver.Dialog.text.background:    #000000
xscreensaver.Dialog.text.foreground:    #ffffff

xscreensaver.Dialog.shadowThickness: 1
xscreensaver.Dialog.topShadowColor:     #000000
xscreensaver.Dialog.bottomShadowColor:  #000000

and run

xrdb < ~/.Xdefaults  && xscreensaver-command -restart

as advised by the XScreenSaver Manual.

For other approaches, I’m only aware of this one: xscreensaver lock window themes. Please comment below if you know about other approaches. Thank you!

PS: The screensaver in the background is Fireflies. For a Debian package, you can run make deb from a Git clone.

Fwd: The Butterfly Effect (band) 2015-11-13 No Comments

Hi!

Among the top rock albums I have run into so far are

by a band called “The Butterfly effect“. I consider them a bit lesser known, but I don’t have data to back it up. One of my long time favourites. If you can use a hint, check them out.

For the embedded one, start with track #2 at 7:04.


Keeping Gentoo systems up-to-date / update notification 2015-10-05 1 Comment

Hi!

Frequent updates are important, especially with Gentoo. You probably have seen conflicts that filled several screens and were not trivial to resolve. With frequent updates, handling conflicts becomes a lot easier. Frequent updates also gets you security fixes earlier. I would have done it from the beginning, if something would have reminded me to update. By now, for notifications on available updates I use

Former is a tool by Benedikt Böhm sending e-mails with emerge --pretend output whenever it changes. Latter is a bit of a quick hack by me that sits in the tray and shows an icon if updates are available with the number of updates in a tooltip. It requires a cron job to run something like eix-sync once a day but that’s probably a good idea anyway.
Maybe it’s something that you want to use too. If you run into bugs, please report them and share your patches if any. GitHub allows attaching text files by now, it may work with patches, too.

I would be curious to hear what other tools you use for being notified of updates on Gentoo. Please leave a comment below.

Best, Sebastian

Fwd: Adelle Waldman — The Love Affairs of Nathaniel P 2015-09-22 Comments Off on Fwd: Adelle Waldman — The Love Affairs of Nathaniel P

I just finished reading Adelle Waldman — The Love Affairs of Nathaniel P. I read good things about it somewhere before and got curious to see myself. A great read, never boring, well worth my time.