Quickly, and efficiently, mass rename files in bash

By Ali Karbassi | June 18th, 2008 | How To, Linux, OS X, Ubuntu | 1 comment

Quick tip for everyone who is using Mac OS X, Unix, or anything with bash. If you want to mass rename a bunch of files, there isn’t a simple way of doing it. Either you would have to do it manually1 or you could use this simple line of code.

ls ryan.* | awk '{print("mv "$1" "$1)}' | sed 's/ryan/steve/2' | /bin/sh

Let me explain it quickly. Let’s say you have a whole folder of files named ryan.*2 and you want to rename them to steve.*.

The first part displays a list of files that match the wildcard of ryan.* then it is piped to the second part ( awk '{print("mv "$1" "$1)}' ). This part prints a list of commands such as mv ryan.txt ryan.txt.

Well, that’s close but you want to move ryan.txt to steve.txt, not itself. This is where the third part comes in. What sed does in this situation is replace any instance of ryan with steve. The last part runs the whole thing as a list of shell commands.

  1. mv ryan.txt steve.txt []
  2. Such as ryan.txt, ryan.gif, ryan.php, ryan.asp, etc []

CSS Font List

By Ali Karbassi | May 27th, 2008 | Design |

While designing a simple website for a friend, I noticed that I knew nothing about the different font families I could use. While I have tons of fonts on my computer, I can’t use those on the web1.

I did a quick Google search and found a small list and here it is for you.


‘American Typewriter’, ‘Courier New’, Courier, Monaco, mono
‘Arial Rounded MT Bold’, Helvetica, Arial, sans-serif
Baskerville, Georgia, Garamond, ‘Times New Roman’, Times, serif
‘Book Antiqua’, Georgia, Garamond, ‘Times New Roman’, Times, serif
‘Bookman Old Style’, Georgia, Garamond, ‘Times New Roman’, Times, serif
‘Brush Script MT’, ‘Comic Sans’, sans-serif
Chalkboard, ‘Comic Sans’, sans-serif
Didot, Georgia, Garamond, ‘Times New Roman’, Times, serif
Futura, Impact, Helvetica, Arial, sans-serif
‘Gill Sans’, ‘Lucida Grande’, ‘Lucida Sans Unicode’, Verdana, Helvetica, Arial, sans-serif
‘Helvetica Neue’, Helvetica, Arial, sans-serif
‘Hoefler Text’, Garamond, Georgia, ‘Times New Roman’, Times, serif
‘Lucida Grande’, ‘Lucida Sans Unicode’, Lucida, Verdana, Helvetica, Arial, sans-serif
‘Marker Felt’, ‘Comic Sans’ sans-serif
Myriad, Helvetica, Arial, sans-serif
Optima, ‘Lucida Grande’, ‘Lucida Sans Unicode’, Verdana, Helvetica, Arial, sans-serif
Palatino, ‘Book Antiqua’, Georgia, Garamond, ‘Times New Roman’, Times, serif
Cochin, Georgia, Garamond, ‘Times New Roman’, Times, serif
‘Goudy Old Style’, garamond, ‘book antiqua’, ‘Times New Roman’, Times, serif sequence


  1. Well, without creating images. []

Safari 3.1.1 and Saft 10.0.7

By Ali Karbassi | April 16th, 2008 | How To, OS X |

Saft needs to be updated to handle Safari 3.1.1

I have always used Webkit ever since switching to Safari as my general browser. Being that I’m always getting the newest build, I know what’s coming when Safari decides to upgrade.

Since Apple updated Safari from 3.1 to 3.1.1, Saft, a wonderful “addon/plugin/what-have-you”, breaks. I know Hao Li at haoli.dnsalias.com will be updating it pretty soon, but I have found a quick fix until that is done.

  1. Quit Safari.
  2. Navigate to Applications/Saft.app
  3. Control click to show package contents.
  4. Open bundle and go to Contents, then Resources, Saft.bundle, and Contents. You’re full path should be Applications/Saft.app/Contents/Resources/Saft.bundle/Contents
  5. Double click or open Info.plist in your favorite text editor.
  6. Change SaftSupportedSafariBuild to 5525.18. This is to match the current Safari version/build.

    It will then look like this:

    <key>SaftSupportedSafariBuild</key>
    <array>
    	<string>5525.18</string>
    </array>
    		

  7. Save and relaunch Safari.

How to run Adium (AIM, Yahoo, MSN, ICQ, and GTalk)

By Ali Karbassi | April 12th, 2008 | OS X | 1 comment

Being that not all locations allow all ports to be accessed through their gateway to the internet, sometimes you will run into problems in connecting to your IM programs such as iChat or, even better, Adium.1

Now, we know that all internet access points (WiFi spots, hotels, etc) will allow Port 80.2

So, we’re going to switch our Adium to connect through 80 and 4433.

Adium AIM

Let’s start with the most common messenger, AIM. Set the port to 443 and the server should be the default for your application. At the time of this it is login.oscar.aol.com.

Adium YIM

For Yahoo, set the port to 80 and login server to scs.msg.yahoo.com.

Adium MSN

For MSN, set the port to 80 and the login server to messenger.hotmail.com. Also check the “Connect via HTTP” box. This allows access through port 80.

Adium GTalk

For Google Talk, or I’d imagine any Jabber network, set the Transport Layer Security. Also be sure to check “Force old-style SSL and “Require SSL/TLS. If you check “Do strict certificate checks”, you will get a message box every time you try to load up Adium to accept a certificate. I have left this on, but I do know for a fact if you uncheck this, that message will not bother you again.

Adium ICQ

Lastly, if you are still using ICQ4, you can set your port to 443 and login server to login.oscar.aol.com. I wouldn’t suggest using ICQ anymore because it’s a pretty bad service. Check out the criticisms on wikipedia.

Now, if you restart your Adium (or whatever client you are using), you should have connection to the IM protocols.

Draw backs

Some of the drawbacks to this method is that your data is being sent over an unsecure port, and therefore can be subject to any sniffers. If you are paranoid about your chats, I’d suggest using an online version such as Meebo which does go through HTTPS.

  1. The following steps should work for Pidgin. I hate Trillian because it’s a memory hog. Just my thoughts. []
  2. This is because it is the port most web servers output websites. You can see what other ports are used for on Wikipedia’s List of TCP and UDP port numbers page. []
  3. Secure HTTP, or HTTPS as most refer to it as []
  4. Did you know it is an initialism on the phrase “I seek you” and is now owned by AOL? []

Safari 3.1 and Pith Helmet

By Ali Karbassi | March 19th, 2008 | General, How To, OS X | 5 comments

Recently Apple updated their browser Safari to version 3.1. It does boast new features that us web developers love, but it also crashes some hacks we also love. Note that I’m not calling them “plug-ins”. Read the reasoning behind this.

Now, one of my favorite Safari hacks has been Pith Helmet and with the new update, it is considered “broken.” Here’s how to fix it:

Safari Version 3.1 (5525.13)

  1. Quit Safari.
  2. Navigate to /Library/Application Support/SIMBL/Plugins/PithHelmet.bundle.
  3. Control click to show package contents.
  4. Open bundle and go to Contents.
  5. Double click or open info.plist in your favorite text editor.
  6. Change MaxBundleVersion to 5525.13. This is to match the current Safari version/build.

    It will then look like this:

    <key>MaxBundleVersion</key>
    <string>5525.13</string>
    		

  7. Save and relaunch Safari.

Continue reading

Facebook News Feed Filter

By Ali Karbassi | March 13th, 2008 | General |

While stumbling around on Facebook, it seems like they accidently released (or to me for a second) a new front page. The front page we usually see is the News Feed. The new page is the same News Feed, but filtered.

I took the liberty to take some pictures.

Facebook's New News Feed Filter?

Facebook's New Newsfeed Filter

Facebook's new Filter?

What do you think?