2011/06/27

Phishing

I just got called by someone from "Global Security Services." He had a very pleasant South Asian accent. He started with "I assume you are running the Microsoft Windows operating system." To which I answered "Of course not!" He quickly hung up.

Now, I'm going to be highly suspicious of anyone calling me long distance without caller ID info. The "Global Security mutter mutter" made me highly suspicious that this was part of a new phishing scam that's been going on. The goal is to have you install some "Microsoft Security product" which is of course malware.

Notice to readers and family members: They are calling people in Canada. Never ever install anything a cold-caller says to. Ideally stop using Windows at all. It's security is atrocious and the knowledge required to keep it secured is beyond most normal users.

2011/06/03

Alpine Linux

My router (pinky) used to boot uClibc Bering from a floppy. ucBering was really cool, but was getting ancient. The hardware was very noisy too. So I changed to less noisy hardware (JA Pinkerton), and run Alpine Linux. Alpine is a descendant of LEAF, which Bering was a variation of. It boots from CD and saves state to a USB key. Just have to remember to do lbu ci after any config change.

What's awesome: finally getting tcpdump on my router!
What's strange: full perl 5.12.3 on my router!

Alpine also include clamav, so you could use it to scan Windows computers for viruses. Kind of like these instructions.

2011/05/18

CentOS5 and a recent kernel.

CentOS 6 is just around the corner. But for those of us who have CentOS 5 deployed just about everywhere, the wait for a better kernel is annoying. While wasting time in some unsavoury corner of the Internet, I came across vserver, which is a clever way of sharing a kernel between separate OS instances. Think of it as VM writ small.

But even if you don't want or need multiple OSes, vserver installs a RHEL 6 kernel. And it works with CentOS 5. Say you need ATA TRIM? You got it. Having trouble getting WiFi working? Bingo. Card reader on your Laptop not working? It does now.

EDIT: the catch is that sound is no longer working. While this is OK for the laptop, it isn't for my desktop. Ah well.

However, I can TRIM corey's SSD by booting with the vserver kernel, then doing
dd if=/dev/zero of=/tmp/very-large

rm /tmp/very-large
The first command is going to fill any remaining space on the disk with zeros, so don't be doing anything important at the same time. When the disk fills up, it will exit and the second command will free the space.

You could also do the same thing with any boot CD that has TRIM support.

2011/05/17

Z8NA-D6 and lm-sensors

The ASUS Z9NA-D6 motherboard uses a w83795 chip for lm-sensors. Asus provides binary drivers, and then only for CentOS 5.4. On 5.6, you'll need these drivers. I've tested and they work on CentOS 5.6, 2.6.18-238.9.1.el5 x86_64. However, while sensors sees the chip, it doesn't manage to read the values. Must poke at it further.

Update: I finally got it working.

2011/05/04

Disk speed

I don't know if this makes sense. In fact, I'm pretty sure it doesn't. Writing 10 GB to a WD Green 2.0TB drive in a NexStar CX USB 3.0 enclosure connected to an ASUS Z8NA-D6C.
# time dd if=/dev/zero of=/dev/sdc2 bs=1024k count=20480

20480+0 records in
20480+0 records out
21474836480 bytes (21 GB) copied, 704.374 seconds, 30.5 MB/s

real 11m44.375s
user 0m0.029s
sys 0m21.517s


Same operation on an ASUS M2N-MX SE with "only" 4 GB of RAM:
# time dd if=/dev/zero of=/dev/sdb2 bs=1024k count=20480

20480+0 records in
20480+0 records out
21474836480 bytes (21 GB) copied, 847.95 seconds, 25.3 MB/s

real 14m7.969s
user 0m0.335s
sys 7m17.540s
Mind you, Xorg is running also, so that takes up RAM and CPU.

2011/04/01

loopback magic

First you used dd to grab the entire contents of a disk. Now you want to copy that disk to another one. Only the new disk isn't the exact same size as the old one, and probably doesn't have the same geometery. In which case you would be better off doing an rsync then dd to the new disk. The following trick will also work if you just want to read a partition.

First we need the offset of each partition:
#sfdisk -uB -l fulldump

last_lba(): I don't know how to handle files with mode 81a4
Disk fulldump: cannot get geometry

Disk fulldump: 17 cylinders, 255 heads, 63 sectors/track
Warning: The partition table looks like it was made
for C/H/S=*/224/56 (instead of 17/255/63).
For this listing I'll assume that geometry.
Units = blocks of 1024 bytes, counting from 0

Device Boot Start End #blocks Id System
fulldump1 28 144255 144228 83 Linux
fulldump2 144256 39080831 38936576 8e Linux LVM
fulldump3 0 - 0 0 Empty
fulldump4 0 - 0 0 Empty
We ignore the warning messages, because we see that the first partition starts at 28*1024=28672 bytes. So we can mount that easily.
# mount -o loop,offset=$((28*1024)) fulldump /mnt

# ls /mnt
config-2.6.18-164.el5 message
config-2.6.18-194.11.3.el5 symvers-2.6.18-164.el5.gz
grub/ symvers-2.6.18-194.11.3.el5.gz
initrd-2.6.18-164.el5.img System.map-2.6.18-164.el5
initrd-2.6.18-194.11.3.el5.img System.map-2.6.18-194.11.3.el5
initrd-2.6.18-194.11.3.el5-PG1.img t/
initrd-2.6.18-194.11.3.el5-PG2.img vmlinuz-2.6.18-164.el5
initrd-2.6.18-194.11.3.el5-SSD1.img vmlinuz-2.6.18-194.11.3.el5
lost+found/
I used $((28*1024)) because this way bash does the calculation for us.

2011/03/11

Rocky (again)

Installing foo2slx proved surprisingly painless. Of course, I did it the hard way by putting it in /opt rather /usr. Even then, I got the CUPS print page printed in colour in under 10 minutes.

I then did a little calculation. A complete set of toner carts are 220 $ (plus shipping) for 3000 pages. That's roughly 7.25 cents per page. Using Lexmark toner, roughly 15 cents per page. Refilling by the carts by-hand brings it down to 3 cents a page pus my wasted time. So no matter how you look at it, this is an expensive toy. I think I'l put a kitty jar next to the printer to collect money on each print.