At work I have 2 big screens. They used to be run from a Linux desktop but I got upgraded to a laptop running Windows with my Linux desktop moved into a VM. I use Virtualbox which lets me use the 2 big screens as monitors for my Linux system. With Virtualbox set to “full screen” things are pretty much the way they were on the desktop, with an extra Windows screen to the right (that I pretty much don’t use).
One big change though is that I sometimes have to take my laptop away from my desk and when it undocks, strange things happen. I had previously suspended or shut down the VM but today I figured all the things out.
Problem 1: The number Windows puts on your screen may not match the number Virtualbox puts on your screen.
Here’s what my desktops look like.
The laptop is on the right and according to Windows, the screens are numbered 3, 2, 1 (left to right). But what Windows calls screen 2, virtualbox calls screen 3 and Windows screen 3 is virtualbox screen 2. Why? I dunno.
Problem 2: Linux and Virtualbox disagree on where the monitors are.
The mouse is handled by Virtualbox so it tracks according to the Windows screen layout, not the Linux monitor layout. Virtualbox decides which Linux monitor goes on which screen, not the Linux monitor layout. I did set the Linux monitor layout so that it was “correct” but I’m not really sure it is having any effect.
Problem 3: Due to the desktop legacy, the monitors were reversed.
Rather than moving the monitors when I setup the desktop, I had all my “primary” desktop stuff on monitor 2 with monitor 1 as the “secondary” display. I had to drag my desktop icons from one monitor to the other. Moving the MATE panel was a bit harder. You have to right-click, preferences and uncheck Expand. Then you can use the tabs at the side of the panel to move it to the other monitor. Then you can make it expand again. Now my “primary” stuff is on monitor 1 (screen 2) and my “secondary” screen is monitor 2 (screen 3).
Problem 4: Virtualbox hides full-screen VM monitors if there is no physical screen to locate them on.
This is what was getting me when I undocked the laptop. Before I’d fixed everything up, my “primary” display would disappear. Virtualbox allows monitor 1 to display on the laptop and it simply hides monitor 2. Virtualbox does not tell the guest that it’s hiding monitor 2 either. After fixing things, my “secondary” display disappears, which is better. I also find out you can un-full-screen in order to see both monitors (they become 2 windows).
I thought I’d written about this ages ago. But it turns out I didn’t.
The default bash history handling is terrible. Run one shell at a time and always cleanly exit the shell and it’s ok, but run more than one shell at a time and abnormally exit shells and disaster will strike. The number of saved entries is relatively tiny. Duplicates are saved and you can’t really share history between running shells.
Here’s how you fix it.
First, we want to append to the history file rather than clobbering it.
shopt -s histappend
I once had a bash start and fail to read .bashrc properly. It clobbered my history. So now I use a non-standard file to keep broken bash shells from clobbering the history.
Store lots and lots of history.
I don’t want duplicates in the history. Also, I ignore commands that start with a space (eg. for those times when you have to give something sensitive like a password to a command).
#HISTCONTROL=ignorespace # start a command with a space and it doesn't go into history
#HISTCONTROL=ignoredups # ignore duplicates
HISTCONTROL=ignoreboth # both of the above
You can run
history -a to dump the history immediately and
history -n to import history into a running shell. I like to automate the dumping so that an abnormally terminating shell doesn’t take it’s history with it. I get bash to call a function just before showing a prompt. I do lots of other things in here, and dump history too.
history -a # export history immediately
I don’t automate history importing.
If you’re looking for the copy+paste version, here it is.
# Don't clobber history
shopt -s histappend
I watched at least a few episodes of The Mysterious Cities of Gold (hereafter TMCoG) as a kid. More recently, the series was shown on TV and the whole family sat down to watch it. Then last weekend, an offhand comment got me wondering about the soundtrack. TMCoG has awesome music. Very 70s, French and electronic but still awesome.
Some searching quickly turned up information about an LP release that was done at the time. And apparently there was a CD for sale but I couldn’t track it down. I did find a youtube playlist that had been put together. Some of the tracks are preserved well, some not so much. Still… it’s the TMCoG music so it’s great.
Then I stumbled onto the “re-orchestration” scene. People clearly want better sounding audio and have re-made the songs. The main problem with this is that it all sounds completely different. Except for this one guy. He has gone as far as sourcing the same instruments (I’m guessing mostly old synths) so that he can faithfully re-create the music. And he totally nails it.
His site is The Grand Heritage. It’s all in French so you’ll need to run it through a translator.
This guy had a CD of re-created tracks out in 2002 (again, I couldn’t find it), then started up this site in 2011 to continue the work. There’s 88 songs there. Further than any soundtrack would normally go, he seems intent on re-creating all the music, even little incidental bits. I love it!
I have been using iMovie since version 1 on the classic MacOS. Which means I know the iMovie HD interface really well. So I was dismayed to find that it doesn’t launch on Yosemite.
But I found information that said it does run, it just can’t be launched by clicking on its icon.
I already had some Automator applets that launched apps so I modified one to launch iMovie HD and gave it an icon. If you like the idea of a clickable launcher for iMovie HD, get it here. If you don’t want to trust a random app you can open it in Automator to verify it for yourself.
So I recently discovered some classic sci-fi radio plays on archive.org. X Minus One (and its precursor, Dimension X). The only problem is… downloading episodes from web pages sucks and my podcast app doesn’t take an M3U playlist as input. So I wrote a script to generate some podcast files and put them over here.
It started simply enough. Someone posted a dice balancing photo. I was at work, bored and I had some dice so…
This led to a retaliation but at home I have different dice which are harder to stack. Luckily it was Easter so I had some free time one morning.
Not bad, but I knew I could do better. I really wanted to have more than one “twisted” dice but it’s way harder to do. Many frustrated attempts later, I achieved this.
This may well be as good as it gets. I’m not sure I could get anything on top of that top dice. At least, not with only 2 hands. I could probably get more in the middle… but I’m a bit short of dice at home. Turns out our games tend not to use dice, or they use unsuitable ones. Maybe during our next sprint planning session at work…
I use Quassel. The server runs all the time so I’m always logged in. Since the server runs at my home, I sometimes get bumped offline as my IP address changes (why? I dunno, it just does). Since the server re-connects within the normal IRC timeout period, this means it can’t take my nick. You can fix this manually when you login and notice it but… that’s a bit of a pain. Here’s how I did it automatically. more…
I don’t know if wordpress sites respond to ping backs if you turn the checkbox off but… can’t hurt to force it off anyway, right?
So I took the instructions here but I changed one thing. I can’t just turn off xmlrpc altogether because I use the wordpress mobile app. But all the rest is good. This turns off the advertising (headers and such, references to xmlrpc.php that end up in your pages) as well as forcibly blocking any ping requests. The mobile app still works. Maybe other things don’t but… I don’t use them.
Make a directory under wp-content/plugins and a .php file to put the following into. You then have to enable the plugin from the dashboard. more…
I have a RAZR i with the standard UK 4.1.2 ROM. Sometimes I’ve had low memory problems or periods where the battery runs down unexpectedly. I recently started experiencing severe memory shortage every now and then. Despite my initial assumption this was related to running with data disabled, it turns out something else was the culprit. The problem came down to a large number of app_process instances hanging around, taking up 8M of RAM each. more…
So for some reason, nosupportlinuxhosting removed /usr/bin/rsync from my web host on 27 Feb. I thought about emailing them but… they do advertise how they ignore support questions.
I have a workaround anyway. This is how I backed up my site at a previous hosting company that didn’t provide rsync. It’s not quite as good but it’s a lot better than just downloading everything all the time. more…