Dec
04
2008
0

Colorful make output

This handy piece of code colors errors and warnings in make output.
(put it in your .bash_profile)

make()
{
  pathpat="(/[^/]*)+:[0-9]+”
  ccred=$(echo -e “\033[0;31m"
)
  ccyellow=$(echo -e "\033[0;33m")
  ccend=$(echo -e "\033[0m")
  /usr/bin/make "$@" 2>&1 | sed -E -e "/[Ee]rror[: ]/ s%$pathpat%$ccred&$ccend%g” -e “/[Ww]arning[: ]/ s%$pathpat%$ccyellow&$ccend%g”
  return ${PIPESTATUS[0]}
}

via shawnwilsher.com

An alternative would be to install colormake and use that instead of the normal make command.

Written by Florian Beer in: development, linux, mac
rel-tag , , , , , , , ,

Apr
29
2008
0

Linuxwochen Eisenstadt 2008

On Mai the 30th & 31st the Austrian “Linuxwochen” will again hit my former university in Eisenstadt.
Look ahead for some very interesting talks by several highly skilled people.

One event I’d especially like to draw your attention to is Oliver’s pice about “Linux Server Experience with VServer” on Fr. the 30th. at 17:15 hours.

I’d be happy (and I’m sure, Olli even more) to see a lot of people attending this great event, listening to the talks held there and discuss open source solutions with us :)

Oct
03
2007
1

Ubuntu countdown


Written by Florian Beer in: linux
rel-tag , ,

Sep
20
2007
1

MySecureShell - chrooted SFTP server

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!

Written by Florian Beer in: security, server
rel-tag , , , , , , ,

May
30
2007
1

Log4Twitter

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? :)

Mar
27
2007
4

Colorful grep

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'

Written by Florian Beer in: linux
rel-tag , , , , , ,