weblog d’un abbe

20080917

HOTD: Tweaking colo

Filed under: Fun — Tags: , , , , — abbe @ 0149

Yesterday in the afternoon, I was pointed to the ServerTweak.com page by a good friend Tarun Dua showing me how quickly a 32 MiB file gets downloaded on his n Mbps connection (n <= 4, I don’t remember the actual value). I also tried taking their Speed Test: 32 MB File Test where you’ve to download a 32 MiB file from their servers. On my near 256 Kbps internet connection the file got downloaded in 1-2s. I’m surprised, then I suspected file being transferred is in a highly compressed fashion, so to confirm this I executed following:

┌─(abbe@chateau:pts/1)─────────────────────────────────────────────────────(~)─┐
└─(01:32:%)── hexdump -C Desktop/32mb.test.file.zip              ──(Wed,Sep17)─┘
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
02000000

The file is all zeroes, so this means the file is transferred with Content-Encoding HTTP header set to gzip.

┌─(abbe@chateau:pts/1)─────────────────────────────────────────────────────(~)─┐
└─(01:32:%)── telnet www.servertweak.com 80                      ──(Wed,Sep17)─┘
Trying 216.152.250.131...
Connected to www.servertweak.com.
Escape character is '^]'.
GET /vip/dl.php?type=d&id=2 HTTP/1.1
Host: www.servertweak.com
Accept-Encoding: gzip
Connection: Close

HTTP/1.1 200 OK
Date: Tue, 16 Sep 2008 19:52:07 GMT
Server: Apache/2
Set-Cookie: PHPSESSID=03bf09c9c457814a9268896659c99257; path=/
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Last-Modified: Tue, 16 Sep 2008 19:52:20 GMT
Cache-Control: private
Content-Disposition: attachment; filename="32mb.test.file.zip"
Content-Transfer-Encoding: binary
Content-Length: 33554432
Content-Encoding: gzip
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: application/octet-stream

 �m7��w��       ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
...
��      ���(
�EEYConnection closed by foreign host.

The time it took is 2-3 seconds. And I don’t think this is unintentional, as this download is listed in the section titled Fastest Fiber Network. Anyways, that was marked as the humor of the day, since if you try to download the file using wget, curl or fetch, then you’ll figure out their real speeds :P. Happy loling…:-D

20080913

Gates defeated RMS

Filed under: Fun — abbe @ 1034

At least this post on alt.religion.emacs says this ;)

20080910

Emacs OS capable of rendering PDFs

Filed under: Yippee!! — Tags: , , , — abbe @ 1201

Emacs OS capable of rendering PDFs

Google IPv6 endpoint in Europe

Filed under: Experiences, Fun — Tags: , — abbe @ 0851
┌─(abbe@chateau:pts/8)───────────────────────────────────────────────────────────────────────(~)─┐
└─(08:41:%)── sudo traceroute -6 -I -n 2001:4860:0:2001::68                        ──(Wed,Sep10)─┘
Password: 
traceroute to 2001:4860:0:2001::68 (2001:4860:0:2001::68), 30 hops max, 40 byte packets
 1  2001:470:1f08:3b7::1  255.608 ms  258.492 ms  261.419 ms
 2  2001:470:0:67::1  263.345 ms  266.538 ms  269.720 ms
 3  2001:470:0:3f::2  282.060 ms  283.483 ms  285.925 ms
 4  * * *
 5  * * *
 6  2001:4860:0:2001::68  556.875 ms  503.697 ms  510.901 ms
┌─(abbe@chateau:pts/8)───────────────────────────────────────────────────────────────────────(~)─┐
└─(08:41:%)── sudo traceroute -6 -I -n 2001:4860:0:1001::68                        ──(Wed,Sep10)─┘
traceroute to 2001:4860:0:1001::68 (2001:4860:0:1001::68), 30 hops max, 40 byte packets
 1  2001:470:1f08:3b7::1  256.051 ms  258.644 ms  261.619 ms
 2  2001:470:0:67::1  264.279 ms  266.755 ms  269.970 ms
 3  2001:470:0:3f::2  281.020 ms  283.444 ms  286.494 ms
 4  * * *
 5  * * *
 6  2001:4860:0:1001::68  558.181 ms  516.731 ms  511.211 ms

2001:4860:0:1001::68 points to the European cluster (in Amsterdam, as mentioned by berniv6 on #ipv6 in ipv6.chat.freenode.net) of ipv6.google.com, whereas 2001:4860:0:2001::68 (ipv6.google.com) is known to be located in US. My tunnel remote endpoint (2001:470:1f08:3b7::1|216.66.80.26) is located in London, UK. Notice the RTT ;)

20080905

HE.NET IPv6 Certified

Filed under: Yippee!! — Tags: , , — abbe @ 1025

Certificate Image

20080903

linkedin.com violating CAN-SPAM Act ?

Filed under: Personal — Tags: , , , — abbe @ 2209
Dear Ashish,

On XXXX n, XXXXX XXXX sent you an invitation to become part of XXXXX XXXXX's professional network at LinkedIn.

Your invitation will expire soon! Follow this link to accept XXXXXXX XXXXX's invitation.

https://www.linkedin.com/XXXXXXXXXXXXXXXXX

Signing up is free and takes less than a minute.

On XXXX n, XXXXXXXX XXXXXXXXX wrote:

> To: Ashish Shukla [XXXXXXX@XXXXXXX.XXX]
> From: XXXXXXX XXXXXX [XXXXXXX@XXXX.XXX]
> Subject: Invitation to connect on LinkedIn
>
> Ashish,
>
> I'd like to add you to my professional network on LinkedIn.
>
> -XXXXXXX

The only way to get access to XXXXXXXX XXXXXXX's professional network is through the following link:

https://www.linkedin.com/XXXXXXXXXXXXXX

You can remove yourself from XXXXXXXXXXX XXXXXX's network at any time.

--------------

The pending expiration of your invitation is an automatic process triggered by system maintenance. This is the only email message you will receive from LinkedIn about the expiration of this invitation from XXXXXXX XXXXXX.

© 2007, LinkedIn Corporation

Above is the message which I received from LinkedIn.com couple of times. And in this message, there is no way, I can opt-out. So I think this is the violation of CAN-SPAM act which is discussed on ilugd list last month. Anyways, IANAL…:-D

20080901

Setup IPv6 tunnels from Hurricane Electric

Filed under: Free OS, Fun, Hacking — Tags: , , , — abbe @ 1259

The tunnel setup script:

#!/bin/sh
# Author: Ashish Shukla <gmail.com!wahjava>
# Description: Creates and initializes an IPv6 tunnel from the parameters given in
#              the file name stored in $TUNNEL_CONFIG variable
# License: BSD License
# OS: FreeBSD, GNU/Linux
# Tested on: FreeBSD 7.0-RELEASE-p3
#            Gentoo GNU/Linux 2008.0
# TODO: Port the script to other POSIX compliant OSs
#
# Copyright 2008. Ashish Shukla
#
# CREDITS: Martin J. Levy at HE.net, for the motivation.

OS=$(uname)
WHICH=/usr/bin/which
SCRIPT_NAME=`basename $0`

# The place where tunnel configuration file is stored
TUNNEL_CONFIG=${HOME}/.tunnelconfig

[ -f ${TUNNEL_CONFIG} ] && . ${TUNNEL_CONFIG}

FindLocalEndpoint() {
	if [ ${OS} = Linux ]; then
		if [ ! -z "${IP}" ] ; then
			INET_LOCAL_ENDPOINT=`${IP} addr show |awk "/^[[:space:]]*inet .*global ${IFACE}\$/ { print \\$2 }" |sed -e 's|/[[:digit:]]*||g'`
		elif [ ! -z "${IFCONFIG}" ]; then
			INET_LOCAL_ENDPOINT=`${IFCONFIG} ${IFACE} |awk "/^[[:space:]]*inet / { print \\$2 }" |sed -e 's|addr:||g'`
		fi
	elif [ ${OS} = FreeBSD ]; then
		INET_LOCAL_ENDPOINT=`${IFCONFIG} ${IFACE} |awk '/^[[:space:]]*inet / { print $2 }'`
	fi
}

IsValidExecutable() {
	if [ -z "$1" ] || [ ! -f "$1" ] || [ ! -x "$1" ] ; then
		echo "Error: $2 is not installed or is not executable."
		exit 1
	fi
}

IsValidExecutable "${WHICH}" "which"

if [ ! -z "${PREFER_SUDO}" ]; then
	[ -z "${SUDO}" ] && SUDO=$(${WHICH} sudo 2>/dev/null)
	IsValidExecutable "${SUDO}" "sudo"

	if ! ${SUDO} echo sudo verified ; then
		echo Error: Unable to verify sudo
		exit 1
	fi
	WHICH="${SUDO} ${WHICH}"
fi

[ -z "${WGET}" ] && WGET=$(${WHICH} wget 2>/dev/null)
[ -z "${AWK}" ] && AWK=$(${WHICH} awk 2>/dev/null)
[ -z "${SED}" ] && SED=$(${WHICH} sed 2>/dev/null)
[ -z "${RM}" ] && RM=$(${WHICH} rm 2>/dev/null)

# Check for the Required executables
IsValidExecutable "${WGET}" "GNU wget"
IsValidExecutable "${SED}" "sed"
IsValidExecutable "${AWK}" "awk"
IsValidExecutable "${RM}" "rm"

# echo GNU wget is installed at ${WGET}

if [ $OS = Linux ]; then

	[ -z "${IP}" ] && IP="$(${WHICH} ip 2>/dev/null)"
	[ -z "${IFCONFIG}" ] && IFCONFIG="$(${WHICH} ifconfig 2>/dev/null)"
	[ -z "${ROUTE}" ] && ROUTE="$(${WHICH} route 2>/dev/null)"

	if [ ! -z ${IP} ]; then
		IsValidExecutable ${IP} "iproute2"

		[ ! -z "${PREFER_SUDO}" ] && IP="${SUDO} ${IP}"
#		echo iproute2 is available at ${IP}

		[ ! -z "${INET_LOCAL_ENDPOINT} " ] && FindLocalEndpoint

#		echo Local Endpoint is ${INET_LOCAL_ENDPOINT}.
#		echo inet6 remote endpoint is ${INET6_REMOTE_ENDPOINT}
#		echo inet6 local endpoint is ${INET6_LOCAL_ENDPOINT}

#		echo ${IP} tunnel add ${TUNNEL_IFACE} mode sit remote ${INET_REMOTE_ENDPOINT} local ${INET_LOCAL_ENDPOINT} ttl 255
		${IP} tunnel add ${TUNNEL_IFACE} mode sit remote ${INET_REMOTE_ENDPOINT} local ${INET_LOCAL_ENDPOINT} ttl 255
#		echo ${IP} link set ${TUNNEL_IFACE} up
		${IP} link set ${TUNNEL_IFACE} up
#		echo ${IP} addr add ${INET6_LOCAL_ENDPOINT} dev ${TUNNEL_IFACE}
		${IP} addr add ${INET6_LOCAL_ENDPOINT} dev ${TUNNEL_IFACE}
#		echo ${IP} route add ::/0 dev ${TUNNEL_IFACE}
		${IP} route add ::/0 dev ${TUNNEL_IFACE}
#		echo ${IP} route add ${INET_REMOTE_ENDPOINT} dev ${IFACE}		
		${IP} route add ${INET_REMOTE_ENDPOINT} dev ${IFACE}		

	elif ! [ -z "$(${WHICH} ifconfig 2>/dev/null)" ]; then

		IsValidExecutable ${IFCONFIG} "ifconfig"
		IsValidExecutable "${ROUTE}" "route"
	
		[ ! -z "${PREFER_SUDO}" ] && IFCONFIG="${SUDO} ${IFCONFIG}" && ROUTE="${SUDO} ${ROUTE}"
#		echo ifconfig is available at ${IFCONFIG}

		[ ! -z "${INET_LOCAL_ENDPOINT} " ] && FindLocalEndpoint

#		echo ${IFCONFIG} ${TUNNEL_IFACE} up add ${INET6_LOCAL_ENDPOINT}
		${IFCONFIG} ${TUNNEL_IFACE} up add ${INET6_LOCAL_ENDPOINT}
#		echo ${ROUTE} -A inet6 del ${INET6_REMOTE_ENDPOINT/::1/::} dev ${TUNNEL_IFACE}
		${ROUTE} -A inet6 del ${INET6_REMOTE_ENDPOINT/::1/::} dev ${TUNNEL_IFACE}
#		echo ${ROUTE} -A inet6 add ${INET6_REMOTE_ENDPOINT/::1/::} gw ::${INET_REMOTE_ENDPOINT} dev ${TUNNEL_IFACE}
		${ROUTE} -A inet6 add ${INET6_REMOTE_ENDPOINT/::1/::} gw ::${INET_REMOTE_ENDPOINT} dev ${TUNNEL_IFACE}
#		echo ${ROUTE} -A inet6 add default gw ::${INET_REMOTE_ENDPOINT} dev ${TUNNEL_IFACE}
		${ROUTE} -A inet6 add default gw ::${INET_REMOTE_ENDPOINT} dev ${TUNNEL_IFACE}
#		echo ${ROUTE} add ${INET_REMOTE_ENDPOINT} dev ${IFACE}
		${ROUTE} add ${INET_REMOTE_ENDPOINT} dev ${IFACE}
	else
		echo Neither ifconfig nor ip executables are found at PATH
		echo Please make sure, that one of them is installed and present
		echo in PATH somewhere.
		echo PATH: ${PATH}
	fi
elif [ $OS = FreeBSD ]; then
	[ -z "${IFCONFIG}" ] && IFCONFIG="$(${WHICH} ifconfig 2>/dev/null)"
	[ -z "${ROUTE}" ] && ROUTE="$(${WHICH} route 2>/dev/null)"

	[ ! -z "${PREFER_SUDO}" ] && IFCONFIG="${SUDO} ${IFCONFIG}" && ROUTE="${SUDO} ${ROUTE}"
	[ ! -z "${INET_LOCAL_ENDPOINT} " ] && FindLocalEndpoint

	${IFCONFIG} ${TUNNEL_IFACE} create
	${IFCONFIG} ${TUNNEL_IFACE} tunnel ${INET_LOCAL_ENDPOINT} ${INET_REMOTE_ENDPOINT}
	${IFCONFIG} ${TUNNEL_IFACE} inet6 ${INET6_LOCAL_ENDPOINT}
	${ROUTE} -n add -inet6 default ${INET6_REMOTE_ENDPOINT%%/64}
	${IFCONFIG} ${TUNNEL_IFACE} up
else
	echo This script is not yet ported to ${OS}.
	echo You can help to port it to your ${OS}.
fi

TMPFILE=`mktemp -q -t ${SCRIPT_NAME}.XXXXX`

${WGET} -O /dev/null --keep-session-cookies "--post-data=f_user=${USER}&f_pass=${PASSWORD}&clearpass=" --save-cookies=${TMPFILE} http://ipv4.tunnelbroker.net/login.php 2>/dev/null
${WGET} -O /dev/null --load-cookies=${TMPFILE} "--post-data=ipv4b=${INET_LOCAL_ENDPOINT}&tunnel_id=${TUNNEL_ID}&update=Submit" http://ipv4.tunnelbroker.net/ipv4_update.php 2>/dev/null
${RM} -f ${TMPFILE}

exit 0

Following is the tunnel configuration file, which is stored in my home directory at $HOME/.tunnelconfig:

# Interface
IFACE=ng0

# User
USER=xxxxxxxx

# MD5 hash of the password
# GNU/Linux: printf ${password} |md5sum |awk '{ print $1 }'
# FreeBSD: md5 -q -s ${password}
PASSWORD=xxxxxxxxxxxxxxxxxxxx

# Global Tunnel ID as mentioned in the tunnel configuration webpage
TUNNEL_ID=00000

# Define it, if executing priviledged actions via sudo. RECOMMENDED.
PREFER_SUDO=1

# In case of GNU/Linux,
# if using ifconfig: 6in4 tunnel name start with sit, e.g. sit0
# if using iproute2: 6in4 tunnel name can be any 3 or more letters name, not starting with sit, e.g. he-tunnel
# whereas in FreeBSD, the name starts with gif, .e.g. gif0
TUNNEL_IFACE=gif0

# IPv4 Remote endpoint
INET_REMOTE_ENDPOINT=127.0.0.1

# IPv6 Remote endpoint
INET6_REMOTE_ENDPOINT=2001:db8:xxxx::1/64

# IPv6 Local endpoint
INET6_LOCAL_ENDPOINT=2001:db8:xxxx::2/64

# Define it if you don't want local IPv4 local endpoint to be detected at runtime.
# INET_LOCAL_ENDPOINT=

To use this script, download it and save it as setup-he.sh in your home directory, make it executable, create a tunnel configuration file at $HOME/.tunnelconfig similar to the one shown above, and then finally execute the script on terminal. Happy IPv6ing…:)

Create a free website or blog at WordPress.com.