Secure the nation

5 02 2013

Dear visitors

I am informing you that I am currently one of the authors for Incognito Lab. Please visit me here.

In addition, it would be great if you follow our facebook by
Get Secured by Incognito Lab

Yours faithfully
ambient





IP address and its geographic information

15 03 2012

To delve into geographic location information, you need a good database.

Free GeoIP could be your answer as Ivan Bütler described in his article:

GeoIP List Conversion for Security Tools “geo2nginx.pl”

.  

 

 





Compression in Linux

30 01 2010

To deflate files in Linux, gzip and zip commands are commonly used. The difference between these 2 commands are

  1. gzip removes the original source file while zip retains the source file after compressing.
  2. gzip compresses each file individually, but zip compacts the files into one archive file.

To illustrate,

[ambient@localhost box]$ ls -l
total 24
-rwxr-xr-x 1 ambient ambient 11816 Dec 31 07:39 htpasswd
-rw-r--r-- 1 ambient ambient    60 Dec 31 07:39 udb1
[ambient@localhost box]$ gzip *
[ambient@localhost box]$ ls -l
total 20
-rwxr-xr-x 1 ambient ambient 5667 Dec 31 07:39 htpasswd.gz
-rw-r--r-- 1 ambient ambient   80 Dec 31 07:39 udb1.gz
[ambient@localhost box]$ gunzip *.gz
[ambient@localhost box]$ ls -l
total 24
-rwxr-xr-x 1 ambient ambient 11816 Dec 31 07:39 htpasswd
-rw-r--r-- 1 ambient ambient    60 Dec 31 07:39 udb1
[ambient@localhost box]$ zip pack.zip *
adding: htpasswd (deflated 52%)
adding: udb1 (deflated 5%)
[ambient@localhost box]$ ls -l
total 36
-rwxr-xr-x 1 ambient ambient 11816 Dec 31 07:39 htpasswd
-rw-r--r-- 1 ambient ambient  5963 Dec 31 08:15 pack.zip
-rw-r--r-- 1 ambient ambient    60 Dec 31 07:39 udb1
[ambient@localhost box]$ unzip pack.zip
Archive:  pack.zip
replace htpasswd? [y]es, [n]o, [A]ll, [N]one, [r]ename: n
replace udb1? [y]es, [n]o, [A]ll, [N]one, [r]ename: n
[ambient@localhost box]$ ls -l
total 36
-rwxr-xr-x 1 ambient ambient 11816 Dec 31 07:39 htpasswd
-rw-r--r-- 1 ambient ambient  5963 Dec 31 08:15 pack.zip
-rw-r--r-- 1 ambient ambient    60 Dec 31 07:39 udb1

In brief,


> gzip srcfile //deflate
> gunzip srcfile.gz //inflate
#############
> zip file.zip srcfile //deflate
> unzip file.zip //inflate

tar

In the past, tar command was used to create an archive file on tapes, so it is called as “Tape ARchive”.

To bundle files into an archive
> tar -cvf pack.tar *

To list
> tar -tvf pack.tar

And to extract the archive
> tar -xvf pack.tar

Make an archive before compressing files is a convention way to distribute source or binary files in Linux.