boltblog

ShellShock – a Bash 3 / Bash 4 spaceshooter!

Posted on March 26, 2012

My weekend project: A top-down space shooter in Bash
Note: Bash is SLOW. This requires an Intel Core Solo or better to run well.
Comments welcome.

Link: http://www.dhampir.no/stuff/bash/shellshock.bash

Filed under: Linux 1 Comment

Adding http:// back to the URL bar in Firefox

Posted on March 12, 2012

ghacks.net has an excellent article on how to do this. I archived it here.

Parse long options in bash scripts

Posted on March 7, 2012

geirha in #bash on irc.freenode.net had this solution, which I rather liked and wanted to keep for later use:

hybrid_getopts.bash

Filed under: Linux, Reference No Comments

Pausing and continuing a process on Linux

Posted on February 25, 2012

If you want to pause a process while you do something else, like for instance stop a heavy file operation while you're just moving some stuff around quickly, there are two signals to pay attention to: STOP and CONT.

STOP will pause a process (not actually stop it - it doesn't die)
CONT continues a stopped process, and does nothing if the process isn't stopped.

An easy way to experiment with this is to start xeyes:

$ xeyes &
[1] 26114

In this case, xeyes got the Process ID (PID) 26114. You can use "ps" to find Process ID's of running processes.

Xeyes is an application that shows two "eyes" on the screen, with eyeballs following your mouse pointer around.

To pause this process I use, in my case "kill -STOP 26114". Notice the eyes stop moving to follow the mouse pointer. "kill -CONT 26114" resumes the application.

 

Filed under: Howto's, Linux No Comments

Linux on Mac Mini – power on after power loss

Posted on February 17, 2012

The Mac Mini doesn't save this information in its BIOS (or equivalent), so you need to set it on each boot. I use my distribution's /etc/rc.local file for this.

Either way, these are the commands to run (copy, and uncomment the correct line for your Mini):

## PPC Mac Mini
#echo server_mode=1 > /proc/pmu/options

## Intel Mac Mini
#setpci -s 0:1f.0 0xa4.b=0

## nVidia Mac Mini
#setpci -s 00:03.0 0x7b.b=0x19

## Unibody Mac Mini
#setpci -s 0:3.0 -0x7b=20

Cool Software: Batch File Compiler PE

Posted on January 19, 2012

While I'm not sure why you'd want to do so, compiling batch files into executables just has some hackerish appeal to me.

The batch file compiler does so, and includes a cool syntax highlighting editor as well!

Get it here:
http://www.bdargo.com/
bfcpe.exe

Filed under: Software No Comments

Cool Software: PatchMyPC

Posted on January 19, 2012

This is an actual software autoupdater which is free, donate-ware and doesn't contain malware! In short: awesome!

Get it from:
http://www.patchmypc.net/

PatchMyPC.exe

Filed under: Software No Comments

Cool Software: SlowMP3

Posted on January 19, 2012

Slow MP3 allows you to speed up and down MP3 files without getting "chipmunk" voices, transpose them up and down and other cool stuff.

It's awesome if you're trying to learn that new song on your guitar and can't find the tabs for it.

Try it out!

http://www.finki.net/pekka/slowmp3/

SlowMP3.jar

Filed under: Software No Comments

gitolite: ‘foo’ does not appear to be a git repository – ForceCommand

Posted on January 11, 2012

Many people seem to get the following error message when trying to manipulate a remote git/-olite repository:
fatal: 'foo' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

The problem here, which is absolutely not explained by the above error message, is likely to be that the remote command gitolite specifies in "~/.ssh/authorized_keys" is not used.

This can in turn be caused by two things, as far as I know:

  • You are using an ssh key which appears in the authorized_keys file without gitolite's "command=..." configuration, in which case the solution is to use a separate public/private key pair for git
  • Your SSH server has a ForceCommand directive in sshd_config (/etc/ssh/sshd_config on debian) which overrides the "command=..." setting in authorized_keys. To solve this, that directive has to go, or an exception needs to be added for your git user with a Match clause in sshd_config.

In the latter case, there does not seem to be any sane way to retrieve the contents of the "command=..." statement. While the user supplied command is available in the environment variable $SSH_ORIGINAL_COMMAND while using ForceCommand, the command supplied by authorized_keys seems nowhere to be found. Thus you need an exception for the ForceCommand directive. If you find another way to avoid this, please leave a comment below?

Creating .deb-Packages With Checkinstall

Posted on January 4, 2012

If you've exhausted all other options, it might be time to compile from source, even in Debian.

If you're about to do that though, don't abandon the concept of .deb files and the advantages they bring with versioning and easy removal. Use "checkinstall".

Checkinstall is in the standard Debian repositories and encapsulates your install into a nice, easily installable and distributable .deb file. apt-getting it and reading the manual is easy enough, but if you want a howto, falkotimme.com has a nice one, archived here as a PDF.

Filed under: Linux, Reference No Comments