Posts Tagged ‘repositories’

How to find out which processes are causing a hard disk I/O overhead in GNU/Linux

Wednesday, September 28th, 2011

iotop monitor hard disk io bottlenecks linux
To find out which programs are causing the most read/write overhead on a Linux server one can use iotop

Here is the description of iotop – simple top-like I/O monitor, taken from its manpage.

iotop does precisely the same as the classic linux top but for hard disk IN/OUT operations.

To check the overhead caused by some daemon on the system or some random processes launching iotop without any arguments is enough;

debian:~# iotop

The main overview of iostat statistics, are the:

Total DISK READ: xx.xx MB/s | Total DISK WRITE: xx.xx K/s
If launching iotop, shows a huge numbers and the server is facing performance drop downs, its a symptom for hdd i/o overheads.
iotop is available for Debian and Ubuntu as a standard package part of the distros repositories. On RHEL based Linuxes unfortunately, its not available as RPM.

While talking about keeping an eye on hard disk utilization and disk i/o’s as bottleneck and a possible pitfall to cause a server performance down, it’s worthy to mention about another really great tool, which I use on every single server I administrate. For all those unfamiliar I’m talking about dstat

dstat is a – versatile tool for generating system resource statistics as the description on top of the manual states. dstat is great for people who want to have iostat, vmstat and ifstat in one single program.
dstat is nowdays available on most Linux distributions ready to be installed from the respective distro package manager. I’ve used it and I can confirm tt is installable via a deb/rpm package on Fedora, CentOS, Debian and Ubuntu linuces.

Here is how the tool in action looks like:

dstat Linux hdd load stats screenshot

The most interesting things from all the dstat cmd output are read, writ and recv, send , they give a good general overview on hard drive performance and if tracked can reveal if the hdd disk/writes are a bottleneck to create server performance issues.
Another handy tool in tracking hdd i/o problems is iostat its a tool however more suitable for the hard core admins as the tool statistics output is not easily readable.

In case if you need to periodically grasp data about disks read/write operations you will definitely want to look at collectl i/o benchmarking tool .Unfortunately collect is not included as a packaget for most linux distributions except in Fedora. Besides its capabilities to report on servers disk usage, collect is also capable to show brief stats on cpu, network.

Collectl looks really promosing and even seems to be in active development the latest tool release is from May 2011. It even supports NVidia’s GPU monitoring 😉 In short what collectl does is very similar to sysstat which by the way also has some possibilities to track disk reads in time.  collectl’s website praises the tool, much and says that in most machines the extra load the tool would add to a system to generate reports on cpu, disk and disk io is < 0.1%.  I couldn’t find any data online on how much sysstat (sar) extra loads a system. It will be interesting if some of someone concluded some testing and can tell which of the two puts less load on a system.

Graphical representation of Open Source history generated from SVN and GIT commits with Gource – Software version control visualization

Thursday, September 1st, 2011

A friend of mine has sent me a link to awesome videos produced with an open source tool called Gource

The tool is really awesome as its capable of producing amazing graphical visualizations from source tree repositories obtained from software SVN or GIT repositories

Someone used it to create a wonderful videos and relate the graphical visualization with wondeful music to show graphically the Software development for the main Free Software Projects. 😉

The points which move around in videos are graphical representation of the repository source, the nodes which buzzle around are users who commit source in the project repositories.
The whole graphical representation is being generated based on all the latest source hold inside the software repository, on top of the videos its visible the date of each of the source commits.
Below are few of the nice videos, the rest are available for checkout in Youtube, Enjoy! 😉

OpenOffice Development – Graphical representation

PHP Development – Graphical representation

History of Python development since 1990 with Gource

Development of MySQL 2000-2010 – Graphical representation

Perl development history in less then 4 minutes. Visualized with gource.

Install grsecurity kernel security from binary package (without kernel recompile) on Debian and Ubuntu

Monday, July 26th, 2010

GRsecurity is since long time known that it is a next generation armouring agains 0 day local kernel exploits as well as variousof other cracker attacks.
Grsecurity is an innovative approach to security utilizing a multi-layered detection, prevention, and containment model. It is licensed under the GNU GPL.
GRSecurity is linux kernel patch which has to be applied to the kernel before compile time. However we’ve been lucky and somebody has taken the time and care to prepare linux image binary deb packages for Debian and Ubuntu .

Some of the key grsecurity features are :

  • An intelligent and robust Role-Based Access Control (RBAC) system that can generate least privilege policies for your entire system with no configuration
  • Change root (chroot) hardening
  • /tmp race prevention
  • Prevention of arbitrary code execution, regardless of the technique used (stack smashing, heap corruption, etc)
  • Prevention of arbitrary code execution in the kernel
  • Reduction of the risk of sensitive information being leaked by arbitrary-read kernel bugs
  • A restriction that allows a user to only view his/her processes
  • Security alerts and audits that contain the IP address of the person causing the alert

To install from the http://debian.cr0.org/ grsecurity patched kernel image repository use the following steps:

1. Include in your /etc/apt/sources.list

deb http://ubuntu.cr0.org/repo/ kernel-security/
deb http://debian.cr0.org/repo/ kernel-security/

Directly from the bash command line execute:

debian:~# echo "deb http://ubuntu.cr0.org/repo/ kernel-security/" >> /etc/apt/sources.list
debian:~# echo "deb http://debian.cr0.org/repo/ kernel-security/" >> /etc/apt/sources.list

2. Add the debian.cr0.org repository gpg key to the trusted repositories key ring

Download the repository’s gpg key , check it (it has been signed with the repository owner GPG key )

Thence from to include the gpg key to the trusted repos key issue:

debian:~# apt-key add kernel-security.asc

3. Install the linux-image-grsec package itself

Currently to install on my x86_amd64 Debian Squeeze/Sid and possibly on Debian Lenny I’ve issued:


debian:~# apt-get update
debian:~# apt-get install linux-image-2.6.32.15-1-grsec

Now simply restarting your system and choosing the Linux kernel patched with the GRsecurity kernel patch from Grub should enable you to start using the grsecurity patched kernel.
Though this tutorial is targetting Debian it’s very likely that the grsecurity hardened kernel installation on Debian will be analogous.

Play Nintendo Super Mario Bros on Linux (Secret Mario Chronicles) and SuperTux

Monday, May 2nd, 2011

Super Mario for Linux, Super Mario Chronicles

Are you looking for free software version of the old-school absolute Nintendo classic Super Mario Bros. ? 🙂

If you’re an old-school geek gamer like me you definitely do 😉
I was lucky to find Secret Mario Chronicles a Linux version of Super Mario while I was browsing through all the available for installation Linux games in aptitude .

The game is really great and worthy to be played. It’s even a better copy of the classical arcade game than SuperTux (another Mario like Linux clone game)

Super Tux A Super Mario Bros. clone for Linux

Both Super Mario Chronicles and Super Mario Bros are available for installation as .deb packages in the repositories of Ubuntu and Debian and most likely the other Debian direvative Linux distrubtion.

To install and play the games out of the box, if you’re a Debian or Ubuntu user, just issue:

linux:~# apt-get install smc supertux

The other good news are that both of the games’s engine, music and graphics are GPLed 🙂

To Launch the games after installation in GNOME I’ve used the menus:

Applications -> Games -> Super Mario Chronicles
andApplications -> Games -> Arcade -> SuperTux

The games can also be launched from terminal with commands:

debian:~$ smc
debian:~$ supertux

The only thing I don’t like about Super Mario Chronicles is that it doesn’t have a good music and only sounds, just to compare SuperTux has an awesome level music.
Along with being an absolute classic I should say that these two games are one of the really good arcade games produced for Linux and if I have to rank them as a gamer among all the other boring arcade games today available for Linux this two ones ranks in the top 10 arcade games prdocuced for Linux

Enjoy and drop me a thanks comment 😉 !

How to edit, convert, join, split and re-time movie subtitle files on Linux (Fix Subtitles bad timing) / Install subtitle manipulation console tools for Linux

Tuesday, April 19th, 2011

As a Linux user I sometimes face difficulties with watching subtitled, movies. I mostly use Mplayer, Totem or VLC to watch the common video files.
The most common problems I face with subtitles are caused by bad timing, many times the solution to the bad timing issues is very simpleand comes up to changing the default movie player I use MPlayer to VLC or Totem.

However at many occasions trying to watch the movie with different kind of movie player does not help.
In this dark moments I get seriously irritated I am not a regular Windows user, where such kind of problems are almost none as many of the Windows movie player problems does fix bad timing issues automatically.

Luckily there is a work-around to this subtitles timing issues and other mishaps caused by guys who created a Movie subtitle files with a Windows subtitle editor program, subtitles timing, the Linux work-around takes a few more minutes to install a package called Subtitles

The Subtitles text utility is written in Perl and contains two executables subplay and subs .

Subtitles is the Linux subtitle Swiss Army Knife as it is capable of convert, join, split, and re-time of subtitles files

Installing Subtitles tools on Linux is a trivial job and it comes to download and installation of the 2 perl executables.
Here is how:

1. Download Subtitles.tar.gz toolsI have mirrored Linux Subtitles (Subtitles.tar.gz) here originally the binaries are to be found on URL address: http://karasik.eu.org/software/ , issue the commands:

linux:~# cd /usr/local/src
linux:/usr/local/src# wget https://www.pc-freak.net/files/Subtitles.tar.gz
...
2. Unarchive it

linux:/usr/local/src# tar -zxvvf tar -zxvvf Subtitles.tar.gz...
linux:/usr/local/src# cd Subtitles-1.0

3. Compile and install Subtitles system widePitily the Subtitles tools are not currently available as a packages in the repositories of Debian and Ubuntu Linux and thus easy installation without compilation via apt-get is unfortunately not available.

Here is the commands with which to compile and install Subtitles:

linux:/usr/local/src/Subtitles-1.0# perl Makefile.PL
...
linux:/usr/local/src/Subtitles-1.0# make
...
linux:/usr/local/src/Subtitles-1.0# make test
...

All tests successful.Files=1, Tests=17, 1 wallclock secs ( 0.05 usr 0.00 sys + 0.06 cusr 0.01 csys = 0.12 CPU)Result: PASS

linux:/usr/local/src/Subtitles-1.0# make install

Installing /usr/local/share/perl/5.10.1/Subtitles.pm
Installing /usr/local/man/man1/subplay.1p
Installing /usr/local/man/man1/subs.1p
Installing /usr/local/man/man3/Subtitles.3pm
Installing /usr/local/bin/subplay
Installing /usr/local/bin/subs
Appending installation info to /usr/local/lib/perl/5.10.1/perllocal.pod

Now as we have the subs executable installed, Let’s say your movie subtitles displays 5 seconds earlier before the movie scenes (bad timing), all you need to do to adjust your subtitles to show up in correct movie scenes is issue:

hipo@linux:/home/hipo/Movies$ subs -i -b 5 your_movie_subtitle_file_name.sub

now check out the subtitle files once again with your favourite player and the early subtitles display on your movie should be fixed.
Let’s have another scenario, say that your movie file is encoded to display 24 frames per seconds (fps) but the subtitle file is created to display the subtitles for a 25 fps, to solve this situation issue:

hipo@linux:~# subs -i -a 24/25 your_movie_subtitle_file.sub

Another possible scenario where subs command will be a precious asset is if you for example want to merge two subtitle files into one.Let’s say you have subtitles for a movie which are split over in 2 parts and the corresponding subtitles are in 2 different files, but eventually you find a better quality of the movie (DVD quality) in a single file and therefore you need the movie subtitles to be stored in one single file.
In that case to merge the subtitle files from let’s say the files movie_subtitle_file1.sub and movie_subtitle_file2.sub use the command:

subs -z movie_subtitle_file1.sub movie_subtitle_file2.sub

Some few other helpful things you can do with subs on Linux, are for example: splitting a file after a determined period of time, separating overlapped lines, and joining files into a single subtitle.

If you want to remove all the comments of gestures, facial expressions loud laughing etc. which displays usually the annoying (‘[Sneezing]’ or ‘[Music playing]) during the movie screen play, issue:

subs -e 's/[s-]*[.*]s*n*//gs' movie_subtitle_file.sub

Also other interesting Linux tool which is useful if you want to make conversions between subtitle in a (.sub) format to (.srt) format is called sub2srt perl script:

sub2srt’s home page is located on the URL address: http://www.robelix.com/sub2srt/, just to ensure it won’t just disappear with time I have created sub2srt mirror here

The most basic usage of sub2srt linux converting tool is by simply passing input sub and output srt file names like so:

linux:~# ./sub2srt 5rFF-pop.sub 5rFF-pop.srt

sub2srt supports changing of fps rate per second during conversion with the -f option as well as creationg of converted files in dos like end of file (CR+LF) with the –dos option.

Hope this article makes sense. If you find it useful, please drop me a thanks comment 😉

How to turn ordinary Linux to a game station / Best Games to install and play on Debian Linux

Thursday, April 14th, 2011

Linux install best Games logo
Hereby in this article I’ll in short give you a quick way to install a number of my favourite linux games. In my view the games I’m going to suggest for installation are actually among the best existent games you could install and play on a Linux Desktop today.

Many people say/believe Linux does not have games, or the games for Linux/BSD are not fully featured and are not comparable to the ones for Windows, most of this sayings and beliefs are actually a fairy tales.
I should admit of course that Linux is still lacking behind in its gaming capabilities, even quite behind any Windows platform (Don’t get me wrong, I’m trying to be as much realistic as possible here in my estimation).

However little by little year by year as time passes by with time the situation for the coming generation of Linux Gamers is gettings better and better!.
The amount of free and non-free games is rising day by day, wheter
many of the large game producing companies like Blizzard, ID Software etc. are producing ports of their proprietary games for Linux.

Along with that the amount of Linux Enthusiast gamers and hobbyist is constantly increasing.

At the present moment probably there are more than 5000 games for Linux!
Many of that games count still requires heavy testing or are not yet production ready and therefore they don’t make it as a packages in the general Linux distributions repositories. These games are instead published on a various websites across the internet and still needs our (the linux hobbyist and daily users) testing and support
Linux has a number of websites which aims at inform interested users into the Linux games development, the major ones as far as I have found are:

  • http://happypenguin.org
  • http://www.linux-gamers.net

In Debian (Squeeze) Linux currently there are an overall of 1815 free and non-free games packages to available for installation
I have a favourite number of games I do install on each and every computer I use as a desktop workstation.

These Linux games are truly a blessing especially in times I’m too tired of reading, scripting or being too overwhelmed of doing my daily system administration duties.

To install my selected games collection on your Debian, Ubuntu or any other debian based Linux with apt-get use the command:

debian:~# apt-get install open-invaders bsdgames-nonfree scummvm
briquolo abuse abuse-frabs dosbox pingus wesnoth brutalchess
dreamchess gnuchess kamefu frozen-bubble bomberclone
lbreakout2 armagetron defendguin dodgindiamond2
rocksndiamonds blobwars wing xgalaga
extremetuxracer planetpenguin-racer
powermanga sauerbraten supertux tecnoballz torus-trooper
trackballs tumiki-fighters zblast-x11 criticalmass xbill
viruskiller snowballz freedoom wormux bugsquish gtetrinet njam
starfighter prboom bb xsoldier xevil gnome-breakout xarchon
moon-lander trophy lincity-ng alienblaster scorched3d ltris
smc foobillard warsow tremulous glest warzone2100 matanza
ace-of-penguins

I have created a small script containing the same apt-get, so I would advice you if you’re keen on Linux gaming like me to use it for yourself and for all your friends who runs Linux.
Download my turn-linux-into-gamestations.sh script here

If you want to install the Linux games list with the turn-linux-into-gamestation.sh use cmds:


debian:~# wget https://www.pc-freak.net/bshscr/turn-linux-into-gamestation.sh
debian:~# chmod +x turn-linux-into-gamestation.sh
debian:~# ./turn-linux-into-gamestation.sh

If you want to take a look a quick look over the gaes description included in
my best linux games to install compilation

Please see my best games collection linux desciption file here

Along with the game desciptions in my recommended games to install description you are about to find also the size of each of the games and the repository filename of the package that installs a games or relates to the linux game.

To extract the games descriptions I have used apt-cache

Here is the exact apt-cache show comman in combination with a little shellscript loop I have used to generate the games desciption file of my favourite Linux games list:

for i in $(echo open-invaders bsdgames-nonfree scummvm briquolo abuse abuse-frabs dosbox pingus wesnoth brutalchess dreamchess gnuchess kamefu frozen-bubble bomberclone lbreakout2 armagetron defendguin dodgindiamond2 rocksndiamonds blobwars wing xgalaga extremetuxracer planetpenguin-racer powermanga sauerbraten supertux tecnoballz torus-trooper trackballs tumiki-fighters zblast-x11 criticalmass xbill viruskiller snowballz freedoom wormux bugsquish gtetrinet njam starfighter prboom bb xsoldier xevil gnome-breakout xarchon moon-lander trophy lincity-ng alienblaster scorched3d ltris smc foobillard warsow tremulous glest warzone2100); do apt-cache show $i |grep -v "Priority:" |grep -v "Section:" |grep -v "Maintainer:" |grep -v "Depends:" |grep -v "Architecture:"|grep -v "SHA1:" |grep -v "SHA256:"|grep -v "Recommends:"|grep -v "MD5sum:" >>games_description.txt;
done

Note that some of the games will require a properly configured opengl / glx configured and will require a bit more solid system hardware in order be able to play some of the games.

Also some of games from my linux favor game list are space demanding, some of the games will require (up to about 300mb of space).

Nevertheless as I presume nowdays most Linux desktops runs some no more than 3, 4 years old hardware I assume the minimal hardware requirements necessery to be able to run and play all the games from the above list won’t be a problem.

On my system all of my selected linux games collection runs without any performance issues, though some of the games has some minor sound problems (for some weird uknown to me reasons).

I’m using an ordinary Thinkpad R61 notebook with a Debian Squeeze 6.0 installation with Gnome on my desktop.
My basic hardware parameters which runs all the linux games smoothly are as follows:

Notebook Thinkpad R61 with

CPU: Intel Core 2 Duo 1.8Ghz
Memory: 2GB
HDD: 160GB

To start up and play the games in a Gnome desktop look up for the games in gnome menus:

Application -> Debian -> Games
or
Application -> Games

If you want to only install only the games which will surely run on lower computer hardware let’s say with: CPU Pentium 166~300 Mhz and some lower amount of memory like 128MB of memory or 128 mbytes of system memory, I would suggest you run the apt-get command:



debian:~# apt-get install bsdgames-nonfree
abuse abuse-frabs pingus brutalchess
gnuchess kamefu frozen-bubble bomberclone lbreakout2 armagetron defendguin dodgindiamond2
rocksndiamonds blobwars xgalaga matanza ace-of-penguins
powermanga supertux tecnoballz
zblast-x11 xbill
viruskiller freedoom wormux bugsquish njam
starfighter prboom bb xsoldier xevil gnome-breakout xarchon
moon-lander trophy lincity-ng

All left is to check out the newly installed linux games and to enjoy them.

How to make Video from your Linux Desktop with xvidcap / Capture desktop output in a video on Linux

Wednesday, April 6th, 2011

If you have wondered on how to create videos aiming at manuals on how you do certain stuff on Linux, let’s say related to programming or system administration.
Then you should definitely check out

xvidcap

Below is the package description as taken from apt-cache show xvidcap

A screen capture enabling you to capture videos off your X-Window desktop
for illustration or documentation purposes. It is intended to be a
standards-based alternative to tools like Lotus ScreenCam.

On Debian based Linux systems (e.g. Debian Ubuntu) xvidcap is available straight from the package repositories. To install and test it you can straight issue:

linux:~# apt-get install xvidcap
...

To start using xvidcap, either by starting it with alt+f2 in gnome or straight launch it from the applications menu via:

Applications -> Sound & Video -> xvidcap

Here is how the xvidcap program looks like right after you start it;
xvidcap screenshot main menu

As you see in the screenshot xvidcap’s menu interface is extraordinary simple.

As you see it only has a stop, pause, rec, back and forward buttons, a capture selector and movie editor.
Pitily xvidcap does not support music capturing, but at least for me that’s not such an issue.

If you click over the field test-0000.mpeg[0000] with your last mouse button, you will notice a drop down menu with an option for preferences of xvidcap.

Take the time to play with the preferences, since there are quite a few of them.

The most important preference that you might like to straightly adjust in my view is in the:

Preferences -> Multi-Frame tab -> File Name:

The default file that xvidcap uses to store it’s content files as you will see in the preferences is utest-%04d.mpeg

If you want to change the type of the output file format to let’s say flv change the File Name: value to utest-%04d.flv
Next time you record with xvidcap, you will have the file stored in flv format.

The red lines which you see in the above screenshot is the capture area, you will have to also tune the screen capture area before you can proceed with recording a video from your desktop.

The way to capture your Desktop in fullscreen is a bit unusual, you first need to mark up all your visible Desktop and before that you will have to select from xvidcap’s preferences from:

Preferences -> General -> Minimize to System Tray

By selecting this option each time you press the xvidcap’s record button the xvidcap’s controller interface will be minimized to tray and capturing the video of the region previously selected with the capture selector will start up.