Rss Feed
Tweeter button
Facebook button
Linkedin button
Digg button
Youtube button

Archive for February, 2009

Friday, February 27, 2009 Categorized under Tech

¿ʇı̣ əsnqɐ ʇ,uɐɔ noʎ ɟı̣ əpoɔı̣un sı̣ pooɓ ʇɐɥʍ

At first when my friend put his name upside down in orkut, I was actually amazed. How it is done ??

Its just abusing the unicode, I wonder  which head this actually behind this wonder idea.

Each character is mapped to some othercharacter which resembles as if the character is put upside down.

Example of such a mapping is given below.

! – EXCLAMATION MARK (U+0021) ¡ – INVERTED EXCLAMATION MARK (U+00A1)

7 – DIGIT SEVEN (U+0037) Ɫ – LATIN CAPITAL LETTER L WITH MIDDLE TILDE (U+2C62)

Since it is a bit difficult to map these manually, people started writing their on scripts for this. Such a sample script is given below.

JavaScript Code

For the JavaScript hackers out there, here’s some code to test with (code from revfad):

function flipString(aString)
{
	var last = aString.length - 1;
	//Thanks to Brook Monroe for the
	//suggestion to use Array.join
	var result = new Array(aString.length)
	for (var i = last; i >= 0; --i)
	{
		var c = aString.charAt(i)
		var r = flipTable[c]
		result[last - i] = r != undefined ? r : c
	}
	return result.join('')
}

var flipTable = {
'\u0021' : '\u00A1',
'\u0022' : '\u201E',
'\u0026' : '\u214B',
'\u0027' : '\u002C',
'\u0028' : '\u0029',
'\u002E' : '\u02D9',
'\u0033' : '\u0190',
'\u0034' : '\u152D',
'\u0036' : '\u0039',
'\u0037' : '\u2C62',
'\u003B' : '\u061B',
'\u003C' : '\u003E',
'\u003F' : '\u00BF',
'\u0041' : '\u2200',
'\u0042' : '\u10412',
'\u0043' : '\u2183',
'\u0044' : '\u25D6',
'\u0045' : '\u018E',
'\u0046' : '\u2132',
'\u0047' : '\u2141',
'\u004A' : '\u017F',
'\u004B' : '\u22CA',
'\u004C' : '\u2142',
'\u004D' : '\u0057',
'\u004E' : '\u1D0E',
'\u0050' : '\u0500',
'\u0051' : '\u038C',
'\u0052' : '\u1D1A',
'\u0054' : '\u22A5',
'\u0055' : '\u2229',
'\u0056' : '\u1D27',
'\u0059' : '\u2144',
'\u005B' : '\u005D',
'\u005F' : '\u203E',
'\u0061' : '\u0250',
'\u0062' : '\u0071',
'\u0063' : '\u0254',
'\u0064' : '\u0070',
'\u0065' : '\u01DD',
'\u0066' : '\u025F',
'\u0067' : '\u0183',
'\u0068' : '\u0265',
'\u0069' : '\u0131',
'\u006A' : '\u027E',
'\u006B' : '\u029E',
'\u006C' : '\u0283',
'\u006D' : '\u026F',
'\u006E' : '\u0075',
'\u0072' : '\u0279',
'\u0074' : '\u0287',
'\u0076' : '\u028C',
'\u0077' : '\u028D',
'\u0079' : '\u028E',
'\u007B' : '\u007D',
'\u203F' : '\u2040',
'\u2045' : '\u2046',
'\u2234' : '\u2235'
}

for (i in flipTable)
{
	flipTable[flipTable[i]] = i
}


Tuesday, February 24, 2009 Categorized under Linux

Bandwidth monitoring using iptables

It was a new info for  me that bandwidh can be monitored using Iptables. Well, I tried it and worked fine.

If you want to try this, here are the steps.

Most of the time we use iptables to set up a firewall on a machine, but iptables also provides packet and byte counters.

Every time an iptables rule is matched by incoming or outgoing data streams, the software tracks the number of packets and the

amount of data that passes through the rules.

First, we can create a custom chain, say bandwidth

iptables -N bandwidth

iptables -A INPUT -d <ip> -j bandwidth

iptables -A bandwidth -d <ip>

Bandwidth statistics

Viewing the current bandwidth usage is a matter of running iptables with the -L and -v options. The -L outputs the statistics for a

chain (or all chains if none is provided). The -v option provides verbose output, including the packet and byte counters that we are interested in

iptables -n -V -L

[root@server1 ~]# iptables -n -L -v
Chain INPUT (policy ACCEPT 447 packets, 164K bytes)
pkts bytes target     prot opt in     out     source               destination
265 53063 bandwidth  all  –  venet0 *       0.0.0.0/0            69.197.157.245


Tuesday, February 24, 2009 Categorized under Tech

openSSH PRNG not seeded

openSSH PRNG not seeded

This errror is usually seen when the random number generator is broken.

To fix this

Remove the random devices

rm -rf /dev/random && rm -rf /dev/urandom

now recreate both

mknod /dev/random c 1 8 &&  mknod /dev/random c 1 9