Yesterday the wonderful Howtoforge had an article that finally freed me from my beloved/hated scponly. MySecureShell offers all the functionality of a proper SFTP server, easily configurable and very well integrated.

To get it up and running on Debian, just download the latest *.deb version from Sourceforge.
Then install it with the following command:
dpkg -i mysecureshell_0.95_i386.deb

Now for every SFTP user you want on your system just do the following (substitute ‘test’ with your desired username).
Add a normal user to your system:
adduser test
Open the file /etc/passwd and change the user’s shell from /bin/bash to /bin/MySecureShell. The line then should look something like this:
test:1111:1111::/home/test:/bin/MySecureShell
Alas, you have a chrooted SFTP only user, without the clutter of numerous additional directories for the chroot. Simple and elegant 🙂

The last step is to have a look through the config file in /etc/ssh/sftp_config, it’s pretty well documented!

Log4Twitter is very similar to an idea Herbert an me had a couple of years ago, to use a Jabber messaging framework to get distributed logging and alerts from several servers/applications.
It is a Java class that allows you to “log” to Twitter. This would easily allow you to set up an application that sends messages to a private Twitter Account that you can subscribe to. Retrieving those messages should then be possible by IM or even SMS, seems like a perfect set up for me.

Using Log4Twitter is as easy as the following:

Setting Classpath
Add log4twitter-1.0.jar to your application’s classpath.
Note that log4twitter-1.0.jar has to be loaded by the same classloader that will load the logging framework.

Setting Logger
Edit your logging framework’s configuration to enable Log4Twitter.
The fully qualified class name of log4twitter is “log4twitter.FRAMEWORK_NAME.TwitterAppender”.

See the Log4Twitter page for some examples.

Now who’s got the time to code a Linux syslogd replacement or supplement, so I can receive important log messages via Twitter? 🙂

grep is a useful little *nix command line utility that makes it easy to search for strings in files. The real beauty comes when you start using it with pipes. One thing that kind of bothered me since I started using it, that it didn’t highlight the string you where searching for in it’s output.
Turns out, this can be accomplished very easily (should really just have reade the man page 😉 ).

Put the following in your shell startup script (/home/flo/.bashrc in my case)
export GREP_OPTIONS='--color=auto'
Now that was simple wasn’t it (though you’ll have to re-log in to make it work or at least spawn another shell process, so the startup file gets sourced) 🙂

But now if you followed my tip and started using pipes like mad, after applying this tip, you’ll quickly encounter that the colors are gone again. To hand over colors to say the often used less program you have to make an alias that hands grep the --color=always option (don’t put this in GREP_OPTIONS it tends to break things!) and call less with the -R option.
Or simpler, just add the following to your shell startup script:
export LESS=-R
alias cgrep='grep --color=always'

Yesterday I finally set up my good old iBook as juke box. It now sits on a shelf besides my working table and runs iTunes fullscreen wirelessly connected to the net and the stereo via my AirpotExpress. It’s working perfectly and I am really satisfied with it. The only downside was, that when I wanted to control anything on the iBook I had to reach over there.

I evaluated several different utilities for remote control but wasn’t really satisfied with any of them, then I remembered about Synergy. What it does is best quoted from it’s page:

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems without special hardware. It’s intended for users with multiple computers on their desk since each system uses its own display.

That’s exactly what I was going for and luckily setup was really easy (instructions for Mac OS X).

  1. Download Synergy from Sourceforge.net
  2. Unzip the archive and copy the resulting folder wherever you want (“Applications” might be a good idea 😉 )
  3. Decide on your “Server” (= the computer who’s keyboard and mouse will control all the other machines). On this machine you need to make a file named synergy.conf with the following contents
    section: screens
    screen1:
    screen2:
    end
    section: links
    screen1:
    left = screen2
    screen2:
    right = screen1
    end

    Substitute screen1 and screen2 with the hostnames of your computers (just punch in hostname in your Terminal and find out). Note that there is no implicit logic in the config file about the placement of the screens. So you have to tell Synergy that screen1 is right of screen2 and the opposite or you won’t be able to leave one of the screens with your mouse.
    The provided sample config is pretty well documented so you should be able to figure out the appropriate positioning for your particular set up very easily.
  4. When you’re done with the config, all there’s left to do is start Synergy. Just execute the following in your Terminal.
    First on the Server (alter the program path to match your system):
    /Applications/Synergy/synergys -c synergy.conf
    and then the client(s):
    /Applications/Synergy/synergyc screen1
    again substitute screen1 with the hostname of your server

If you didn’t make any mistakes in the config file you should be up and running by now and be able to move freely between all of your screens no matter to what machine they are connected.

The best thing about Synergy is that it is cross platform compatible, meaning you can connect Windows, Linux and Mac machines in a similar manner. To know more about the program consult the documentation provided in the installation directory.

UPDATE:
For the lazy, there is even a Mac OS X GUI Programm to do the configuring: SynergyKM 😉

This is a quick HowTo for installing the eAccelerator PHP cache/optimizer on a Debian system (should be applicable to other Linux distros as well).

  1. Download the latest release from SourceForge.net to your server and extract the sources.
  2. Change to the sources directory and type in the following.
    export PHP_PREFIX="/usr"
    $PHP_PREFIX/bin/phpize
    ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config

    This should set up the environment and compile configuration correctly.
  3. Now compile with make and install with make install (as root) afterwards.
  4. To configure eAccelerator you have to edit your PHP config which resides in /etc/php4/apache2/php.ini on my system.
    Add the following lines at the end: extension="eaccelerator.so"
    eaccelerator.shm_size="16"
    eaccelerator.cache_dir="/tmp/eaccelerator"
    eaccelerator.enable="1"
    eaccelerator.optimizer="1"
    eaccelerator.check_mtime="1"
    eaccelerator.debug="0"
    eaccelerator.filter=""
    eaccelerator.shm_max="0"
    eaccelerator.shm_ttl="0"
    eaccelerator.shm_prune_period="0"
    eaccelerator.shm_only="0"
    eaccelerator.compress="1"
    eaccelerator.compress_level="9"

    The file README in the sources directory gives a pretty good explanation of all those parameters. The only one you should probably alter is the shm.size because 16MB of shared memory might be a little bit too conservative.
  5. Last step is to create the directory where eAccelerator stores the cached scripts which don’t fit into the shared memory. mkdir /tmp/eaccelerator
    chmod 0777 /tmp/eaccelerator

Now you’re done. Further tweaking can be accomplished by altering all the parameters in the php.ini file.