Tuesday, January 22, 2008

Arabic Spam: Origination & Continuation

I remember receiving the first bunch in the late '90s, and the start of the new millenium. If I'm not mistaken, the first batch of email addresses was harvested from Microsoft Hotmail's website, where they created default profiles for email users and associated it with their country, as set during the registration process. But that wasn't an easy way to collect the emails, and at the time, wasn't worth the trouble, as companies didn't see the benefit of spam, yet.

A few months later, things evolved and people started harvesting emails from email forwards. Whenever someone sends an email, they stuff all the emails into the "TO" field, and off they send it. When the recipient clicks on the forward button to forward the message, the header of the old message is dumped as part of the new message (the forward), containing the list of emails of all the people to whom it was sent to previously.
I know 4-5 people who actually spend time to clean the email list, before sending a forward. And the same 4-5 people, use the "BCC" field, instead of the "TO" field. Whomever receives the emails, doesn't see the list of emails.
Unfortunately, this continues to this day, and emails are still being collected and spammed, because of 2 things: E-Mail providers are too lazy to filter out list of emails, and people are too lazy to do the same!!!
If you're wondering why this is specific to Arabic Spam only, it's because non-Arab sites spam using Spamming services! They send emails using brute-force and don't actually care whether you're an Arab, or not.

Sunday, January 20, 2008

DSL on Linux

I've been using QualityNet's silver Speedtouch 330 modem for the past 4 years on Linux, and it wasn't an easy task setting it up back then.

I don't like using routers because I don't have much control over them and limited to their restrictive functionality. I have a computer at home running as a gateway, on which I share my Internet connection with the rest of computers on the network.

[i] Internet provided over telephone lines (DSL) use PPP over ATM (PPPoA), where Internet over Fiber use PPP over Ethernet (PPPoE). Even if your ISP tells you to get a PPPoA router, and you have a fiber connection to your house, get a PPPoE and put your fingers in the technicians eyes!!!

Today, I wanted to run my HP ThinClient as gateway at home, instead of my old noisy & power-hungry Pentium4 box. I have Slax as my Linux distribution, using kernel 2.6.16, which according to Linux's Speedtouch FAQs, has built-in features to run the USB ADSL modem! This saves me the pain I had to go through last time on kernel 2.4!

On this page, you'll find the instructions, which I skipped to the part: "The Firmware" -- This is where all the fun begins!

[i] I had to download the firmware & its extractor on my current P4 box, because Slax doesn't have gcc, which means, you can't compile!

[i] If you don't have an existing Linux machine which has gcc, I suggest you download Knoppix, compile on the CD, then copy the 2 .BIN and the file "Makefile" to a USB flash disk. Open the Makefile file in a text editor and see where & how the files are supposed to go.

Create a file, in /etc/ppp, called "pap-secrets" and put the following inside it (including the double quotes!):
"username" "*" "password"


Moving to the next section: "Secrets" -- use the same settings as shown in the green field in the guide, but make sure to replace 2 things:
0) User should be in the form: "user" without the @isp part
1) Replace 0.00 with 8.35; these are the VPI.VCI values used in Kuwait, by the ISP.
Your "/etc/ppp/peers/speedtch" should contain the following:
noipdefault
defaultroute
user "username"
noauth
updetach
usepeerdns
plugin pppoatm.so
8.35

Almost done! What's left now, is to set the thing to automatically dial when it boots; for that, edit the file "/etc/rc.d/rc.local" and add this line:
`which pppd` call speedtch

Note: The characters surrounding "which pppd" are grave accents, not single quotes.

[i] On kernels 2.4.x & pre 2.6.10, the modem needed to be initialized, which took 37 seconds. Now, the modem starts the handshaking process with the ISP immediately.

Tuesday, January 15, 2008

Mass Copy and On-The-Fly Rename

I call this: Mass CPR. It's not the one that involves frenching chicks. This is about copying files & directories from one location to another, and renaming them on the fly, so that they reach the destination with a different name, applying the renaming according to a pattern.A co-worker had an external hard disk, that she put on her Mac to put 20GB of pictures. Later on, she wanted to view the pictures from her Windows laptop, which didn't see the HFS+ filesystem. Luckily, I found another HFS+ formatted disk in the Marketing department, where I copied the files & directories.The problem was that she had put colons in the file & directory names, as separators, instead of hyphens. FAT filesystems do not allow colons in file or directory names. To further complicate things, most of the files & directories were named in Japanese, and there was no temporary space to dump the data (other than the marketing disk). Since my laptop, is the only one with Linux installed, I was the only one capable of seeing the FAT & HFS+ partitions.
I started by writing a small PHP script (in CLI), which only worked on a small segment, and wasn't capable of doing recursions. The hunt for a program to do the dirty work began, and let me tell you this: It was NOT easy!!!After struggling for 4 days, I decided to ask the guys at #linux (on DALnet) and one of the OPs helped and gave me the following line:
pax -rw -s ',:,-,g' src dst
This magnificent line will copy, and replace any colon with a hyphen, all files & directories recursively, from the original directory, named src, to the target directory, named dst.
There was another thought of creating symbolic links to the original files, rename the links, and copy the links to the target disk, with the option to follow the symlinks. I'm not positive if that would've worked as intended, as pax did its job wonderfully. If you want to poke around with this idea, take a look at cpio.