shell

Controlling application frames (windows) in linux

Signage Player is a program created by MediaSignage which is available for free and allows the user to set up linux or windows pcs that display advertisement or other sorts of content in slideshows etc. The player launches after the pc does and starts displaying its campaign in fullscreen. If you use an older version of linux it will automatically remove the gnome-panel (the taskbar) if you selected that option during installation. If you did not select that option or are using a new linux version with a more recent gnome ui, the player will not remove the panel. If the panel is not removed the player will still launch in full screen but the panel will be visible. The player can be brought to the front by clicking the mouse once, but naturally in a real environment you want it to launch into proper fullscreen because nobody will be there to click anything. What's needed is a script solution that will automatically give focus to the player window (which is what happens when you click inside that window manually) so the player will be brought to the front and the gnome panel will become invisible.

Use Samba or OpenSSH

If you want to host (or have access to) network folders that can be accessed with Windows in Linux systems you can use Samba[1]. You just have to install and configure it which can be very tricky.
On the other hand if you want to have access between Linux computers you can use OpenSSH which is already included in most of the Linux distributions.

[1] http://en.wikipedia.org/wiki/Samba_%28software%29
[2] http://www.openssh.com/

Create Backups With Cron And Send Them To A GMail account

The best free, secure, reliable, and easy solution was the following:

Write a shell script to create backups, call it by cron on a daily, weekly, whatever basis and send the backups to GMail.
Needed items: on the shell gzip and mime-construct (to send emails with attachments), cron jobs, and GMail (or whatever provider with loads of space - GMails current 7GB will be more than enough for the near future).

Shell script

#!/bin/sh

filename1="/tmp/backup_`date +%d%m%Y`.sql";
filename2="/home/www/data.conf";
filename3="/home/www/data-directory/";
target="/tmp/backup_foobar_`date +%d%m%Y`.tar"
myuser="foo";
mypassword="bar";
myemail="foobar@gmail.com";
mysubject="Backup of foobar, `date`";
mydescription="Daily backup of foobar, `date`";

mysqldump -u$myuser -p$mypassword db1 > $filename1;
mysqldump -u$myuser -p$mypassword db2 >> $filename1;
mysqldump -u$myuser -p$mypassword db3 >> $filename1;
mysqldump -u$myuser -p$mypassword db4 >> $filename1;

tar --create --file=$target $filename1 $filename2 $filename3;
gzip $target ;
mime-construct \
--to "$myemail" \
--subject "$mysubject" \
--string "$mydescription" \
--type text/plain \
--file-attach $target.gz;

rm $filename1;
rm $target.gz

If you need additional security, you can of course encrypt the tar file, so your data will be secure, even if someone breaks into your GMail account or you don't trust Google.

If you want you can download a copy via POP3, so you will have backups in your GMail inbox and locally - which should be sufficient for every situation.

Taggings:

Using Git DVCS (distributed version control system) and GitHub to effectively collaborate on an open-source software project

While collaboratively working together on an open-source project (which aims to provide a fresh web app framework in this concrete case) and moves at a fast pace it conseqeuntly turned out that using the standard approach of centralized VCS for it soon hit its limits. Therefore, we jointly decided in the community to switch to a decentralized one, namely Git. This DVCS was originally developed by Linus Torvalds for managing the development of the Linux kernel. Its main concept basically is that everybody has his/her own complete "clone" of the code repository. So there isn't a single centralized code repository as in the structure/architecture of Subversion, but a number of decentralized ones. As a consequence Git was also developed to have very powerful and convenient capabilities of merging branches of code repository clones. This feature which is also one of Git's biggest strengths shall be described and explained in more detail. Git's basic usage is mainly command line based and can especially in the beginning pose quite a steep learning curve on new users. So it should be given a short introduction to Git's main concepts and concrete usages as well. Another very nice companion to Git is the Git code repositories hosting site/service GitHub (github.com) which can make using Git simpler and furthermore improve collaborative development processes and tasks of a programming/development project. This shall also be presented and explained.
Subscribe to shell