Sum numbers in a row with paste + awk
When in the need of summing tracks for Artemis:
paste *.track | awk ‘{sum=0; for (i=1; i<=NF; i++) { sum+= $i } print sum}’ > sum.track
ciao
How to open .daa disk images from Linux/Ubuntu
DAA files are images of CD or DVDs stored in a proprietary format, so there’s no “out-of-the-box” solution from your favourite Linux shell.
You have to download PowerISO, a software famous for its Windows incarnation but available also for Linux from their website. Download the package into a suitable directory, expand it and run the program contained as described in third line:
wget http://poweriso.com/poweriso-1.3.tar.gz tar xfz poweriso-1.3.tar.gz ./poweriso convert "yourfile.daa" -o outputfile.iso -ot iso
Then to mount .iso file, Linux can do it for you:
mount -o loop yourfile.iso /your/folder
SQL, time to migrate to Postgre
MySQL… lovely thing so easy to use.
Some drawbacks when it comes to performances, but even worst if you look for a really open source package, no matter if you use it for academia or for commercial activities (see this). I don’t want to get locked in!
So I think I have to migrate to PostgreSQL, let see if it’s so different.
Simple CSS photo gallery
Adapting to page width, this simple unordered list is suitable for most photo galleries…
<style>
.gallery li {
display: inline; list-style: none;
width: 150px; min-height: 175px;
float: left; margin: 0 10px 10px 0;
text-align: center; }
</style>
<h3>Gallery</h3>
<ul class="gallery">
<li><a href="/images/image.jpg"><img src="/images/image_tn.jpg" alt="image" /></a>
<br />Image Caption</li>
<li><a href="/images/image.jpg"><img src="/images/image_tn.jpg" alt="image" /></a>
<br />Image Caption</li>
<li><a href="/images/image.jpg"><img src="/images/image_tn.jpg" alt="image" /></a>
<br />Image Caption</li>
</ul>
Found on the net…
I also found this nifty example: http://joshuaink2006.johnoxton.co.uk/templates/gallery/. Cool if you have simplicity in mind.
NIS, Autofs and kerberos within the CRIBI Network
Settings memo for the CRIBI Bioinformatics network:
- Install nis, autofs, nfs-client packages (optionally libpam-krb5 for kerberos authentication)
- Nis domain is: cribi.unipd.it
- /etc/network/interfaces
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
- See /etc/krb5.conf as in package
- Special issue: if your PC has a local partition for the homes, then if we want to access local homes in conflict with NIS… let’s change local home path to mount home drive in /usr/local/home instead of /home. See /etc/fstab for this.
- In /etc/passwd add a nis mask (+,,,,,) and change local users home directory to /usr/local/home
- See /etc/yp.conf
- See /etc/auto.master
- See /etc/nsswitch.conf
-
proch@darwin /etc/rc2.d $ ls S10apmd S50avahi-daemon S90binfmt-support S10sysklogd S50cups S98nis S11klogd S50NetworkManager S98usplash S20apport S50rsync S99autofs S20dkms_autoinstaller S50saned S99laptop-mode S20hotkey-setup S50system-tools-backends S99ondemand S20nfs-common S70bootlogs.sh S99rc.local
- See /etc/pam.d/common* for kerberos
Summing values from shell
Suppose you have two or more text files with one value per line
File1:
0 1 4 20 2
If you want to sum them:
paste first.txt second.txt | awk '{ print $1+$2; }'
User quotas with Ubuntu
This step by step tutorial shows how to install and implement user quotas, to limit disk space available for selected users in a Linux system (tested on Ubuntu, using repositories). Read the rest of this entry »
Linux back up: a review of free tools
I found a useful review of free backup systems in junauza.com. As untidy as usual, I definitely rely on premade solutions, even if I like hacking with small scripts running in cron directorys ![]()
This site provides a rsync script.
Memo: buy a 1Tb hard drive to make backup simpler…
A tiny CMS written in Perl
Davide Bianchi, an Italian sysadmin popular for his tales, wrote his own CMS to manage his site. He called it “CMS FDT”, Italian acronym for “DIY CMS”… You can find it here, code and comments…
Alternative shell interfaces in Ubuntu Linux
Faster than default Gnome-terminal, they can be installed via repository. They run under X and don’t require Gtk or Qt libraries…
1) xterm, is quite fast. I use it as a nice replacement with this shortcut:
xterm -fs 11 -fa "Courier 10 Pitch"
2) mrxvt is very fast, with nice tabs. I run it in default configuration, without antialiasing or background to keep good performance.