Thursday, March 1, 2012

Sort IP Addresses with GNU sort

How to sort IP addresses using the GNU sort utility.

The short answer. Here’s the invocation that works. It’s explained in the long answer that follows.
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4

The long answer. More than once I’ve been confronted with a list of IP addresses that I’ve wanted to sort into numeric order. Trouble is, the dotted-quad notation isn’t sort-friendly. Consider the following raw list of addresses.
$ cat addresses.txt
129.95.30.40
5.24.69.2
19.20.203.5
1.2.3.4
19.20.21.22
5.220.100.50

Without options, sort will rely on alphabetic order, which certainly won’t do what you want:
$ sort addresses.txt
1.2.3.4
129.95.30.40
19.20.203.5
19.20.21.22
5.220.100.50
5.24.69.2
There are so many mistakes in this ordering I’m not even going to try to list them all.
The situation is only marginally improved when using the --numeric-sort (-n) option.
$ sort -n addresses.txt
1.2.3.4
5.220.100.50
5.24.69.2
19.20.203.5
19.20.21.22
129.95.30.40

The first set of numbers in each dotted-quad sort correctly—5 preceeds 19, and 129 is at the tail end—but the internal numbering still gets improper treatment. 5.220.100.50 is listed prior to 5.24.69.2 because 220 is alphabetically prior to 24. Likewise the two19.20.x.x addresses are mixed up because 203 is alphabetically prior to 21.
The solution is to tell sort to order the list numerically, considering each address as a set of four numeric fields, each separated by a dot.
$ sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 addresses.txt
1.2.3.4
5.24.69.2
5.220.100.50
19.20.21.22
19.20.203.5
129.95.30.40

In English, you’re saying, Yo, sort! I’ve got here a list of numbers (-n), but each item in the list consists of some subnumbers, fields set apart from the others by a dot (-t .). Sort first by the first field, and only the first field (-k 1,1), then by the second and only the second (-k 2,2), and so on (-k 3,3 -k 4,4).




.
Read More

Monday, January 30, 2012

AVG Antivirus 2012 Offline Installer Download

AVG free antivirus adalah antivirus komputer favorite, dan karena baru tahu dari software yang dipakai saat melakukan update database virus terakhir bahwa sudah rilis versi 2012. Namun seperti biasa installernya selalu online (yang standar), dan itu merepotkan kalau koneksi internet kita pas-pasan, akhirnya mencari link download AVG 2012 offline.

Kawan-kawan yang juga suka menggunakan AVG, bisa menggunakan informasi ini untuk lebih mudah mengupgrade antivirusnya ke versi terbaru 2012.

Apa saja yang baru di AVG versi 2012 ini? mungkin sedikit ulasan berikut bisa memberi gambaran pada Anda.

Versi terbaru menambahkan teknologi perlindungan baru, peningkatan dan percepatan kinerja komputer mendownload konten. AVG 2012 lebih ringan, lebih cepat dan lebih kecil daripada produk AVG sebelumnya.

AVG Anti-Virus 2012 Offline Redistributable Setup Installer Download
Link: http://www.avg.com/us-en/download.prd-triavc#tba2




.
Read More

Monday, January 16, 2012

Remove Squid footer completely

Easy way


I’m using debian server… I hope this tips will work for all linux distro
Edit your ERR_ACCESS_DENIED file, where?? mine is in /usr/share/squid/error/English/
Add this line to the last line of ERR_ACCESS_DENIED file:
<!– Generated %T by %h (%s) –>
Save the file… reload squid configuration file /etc/init.d/squid reload
You’re done





Hard way


You can remove footer from squid error pages. Removing the version number from the footer is very easy.

In squid.conf enable
httpd_suppress_version_string
But what if you want to remove the whole message.
Generated Thu, 08 Jun 2000 06:58:30 GMT by proxy1.proxy.com (Squid/2.3.STABLE1)There is no configuration available to remove it but you can always edit the source file for that. Don't worry its very easy. Easy because its really easy.

Just follow the following steps:
  1. Go to squid source. /usr/src/squid/src
  2. Backup the existing file errorpage.c cp ./errorpage.c ./errorpage.c.bkp
  3. Remove errorpage.o rm errorpage.o
  4. Edit the file errorpage.c vim errorpage.c
    {
    ERR_SQUID_SIGNATURE,
    "\n<\BR clear=\"all\">\n"
    "<\HR noshade size=\"1px\">\n"
    "
    \n"
    "Generated %T by %h (%s)\n"
    "
    \n"
    "<\/BODY><\/HTML>\n"
    }
  5. Remove the line "Generated %T by %h (%s)\n"
  6. Save and exit :wq
  7. Reconfigure squid with old options ./configure .........
  8. Make clean make clean
  9. Make make
  10. Make all make all
  11. Make install make install
  12. Stop squid /usr/local/squid/sbin/squid -k shutdown
  13. Start squid /usr/local/squid/sbin






.
Read More

Thursday, January 12, 2012

How to Remove Your GMail account on Android Market without doing Factory reset

How to Remove Your GMail account on Android Market without doing Factory reset


  1. Download Root Explorer from Android Market
  2. Explore to /data/system/ and find this file : accounts.db
  3. Delete that file (accounts.db)
  4. Walla…you can register another account



.
Read More

Wednesday, January 11, 2012

Android BlackMarket

Read More

Thursday, December 22, 2011

Limit IP Otomatis Queue Tree Dengan Script

Read More

Sunday, October 23, 2011

My Link

Favorites Links

Convert Coordinates

  1. Convert Between Geographic and UTM Coordinates
  2. Geographic/UTM Coordinate Converter



xxxxx



xxxxxxx



xxxxxxx



xxxxx
Read More