Unix/Linux

Install SSH on Ubuntu Feisty Server Edition

08/19/2007 - 11:00pm
08/19/2007 - 11:59pm
Etc/GMT+2

Configure Network on Ubuntu Feisty

08/19/2007 - 10:00pm
08/19/2007 - 11:00pm
Etc/GMT+2

Setup Ubuntu 7.04 Server Edition

08/18/2007 - 12:00am
08/19/2007 - 11:59pm
Etc/GMT+2

Setting Goals for Ubuntu Server

08/10/2007 - 8:00pm
08/10/2007 - 10:00pm
Etc/GMT+2

Configuring A Server based on Ubuntu 7.04 Server Edition

08/01/2007 - 9:00pm
10/01/2007 - 9:00am
Etc/GMT+2

Joining flat files using shell scripting

Well, I like databases and thought why don't make a small relational database based on flat files and do joining them using Linux/Unix shell. I tried to invent this small example:

1. Have 2 flat text files, one for Employees (emp.tbl) and the other for Departments (dept.tbl), like the following:

emp.tbl content:
emp_id emp_name dept_id
1      Rami     1
2      Emad     1
3      Mary     2
4      Hassan   1
5      Rasha    2

يوم و عدى

رايح الشغل فى العربية. أشغل نجوم FM. برنامج ينصح غير الصائميين من خلال تليفونات ورسائل الـ SMS للمستمعين. واحد مسيحى باعت رسالة بتقول: "أنا مش بأكل قدام إخوانا المسلمين عشان براعى مشاعرهم" ويشكره مقدم البرنامج ويقول: "ده اللى إحنا عايزينه"

Why google is developing everything (GTalk, Google Desktop, ...) for Microsoft Windows only and not for Linux too, knowing that Linux is being very popular now?!!!

Simple Techniques to Send E-Mails from UNIX

I frequently need to be interactively email me from *NIX server when some output file is generated. I gathered here some used methods:
  1. Using mailx for text files:
  2. $ more filename.txt | mailx -s 'subject' email1@company.com, email2@company.com
  3. Using mailx for binary files:
  4. $ uuencode filename.bin | mailx -s 'subject' email@company.com
  5. Using elm to attach files:
  6. $ echo '[include filename.xls applications/msexcel base64]' > tempfile.txt
    $ elm -s 'Subject' email@company.com < tempfile.txt

gzip vs bzip2

We compress large files and ftp them to another server regularly. This operation could take about 9hrs. We are using gtar (tar+gzip) to compress the files. I thought we may use bzip2 to decrease the compressed files and save time in ftp, so I do assessment to compare between gzip and bzip2.

Here are the assessment table:

Delete all lines except first & last

I faced a interesting case: I have a script that generate a line every 10 minutes. This line is appeneded to one single file. You can imagine how big this file will be, if not cleaned regularly. But everytime, when I clean it, I should keep the first and last 2 lines. How can I do this using shell?

It's a piece of cake using sed. Find below the script:

Syndicate content