One-liner shell script for data mining from log files

In our radio station we use Icecast as a stream server. Like any other good linux software it generates log files that – after hitting predefined size – are compressed and a new log is started. This is a nice feature as it save space on you hard drive.

If you’re not familiar with linux shell you might think it will be hard to get some data out of all these log files. Maybe it’s not a simple drag’n’drop operation but once you understand how it works everything will look like basic shell scripting. Continue reading

Perl – Shell commands with pseudo-interaction

There are plenty of problems I have lenders on line to solve by myself as they are connected with very specific needs. Today I had to create 20+ ftp (pureftp) accounts with “random” passwords and a quota. All happened on Ubuntu server so I decided to write a script to make my life easier.

What I decided to do is to write a perl script that will get one argument on the command line (username) and make an ftp account “username” with chrooted home directory “/some/path/to/ftp/username”. Not-fully random (based on md5 algorithm) password and username should be appended to a text files, containing all the passwords. Continue reading