I am just back from a trip with my friends Denis and Lucy in the death valley. Few days before our trip it rain the in the Death Valley. That’s why we had the chance to see the entire valley covered by California Poppies.
Trip to death valley
|
|
| Posted on Feb 21, 2008 by: Fred Cirera @ 22:49 |
Comments: 11
|
Network programing with bash
|
In my last article I showed how to use file descriptors in shell scripts. If your shell happens to be bash you can even have a file descriptor map to a network socket.
When executing a command on a /dev/tcp/$host/$port pseudo-device, Bash opens a TCP connection to the associated socket. |
| Posted on Jan 30, 2008 by: Fred Cirera @ 17:50 |
Comments: 34
|
File descriptors in shell
|
Usually people don't know or have forgotten that they can open file descriptors in shell.
Open a file descriptor in shell can be useful for two things. Manipulate several input and output as the same time, and for performance. |
| Posted on Jan 30, 2008 by: Fred Cirera @ 12:31 |
Comments: 36
|
Send a multipart email in Python
|
This short example show how to send a mail with attachments using Python.
First we create a Mime container using the class MimeWriter and then the message is sent using smtplib package. |
| Posted on Jan 24, 2008 by: Fred Cirera @ 13:28 |
Comments: 41
|
Phone-based 'vishing' attacks
|
The FBI‘s Internet Crime Complaint Center IC3 published a new advisory on ‘vishing’ attacks As phishing is becoming harder and harder scammers are now using the phone to gather personal information such as credit cards and social security numbers.
We have spent so much time telling people, “don’t trust the mail” and “don’t trust the web” that people don’t trust them anymore. That’s why scammers are starting to use more traditional means of communication, which people are more familiar with and trust. You are more willing to trust some nice and sweet voice on the phone than an funky text in your inbox. The technology to securely sign and identify the sender of an email exists. I don’t understand why the banks are not using it. |
| Posted on Jan 18, 2008 by: Fred Cirera @ 14:12 |
Comments: 9
|
337,000 Personal information stolen.
|
Tennessee is reporting that 337,000 voter names and social security numbers have been stolen. You can read the complete news here For at least the past year, I have read information like this almost every week. I don’t understand why governments, or corporations employees are still carrying around files full of the public’s personal information. I also don’t understand, why their hard drives are not encrypted. Encryption software is cheap, and very easy to use. It would solve the problem of the lost or stolen laptops. Losing people personal information by negligence should be considered a criminal offense. — |
| Posted on Dec 30, 2007 by: Fred Cirera @ 09:21 |
Comments: 9
|
Customize your Mail.app Headers
|
It is possible to add custom headers to mails your are sending with Mail.app. You need to open and type the following commands. This is very useful to add headers with your mail priority, a default reply-to field or with your GnuPG or identity.
|
| Posted on Dec 27, 2007 by: Fred Cirera @ 15:50 |
Comments: 34
|
Blocking spammers
|
Few years back I have written a service call KasMail which provide free temporary email addresses. This service is mainly used by people who need to leave an email address suspicious sites who collect email addresses for spamming. To limit the span on this service I use several reputation blacklist. The most efficient, with very small amount of false positive and very reactive is called CBL.
|
| Posted on Dec 24, 2007 by: Fred Cirera @ 19:33 |
Comments: 26
|
Growable disk image
|
One of the features I like on my MacOS is the Support for SPARSE devices. Specifying -type SPARSE creates a disk image which expands as it is filled with data.
$ hdiutil create -volname FredBackup -size 10g -type SPARSE -fs HFS+ FredBackup created: /Volumes/fred/FredBackup.sparseimage $ ls -lh FredBackup.sparseimage total 36872 -rwxrw-r-- 1 fred fred 18M Dec 22 2007 FredBackup.sparseimage Even though I created disk image with a size of 10GB, the real size of the disk image is only of 18MB. The size will grow as I fill the disk image. If you want this image to be encrypted you can use hdiutil convert with the following options. $ hdiutil convert -encryption -format UDSP FredBackup.sparseimage -o FredBackupSecure.sparseimage Enter a new password to secure "FredBackupSecure.sparseimage": Re-enter new password: Reading Driver Descriptor Map (DDM : 0)… Reading Apple (Apple_partition_map : 1)… Reading disk image (Apple_HFS : 2)… ............................................................................... Elapsed Time: 9.107s Speed: 1.8Mbytes/sec Savings: 99.8% created: /Volumes/fred/FredBackupSecure.sparseimage $ $ ls -lh total 73984 -rwxrw-r-- 1 fred fred 18M Dec 23 2007 FredBackup.sparseimage -rwxrw-r-- 1 fred fred 18M Dec 23 2007 FredBackupSecure.sparseimage With the last command a new volume has been created with the same characteristics of FredBackup.sparseimage but encrypted. You can get rid of the previews non encrypted disk image. Carefully store the password in a safe place or use the KeyChain to save this password because there is no way to decrypt the content of your new disk image without it. Your disk image is read. To be used you just have to mount/attach it. You can either use the graphical interface and double click on the FredBackupSecure.sparseimage icon, or use the command line interface hdiutil attach to mount your new volume. The Volume will be mounted on /Volumes/FredBackup which is the nane we gave during its creation with the option -volname FredBsckup. Once you are done using your disk image you detach/unmount/eject the volume by using the command detach from hdiutil. $ hdiutil attach FredBackupSecure.sparseimage Enter password to access "FredBackupSecure.sparseimage": /dev/disk3 Apple_partition_scheme /dev/disk3s1 Apple_partition_map /dev/disk3s2 Apple_HFS /Volumes/FredBackup $ $ cp -rp /Users/fred/Movies /Volumes/FredBackup $ $ hdiutil detach /Volumes/FredBackup "disk3" unmounted. "disk3" ejected. $ $ ls -lh total 112888 -rwxrw-r-- 1 fred fred 55M Dec 23 2007 FredBackupSecure.sparseimage As you can see in the preview exemple. After we copied some data to the volume its size has dynamically grown. If you free space in that volume you can use the command hdiutil compact to decrease the size of the disk image. As shown in the following example the disk image goes from 55MB to 39MB after we deleted the file dv2003.mov $ hdiutil attach FredBackupSecure.sparseimage Enter password to access "FredBackupSecure.sparseimage": /dev/disk4 Apple_partition_scheme /dev/disk4s1 Apple_partition_map /dev/disk4s2 Apple_HFS /Volumes/FredBackup $ $ rm /Volumes/FredBackup/Movies/dv2003.mov $ $ hdiutil detach /Volumes/FredBackup/ "disk4" unmounted. "disk4" ejected. $ hdiutil compact FredBackupSecure.sparseimage Enter password to access "FredBackupSecure.sparseimage": Starting to compact… Reclaiming free space… .............................................................................. Finishing compaction… ............................................................................... Reclaimed 16 MB out of 10.0 GB possible. $ ls -lh -rwxrw-r-- 1 fred fred 39M Dec 25 2007 FredBackupSecure.sparseimage $ |
| Posted on Dec 24, 2007 by: Fred Cirera @ 17:37 |
Comments: 15
|
Email obfuscation
|
Email harvester traverse the Web looking for email signatures in web pages. In the sole purpose of building large databases of email addresses to send spam.
That's why it is always a good idea to not publish your email address on a web page, but sometime you absolutely need to be contacted and you need to post your email address. On web pages you have no control, such as forums, blogs or commercial websites, you can use a service like KasMail [kasmail.com] to create a temporary email address. When you need to enter your email somewhere you use that temporary email address. This email address is only valid a short period of time (from few days to several month) and then it is automatically deleted by KasMail. Email harvesters will send the spam to an expired email address. Sometimes though, you need to publish your personal email address. What you can do is to obfuscate your address so the harvesters will miss it. Here is the recipe I often use myself. If you have a Mac, UNIX, or Linux type the following line in a terminal window, to encrypt your email address. If you have Windows installed on your computer, install a real OS. $ echo 'booba@gump.com' | openssl base64 Ym9vYmFAZ3VtcC5jb20K The string "Ym9vYmFAZ3VtcC5jb20K" is your email address encoded in base 64. Enter the following line in your web pages at the place you want to enter your email address. <script type="text/javascript"> document.write(atob('Ym9vYmFAZ3VtcC5jb20K')); </script> Voila! An email harvester will see a group of meaningless characters, and a real web browser will display your email address. |
| Posted on Dec 19, 2007 by: Fred Cirera @ 12:05 |
Comments: 21
|
Comments: 11
