Sunday, February 24, 2008

Youtube not reachable, temporarily

Youtube stopped opening around 23:19, February 24th.

At first I thought QualityNet has blocked Youtube, but they have no reason to. Further investigation showed that we got affected due to Pakistan blocking Youtube, and since we go through Pakistan, we got blocked as well.

Here's a traceroute of whole thing from QualityNet:
mj@mj-evil-station:~$ traceroute youtube.com
traceroute: Warning: youtube.com has multiple addresses; using 208.65.153.238
traceroute to youtube.com (208.65.153.238), 30 hops max, 40 byte packets
1 dsldevice.lan (192.168.1.254) 81.140 ms 89.402 ms 100.769 ms
2 62.150.109.1 (62.150.109.1) 199.651 ms 206.459 ms 261.711 ms
3 rb02-internet.qualitynet.net (62.150.93.233) 371.742 ms 317.482 ms 353.407 ms
4 jun-skb.qualitynet.net (62.150.200.5) 320.456 ms 225.162 ms 248.510 ms
5 195.229.27.29 (195.229.27.29) 188.310 ms 298.991 ms 432.766 ms
6 auh-emix-rb.emix.net.ae (195.229.31.3) 469.257 ms 299.604 ms 362.735 ms
7 dxb-r2-ether-1-0-0.emix.net.ae (195.229.0.98) 406.317 ms 195.229.0.126 (195.229.0.126) 196.553 ms dxb-r2-ether-1-0-0.emix.net.ae (195.229.0.98) 269.163 ms
8 195.229.0.181 (195.229.0.181) 355.469 ms 225.016 ms 226.647 ms
9 pos2-0.ar01.hkg04.pccwbtn.net (63.218.61.137) 582.209 ms 514.871 ms pos2-1
.ar01.hkg04.pccwbtn.net (63.218.61.141) 550.151 ms
10 pos1-0.cr02.hkg04.pccwbtn.net (63.218.114.66) 392.507 ms 417.320 ms 373.513 ms
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 youtube.com.hk (208.65.153.238) 520.823 ms 418.294 ms 431.483 ms

mj@mj-evil-station:~$ traceroute 208.65.153.238
traceroute to 208.65.153.238 (208.65.153.238), 30 hops max, 40 byte packets
1 dsldevice.lan (192.168.1.254) 45.403 ms 95.449 ms 99.379 ms
2 62.150.109.1 (62.150.109.1) 179.348 ms 368.496 ms 342.110 ms
3 rb02-internet.qualitynet.net (62.150.93.233) 369.112 ms 348.417 ms 253.605 ms
4 jun-skb.qualitynet.net (62.150.200.5) 163.947 ms 367.323 ms 245.216 ms
5 if-8-4.bb1.RSD-Riyad.teleglobe.net (66.198.126.45) 155.793 ms 41.123 ms 42.489 ms
6 if-6-0.bb1.JSD-Jeddah.teleglobe.net (195.219.153.25) 48.791 ms 50.982 ms 103.248 ms
7 if-11-0.mcore3.NJY-Newark.teleglobe.net (216.6.57.49) 430.598 ms 528.746 ms 583.103 ms
8 if-2-0.core1.NTO-NewYork.teleglobe.net (216.6.57.66) 448.712 ms 545.164 ms 423.040 ms
9 14.icore1.NTO-NewYork.teleglobe.net (216.6.82.2) 377.902 ms 403.390 ms 472.671 ms
10 209.58.26.30 (209.58.26.30) 575.457 ms 331.368 ms 379.346 ms
11 YOUTUBE-LLC.po1.401.ar2.SJC2.gblx.net (64.212.108.162) 645.748 ms 437.855 ms 420.526 ms
12 youtube.com.hk (208.65.153.238) 697.133 ms 447.682 ms 590.483 ms


From the above, you can see that the first attempt had a lot of unreachable hops, but they passed through the second time. This happened because I was attempting traceroute the first time while the routes to youtube were being cut/changed. The time between the 2 attempts was less than 10 minutes.

While writing this post, youtube seemed to work again. Some say it's not loading fully or some functions are not working.

Just checked from a FastTelco user, who was unable to view youtube at all. Here's a traceroute:
Tracing route to youtube.com [208.65.153.251]
over a maximum of 30 hops:

1 1 ms 1 ms 1 ms 192.168.1.1
2 724 ms 724 ms 716 ms 89.203.7.254
3 670 ms 682 ms 786 ms tec-core-so32.fasttelco.net [62.215.0.94]
4 696 ms 752 ms 971 ms 62.215.0.57
5 997 ms 748 ms 422 ms 78.159.161.9
6 463 ms 192 ms 125 ms 195.229.29.133
7 143 ms 73 ms 132 ms dxb-emix-ra.ge1302.emix.ae [195.229.31.67]
8 117 ms 100 ms 77 ms 195.229.0.181
9 245 ms 246 ms 386 ms t2a6-p5-3.uk-lon2.eu.bt.net [166.49.160.161]
10 281 ms 267 ms 250 ms t2c1-ge7-0.uk-lon2.eu.bt.net [166.49.176.43]
11 374 ms 321 ms 249 ms t2c1-p3-0.uk-glo.eu.bt.net [166.49.208.98]
12 250 ms 250 ms 244 ms t2c1-p9-1.uk-eal.eu.bt.net [166.49.208.125]
13 275 ms 271 ms 265 ms t2c1-p5-0-0.us-ash.eu.bt.net [166.49.164.65]
14 * * * Request timed out.
15 * 292 ms 260 ms 10.33.112.70
16 300 ms 272 ms 317 ms 10.33.254.141
17 379 ms 399 ms 378 ms 10.33.254.117
18 503 ms 388 ms 510 ms 10.33.176.114
19 383 ms 337 ms 330 ms youtube.com.hk [208.65.153.251]


More details on the ban from ZDNet.

Wednesday, February 20, 2008

High File Compression

I've been toying with 7-zip yesterday to see how far I could compress a file.

From the tests I did, 7-zip is capable of doing 7088:1 compression ratio. Here's the run:
mj@mj-evil-station:~/share$ dd bs=1073741824 count=10 if=/dev/zero | 7z a -mx9 -si haha.zip

7-Zip 4.43 beta Copyright (c) 1999-2006 Igor Pavlov 2006-09-15
p7zip Version 4.43 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Updating archive haha.zip

Compressing [Content] 0%
10+0 records in
10+0 records out
10737418240 bytes (11 GB) copied, 2465.64 seconds, 4.4 MB/s

mj@mj-evil-station:~/share$ ls -l
-rw-r--r-- 1 mj mj 1514800 2008-02-19 13:03 haha.zip

As you can see, I stuffed 10GB (not 11, notice the block size parameter) into a 1.4MB file. This was on a laptop. At home, my dual-core box stuffed 100GB into 14.4MB in 3 hours, 39 minutes & 30 seconds. (while watching a video file, consuming some CPU cycles)

I could probably optimize it more, by tweaking parameters of 7-zip, unfortunately it requires a lot of RAM, which I don't have (limited to 2GB only).

The tests done were simply stuffing zeroes in a text file, and then compressing the file. This is an ideal case, since all characters are the same, hence producing the highest rate of compression (provided you tweak your program to the max).

I have a couple of machines at work that are quad-core with 6GB of RAM, unfortunately they have Windows installed, so I don't have a device to pump zeroes into 7-zip directly, instead, I have to create a file of the size I need, then have 7-zip compress it; quite inconvenient.

Sunday, February 17, 2008

Making Bootable USB Drives Recognizable on Windows, Again

A couple of weeks back, I "borrowed" my sister's 256MB USB flash memory and put Slax on it.

Now, my sister wants her "USB" back, which I tried to explain that if I give her just the USB part it won't work as intended. As funny as I was, she didn't think so, and she wanted the WHOLE thing back. And working.

Windows didn't recognize the whole device and couldn't even see it as a removable disk, so formatting was not an option, yet.

Using a Windows XP bootable CD and trying to use fixmbr failed, because the recovery console failed to see the USB drive.

I fixed it on Linux, by using "dd" to write zeros on the disk (/dev/sdf in my case), then used fdisk (not cfdisk) to write a DOS partition table, then created a new primary partition with type "Windows 95 FAT" (b).

root@adrenalin:~# dd if=/dev/zero of=/dev/sdf
dd: writing to `/dev/sdf': No space left on device
517121+0 records in
517120+0 records out
264765440 bytes (265 MB) copied, 110.158 s, 2.4 MB/s


root@adrenalin:~# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF
disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by
w(rite)

Command (m for help): p

Disk /dev/sdf: 264 MB, 264765440 bytes
9 heads, 57 sectors/track, 1008 cylinders
Units = cylinders of 513 * 512 = 262656 bytes

Device Boot Start End Blocks Id System

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by
w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1008, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1008, default 1008):
Using default value 1008

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sdf: 264 MB, 264765440 bytes
9 heads, 57 sectors/track, 1008 cylinders
Units = cylinders of 513 * 512 = 262656 bytes

Device Boot Start End Blocks Id System
/dev/sdf1 1 1008 258523+ b W95 FAT32

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.


The disk is fixed, but doesn't have a filesystem. You can either make one in Linux, or slap it on a Windows machine & format it.

To make a FAT32 filesystem on Linux, run:
mkfs.vfat -F 32 /dev/sdf1