Default brightness on Ubuntu

October 18th, 2014

I’ve looked a bit, but there doesn’t seem to be a stable solution yet. (there’s a bug report, so it might get fixed). My solution:

  1. cat /sys/class/backlight/intel_backlight/brightness when brightness was at desired level for startup
  2. in /etc/rc.local, echo this value back to that file.

This is not portable (default is 456 now…), but hey, it works :)

Booting Ubuntu (on Z930) in “flight mode”

October 15th, 2014

I would prefer to boot in “flight mode” — that is, all wireless devices turned off. I know where and how to turn them on (or at least, I think I do ;-). Plus, I’d prefer to, by default, save battery. (In that respect, I need to find out how to start with the brightness turned down a bit :s).

So far, this seems a hassle – every time I turn on the laptop, I’m greeted with a prompt for a WiFi password. Adding rfkill block all in /etc/rc.local/ (as suggested on various sites) doesn’t work.

Apparently, there are two independent processes that both can switch WiFi on during boot. You read that correctly: there are two processes which are independent, each of which sets the state of WiFi on boot. (to be precise: rfkill restore and networkmanager. They both try to recreate the setting they stored from last time – which can be conflicting.)

This gives a race condition. To address, you can create two scripts in /etc/init/: one to change the saved states of these processes, and one to run before either starts.
Hope this works!

*edit* hmmmmms. After reboot, no WiFi popup…. but also no NetworkManager running. So plugging in Ethernet does not work — I need to start NetworkManager myself.

Probable cause (from stackoverflow):

The ‘start on’ section lets you know which events need to be emitted before upstart will start network-manager.
In this case it’s:
– local-filesystems
– dbus
– static-network-up
Odds are the first two have already been emitted if you have booted to a desktop.

static-network-up is emitted by the /etc/network/if-up.d/upstart script, crucially, the event will not be emitted unless every interface configured as ‘auto’ in /etc/network/interfaces is up.

Trying to fix this by adding service network-manager start to rc.local…

*edit2*: that didn’t help. I’ve played around a bit and reverted to rfkill only. For some reason, the race condition worked out in my favour the last few times – likely because I manually switched off wireless, so both processes stored all wireless states as “off” now…

Fixing brightness on the Z930

October 14th, 2014

(I couldn’t find if I had posted this, so here’s the deal)
Getting Ubuntu to run side-by-side on my Z930 was a major hassle – to the point I had to call in assistance (Thanks, Piotr!!).
After that, I had it running, but the brightness keys did not work. Kind of silly – the screen was at full brightness, which is less than ideal for a laptop on battery…

Took a while to fix it. Below is what I can now reconstruct that we’ve done — this includes both the tips from http://www.linlap.com/toshiba_portege_z930 and this workaround. Both are on my laptop – I don’t know if one out of two would suffice…
Below, I’ve reproduced both in case one or the other goes offline.

Tips from LinLap.com

In /etc/default/grub, add acpi_backlight=vendor at the end to GRUB_CMDLINE_LINUX_DEFAULT. Next, run update-grub (given all the problems with UEFI and having 3 bootmanagers on the system now, that’s a scary step for me).

After rebooting, this will remove the acpi_video0 from /sys/class/backlight/ leaving you just with intel_backlight and toshiba. Upon resuming with these settings the screen would be completely black with no means of making it brighter. To fix this one needs to create and add the following to /etc/pm/sleep.d/restore_brightness:

#!/bin/bash
case "$1" in
   suspend|hibernate)
      #do nothing
   ;;
   resume|thaw)
      echo 7 > /sys/class/backlight/toshiba/brightness
   ;;
   *)
      exit 1
   ;;
esac
exit 0

chmod +x /etc/pm/sleep.d/restore_brightness

That’s it from LinLap.

Bug workaround

Create the file /usr/share/X11/xorg.conf.d/80-backlight.conf as:

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "AccelMethod" "sna"
    Option "Backlight" "intel_backlight" # use your backlight that works here
    BusID "PCI:0:2:0"
EndSection

That’s the workaround. Both are on my system, and the brightness controls work.

Herräng 2014

July 13th, 2014

Aaaaand… we’re back!!!
Herräng 2014 was awesome! This year we opted for private accommodation – a good deal more expensive, but we figured it’d be worth it. One effect I had not anticipated was how being further removed physically from the whole camp makes you … more removed.
Having a place to hang out and relax makes a big difference. Where last year you could either be in bed, or join the hustle and bustle of the camp, this year we could hang out at our own place. Which we did :)

There’s more to say, but for now let’s leave with some useful info:

Money
Since this came up again, and was again unclear:

3000 SEK is more than sufficient (if you have paid most things in advance).

Breakdown:

  • Meal ticket: 1000 SEK
  • Rent a bike for the week: 300 SEK (+ 300 SEK deposit)
  • 100/day for lunch/shopping: 600 SEK
  • 1 ice cream / day (25 SEK): 150 SEK
  • Private class (depends on teacher): 500-700 SEK
  • Transportation Arlanda-Herrang: in advance (? 500 SEK)
  • Transportation Herrang-Arlanda: ? 500 SEK
  • Shoes in the Lindy Shop: 600-800 SEK

In red: don’t risk it, assume cards are not accepted.
Note that the Lindy Shop and Heaven’s kitchen should be accepting cards – emphasis on “should”, the connection may breakdown…

Trevi Fountain coin-trick works!

June 11th, 2014

As I can now confirm from personal experience: tossing a coin into the Trevi fountain will get you back to Rome!
Of course, I didn’t throw it over my back way back then, which might explain why it took me 7 or so years to get back ;-)

Other than that: Rome was great! But now: back to work :)

London here we come… and we’ll be back :)

May 20th, 2014

London eye by nightAga and I planned a short trip to London. Aga had never visited before, so she was quite excited. I was equally anxious to show her some of the things I really like about London – in particular, the shows on West End :)

Of course, life snuck up on us / me, and I had to work a bit in London the first morning. Aga took the opportunity to explore London by herself, while I sat myself down in a coffee shop and worked. It went well, so we agreed to meet up around lunchtime at the Big Ben. Luckily, it was deserted… yeah right.

The crowds notwithstanding, we managed to find each other and took a stroll over the South Bank. We had fish & chips in a genuine-looking pub there (check!), and then went to Tate Modern (check!).

Turns out Aga and I experience modern art… differently. At any rate, we next went on across the Millenium bridge (check!) to St. Paul’s (check!), but were too late to ascend the dome (uncheck!). So we took a bus (check!) towards Piccadilly, spent a bit of time in my favourite bookstore (check!) (Waterstones Piccadilly – 6 stories with only English books), where we each bought a book, and then walked to our theatre to watch a show (check!) – Stomp! Afterwards, we took a riksha tour (check!) to Chinatown (check!) where we had a late chinese dinner.

The next day, Aga went out to the British museum (check!) (sort of next to our hotel), while I met up with Steven (check!) – a friend who lives in London. We chatted quite a bit over some steaming Earl Greys (check!) in the same coffee shop where I was the day before, and then we went out for a walk. We passed Covent Garden (check!) and walked towards Leicester square (check!). Then we turned around for lunch, walking via Oxford street (check!), and picked up Aga along the route.

Side note: we had booked a hotel close to the Piccadilly tube line, so that we could just hop on a tube to get to Heathrow. Turns out that our Sunday flight was leaving so early, it was not possible to make it to Heathrow on time… :s
So we cancelled the last night and booked a hotel close to Heathrow instead. Meaning that we were walking around with a lot of luggage :)

Following the late lunch, Aga’s plan was to go to the London Eye. We waved Steven goodbye and made our way there. We decided to go for fast tickets – more expensive, but hey, why not?
(That turned out to be important later on, and a very good decision.)
The queues weren’t that bad after we had the tickets, so I wasn’t too sure if it was worth it, but the views were great, and the cabin not too crowded.
Afterwards, we discussed what to do, and we figured it’d be nice to go to another show – if we could still make it. We initially wanted to take a bus, but they weren’t showing, so we took a tube instead. We made it to Leicester square again, where Aga headed to the same stall where I bought tickets to Stomp. Seeing how I felt they ripped me off (they sold me “the only tickets left” – for them, plenty of other seats available elsewhere – and they conveniently forgot to mention they were limited visibility… even though I asked for other seats, they assured me “no problem, small theatre”. Grrrrr.), I was not inclined to spend money there again.

The experience with Stomp taught me another thing: I asked whether we would see everything, and the crew replied “didn’t they tell you when you bought the tickets? Hmmms… why don’t you talk to the box office, perhaps they can reseat you.” That worked, and I glimpsed the ticket prices at the theatre. About 25% cheaper for our original seats than the stall where I bought the tickets!!! Talk about commission…

Charly & the chocolate factorySo we picked up a brochure with all the musicals and plays, which had a map of the theatres, and made our way to the theatre of our choice. We got to almost-front-row seats (excellent) to the musical (check!) Charly & the Chocolate Factory. We had a quick dinner before: vegetarian indian (check!), which was rather disappointing. Thankfully, the musical was great. The kids were acting great, although we weren’t too fond of Mike TV nor of Violet Beauregarde – mainly because their introductory songs (which establish the character) were hard to understand. For Mike TV, that was intentional (his mom was understandable and hilarious), but a pity. For Violet, perhaps if we had had different seats, the balance between music and singing might have turned out better… Veruca Salt and Augustus Gloop were fantastic characters, and very well played. Especially Veruca came across like an enormously spoiled brat – very well played.

Following this, we took our suitcases (yes, we’d been dragging our everythings with us the whole day) and got on a tube to Heathrow, where we took a bus to the hotel. We were more than a little pleasantly surprised with our room: freshly refurbished, large, with a huge desk (bigger than my office desk, actually), bathroom with bathtub… And that for less than the other “hotel” (i.e. refurbished house) would have cost. We enjoyed the luxury, woke up early and got back home exhaused and exhilarated.

My definition of a lazy day

April 27th, 2014

Yesterday was a fairly lazy day for me… channeling Bruno, if you will.

What does that mean?

  • Work a bit on tap dancing
  • get a haircut
  • skate a bit
  • grocery shopping in the far-off Delhaize
    Nice bike ride away next to the river! Spent too long in the store because I’m not used where to find things.
  • Update swing dance site
  • Made a start with one of two reviews
  • Accepted a request for another one
  • prepare 2 dance classes
  • Arrange to meet Rolando (took a surprising amount of time since he called me from his office phone but was no longer in the office ;-)
  • Ordered & picked up a pizza to share with Rolando
  • Met with Rolando, had dinner & a really great discussion for a few hours
  • walked Rolando to the bus to finish discussion
  • Got back and started typing in the ideas of the discussion (1 page of paper outline)
  • Read through a friend’s presentation and email comments back
  • Right before going to bed at 1.30: read a statement that we’re all brains in a simulation (Nick Bostrom). Roughly:
    • At one point, we will be able to simulate a brain more or less perfectly. At a later point, this will become trivial, so world+dog will do it. So there will be many more simulated brains than real brains. Wait, why aren’t we there yet? Probability is much higher than of us being real brains…
    • Get the idea that this might be easily falsifiable on physical grounds: either storing a brain will require so much space, or updating state will require so much energy, that it would require more atoms than on earth or more energy than the sun outputs in a reasonable amount of time.
    • Start researching this. Estimates of the brain’s storage capacity range from 1 Terabyte (1024 Gigabyte) to 2.5 Petabytes (2.5 * 1024 Terabyte). That doesn’t lead to a theoretical problem for storage… obviously (hey: there are 7 billion brains out there already, and they can all be stored).
    • Try to do back-of-the-envelope calculations about energy requirements. Fail again. (hey, there are 7 billion brains out there, and they can all flip one bit without draining the sun).
    • Give up around 2.30 and go to bed.

I think I ought to redefine what a lazy day is….

Gimp’ing the sky away

April 25th, 2014

GIMP logoI like making posters and playing around with graphics. I’m not necessarily good at it, but I like it. And I do have Opinions (with initial capital ;-).

So this time we were compiling together a simple poster made up of a few photos over a background. The photos were given, so now for the background. Just a colour gradient is somewhat too boring, and does not do justice in most cases. As this was a custom-made one-off souvenir, we’re not redistributing the work, so we’re happy to use a photo shared under most CC-licenses. Here’s the beauty we found:

Photo of Luxembourg - Grund by night

As you can observe, the photo in question is somewhat… landscapy-oriented. However, the customer was dead-set on a portrait rendition. Which put us a bit short on the sky. What to do, what to do??

Jolie @ Gimptalk forums had an excellent suggestion:

  • select the layer with the landscape photo
  • Choose Layer > Layer to Image size
  • Fuzzy select (U) the sky.
  • Add area above sky to selection (shift-click).
  • Color picker (O) select dark part of the sky as foreground colour. Make this a bit darker.
  • Color picker select light part of the sky as background color (ctrl-click). Make this a bit lighter.
  • Blend tool (L). Select “FG to BG” (which is default). Select shape: linear (again, default).
    Draw a line from the top of the image down to the sky (or a bit further).

That’s it! Result:

luxembourg with more sky

Dancing and car trouble

March 29th, 2014

Last weekend, I attended Swingin’ in the Rain (the Liège one, not the one in the USA). It was great!

As usual, auditions were looming, and nerves were flaring. My approach: pick a level where I would expect to be in the top half of the class. I figured if the teachers thought me too good a dancer, they’d bump me up. They didn’t (and rightfully so, wrote he ruefully).

Classes were fun. We had some great figures with William & Maeva (although I heard some grumbling from other levels about them), focusing on some standard figures that I always wanted to get down a bit better. Their final class was focusing on momentum. Downside: somehow, 99% of the possible pitfalls (and, therefore, advice) I remember is for follows :s
The classes with Giedre and Mindaugas were very nice – I love the cosy atmosphere they create. During their classes, I found out I have a tendency to compensate for a follow if I miss her energy. Not Good! Being aware is step one. Funny thing: this will defininitely happen if the follow is stopping by herself, instead of waiting for a lead. In these cases, I will definitely make things worse… Uh-oh!.
Finally, classes with Helena & Sep (who was substituting for Andy) were cool. Of course, we just had had Sep over in Lux, and since he was asked to substitute 3 days before, he did fall back on quite a few things from the Lux workshop. But: examining things afresh turns out to be very instructional! In the beginning, we focused on doing a swing out, but then in a relaxed way. I felt that I was so much more using the follow’s energy, instead of compensating :)

Sunday evening, about to head back with Sjouke, part two began. Sjouke was deliberatedly waiting for everyone to be off. Then we got into the car, and it wouldn’t start… O_o!!
We called Jana, who obligingly turned around and we tried seeing if it was the battery, and trying to jump-start it.
I thought it wasn’t: there was airflow from the fan, and dashboard lights, and so forth. At any rate, we were unable to find out how to connect the batteries (couldn’t find the plus-pole of Jana’s battery). As I had an urgent deadline, Sjouke told me to go with Jana, while he’d call the Belgium Automobile club for roadside assistance. We did so. Long story short: Sjouke had to route his request for aid via Luxembourg (he’s a member of the Automobile Association there, but of course not of the Belgian one), they came and it was the battery. Eventually, Sjouke came home and I made my deadline.

Lesson learned: starting the car requires a humongeous load from your battery – apparently easily 100 Amp (at 12 Volt, that would be 1200 Watt). So if you ever need to jump-start a car: first charge the dead battery for a while.

Spamspamspamspamspam… and post

February 3rd, 2014

I have a silly “security” measure on this blog: I just turn login off if I don’t need to login. Forgot to do that last time (5 days ago). BAAAAAM! 5300 spam comments.

Holy cesspit of depravity, Internet.