Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like
Linux
Finding files and strings using the terminal in Linux
Feb 4th
My favorite thing about Linux is the terminal. I use it countless times a day to do all sorts of tasks, like managing game servers or writing scripts to do tedious tasks. One of the most popular things I do in the terminal is search for files or strings inside of files and today I’d like to go over a few methods and tricks for doing this. There are three tools that make this task amazingly easy but combining them is where we find the real power. These three tools are locate, find and grep. I will cover the basic use of these tools with some examples and tricks but I suggest you take a look at the man pages for the tools for addition information (i.e. man locate).
locate
Locate has got to be the most straight forward way to search for files. It uses a database so it’s blazing fast when searching your entire computer, compared to the ‘find’ we’ll cover later. It’s not available by default on all Linux distributions (it is on Ubuntu) so you might have to install it. Since I’ll be mentioning fstab later, I’ll give my examples with it.
Basic syntax is: locate [filename]
tyler@quadjutsu:~$ locate fstab /etc/fstab /etc/fstab.orig /etc/fstab.pre-ntfs-config /etc/fstab~ /usr/include/fstab.h /usr/lib/udev/migrate-fstab-to-uuid.sh /usr/share/apps/katepart/syntax/fstab.xml /usr/share/doc/m4/examples/fstab.m4 /usr/share/doc/mount/examples/fstab /usr/share/doc/util-linux/examples/fstab.example2 /usr/share/man/man5/fstab.5.gz /usr/share/pysdm/fstab.py /usr/share/pysdm/fstab.pyc
This database will automatically update itself at various times but to force an update type the following command:
tyler@quadjutsu:~$ sudo updatedb
Folder exclusions can be found (and edited) in /etc/updatedb.conf
By default (at least in ubuntu) /media (your mounted media) is not included in this database. This means if you use extra drives you’ve added to your computer and you want them to be searchable through the locate tool, you’ll have to mount them to a directory like /mnt.
To mount a drive on boot, you’ll need to add a line like the following to your /etc/fstab. The one below mounts an ntfs drive to /mnt/mydrive. That folder must exist for the drive to be mounted.
/dev/sda1 /mnt/mydrive ntfs-3g defaults,locale=en_US.utf8 0 0
I found the /dev/sda1 part by listing my harddrive partitions using the following command:
sudo fdisk -l
find
Find is a little more cryptic than locate but it’s a very powerful tool that should be available on most Linux distributions if not all.
Basic syntax is: find [directory] -name “[string]” -print
Find will search recursively through the folder you’re calling it from. The directory isn’t required but it will show you the full path. A neat trick is to use $(pwd) which creates a string for the “present working directory”. It’s also a good habit to use quotes around your name search because you can’t do regular expressions without it. find does not do matching the same way locate does. You’ll have to specific a wild card (*) for partial searches.
tyler@quadjutsu:~/Desktop$ find -name "notes" -print tyler@quadjutsu:~/Desktop$ find -name "notes*" -print ./notes.txt~ ./notes.txt tyler@quadjutsu:~/Desktop$ find $(pwd) -name "notes*" -print /home/tyler/Desktop/notes.txt~ /home/tyler/Desktop/notes.txt tyler@quadjutsu:~/Desktop$ find -name "no[a-z]*" -print ./notes.txt~ ./notes.txt
My Buddy From Belgium, MrBougo has asked I make note that -iname makes it case insensitive.
grep
In the context of searching, grep is like a pocket knife. It’s great for limiting returned results and searching through files, which are my two most common uses of it, though I’m sure there are a million others. First I’ll cover the searching files for strings portion and in combined tools we’ll discuss how to refine search results.
In terms of searching strings in files, basic syntax is: grep “[string]” [filename]
grep is case sensitive but can be changed to insensitive with -i. You can access extended regular expressions (which allow for such functions as use of the + sign to signify 1 or more characters) by calling “egrep”
tyler@quadjutsu:~$ grep "tyler" resume.txt tyler@detrition.net tyler@quadjutsu:~$ grep "Tyler" resume.txt Tyler J. Mulligan tyler@quadjutsu:~$ grep -i "tyler" resume.txt Tyler J. Mulligan tyler@detrition.net tyler@quadjutsu:~$ grep -i "tyl" resume.txt Tyler J. Mulligan tyler@detrition.net tyler@quadjutsu:~$ egrep -i "tyler [a-z.]+" resume.txt Tyler J. Mulligan tyler@quadjutsu:~$ egrep "tyler [a-z.]+" resume.txt
MrBougo also mentioned that, grep returns a 1 exit status if it doesnt find, so grep “foo” && grep “bar” will only grep for bar when foo is found.
Combining the tools
There are two very important techniques for linking together commands in the terminal. The pipe | and &&. The pipe passes the output of one command to the next, the && runs a command after the one before is complete.
Starting off slow, we’ll refine our search of grep with another grep. Note that you don’t have to use the quotes as I’ve shown below.
tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt * Web Developer and Interaction Designer for Nexuiz / Alientrap * Owner and Creator of Nexuiz Ninjaz tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt |grep -i ninjaz * Owner and Creator of Nexuiz Ninjaz
Not that you would really want to do the follow commands but to emphasize how | and && work, the following example shows how you’re running the command twice rather than refining a search:
tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt && grep -i "ninjaz" resume.txt * Web Developer and Interaction Designer for Nexuiz / Alientrap * Owner and Creator of Nexuiz Ninjaz * Owner and Creator of Nexuiz Ninjaz
Recalling our first example with fstab, there was a lot of extra results we didn’t want. We know know it was in the etc folder, so we can filter our results by that.
tyler@quadjutsu:~$ locate fstab |grep etc /etc/fstab /etc/fstab.orig /etc/fstab.pre-ntfs-config /etc/fstab~
Another way would be to EXCLUDE folders we don’t want with the -v flag.
tyler@quadjutsu:~$ locate fstab |grep -v usr /etc/fstab /etc/fstab.orig /etc/fstab.pre-ntfs-config /etc/fstab~
And filtering out the junk like so:
tyler@quadjutsu:~$ locate fstab |grep etc |grep -v "~" |grep -v "\." /etc/fstab
~ has a special meaning in the terminal so you must quote it to match it. ~ refers to the user’s home directory, in this case /home/tyler. I’ve also had to escape . because it too has special meaning, in the context of regular expressions, it will match any character… if we’re excluding any character, we’re excluding our results
.
Quick Tricks
Remember commands is sometimes a hard thing to do, especially when it’s a whole string of complicated commands and regexes. Sometimes, I know I don’t have the mind to take notes but that’s okay (for a grace period) because bash keeps track for me. The history command will list all your recently executed commands and utilizing the grep command, we can filter that list.
tyler@quadjutsu:~$ history |grep locate 613 locate fstab 614 locate fstab |grep etc 624 locate fstab |grep etc |grep -v "~" |grep -v "\."
A quick way to search for files in a directory would be to use locate as the path and grep the results
tyler@quadjutsu:~$ locate ~ |grep notes.txt /home/tyler/Desktop/notes.txt
These are the basics of finding files and searching through them. Linux provides many tools to reformat and replace strings. There are a million different ways to combine commands and always a faster way to do it. Keep playing and you’ll just get better and better.
Ubuntu Window Management with Multiple Monitors, Window Effects and Default File Associations
Nov 25th
Multiple Monitors Window Management in Ubuntu
Moving your applications from one monitor to the next with hotkeys
I’ve been using multiple monitors for a while now, Starting with a 17″ CRT with a 19″ CRT and moving up to two 19″ LCD, then 3, then temporarily one wide screen and back to 2. Something I always loved having as a utility in ultramon that I couldn’t find in Ubuntu (Gnome) or any window manager for that matter, was the ability to move applications from monitor to monitor. I had assumed the search futile until I was searching about some questions I had concerning Compiz-fusion with dual monitors and I came about this thread on Ubuntu forums which brightened up my day. A fellow named gfixler posted a bash script that utilizes command line applications to move the windows.
For you multi-monitor users seeking salvation from removing your hand from the keyboard to move your application from one monitor to another, here’s the skinny on getting it setup using compiz-fusion, aka Advanced Desktop Effects, to set my keybinds.
1. Open a terminal and setup your prerequisites with apt-get:
sudo apt-get install wmctrl xprop xwininfo
If you get errors about x11-utils, just ignore them, this package will handle your needs.
2. Next, lets put the script somewhere you can call it, say “~/scripts”
mkdir ~/scripts && cd ~/scripts && touch movewin.sh && chmod +x movewin.sh && gedit movewin.sh
2. Paste the following code, find the first function “getNumberOfMonitors” and configure it to the number of monitors you have (default 2).
#!/bin/bash # swap_monitor.sh (original version) # Moves the active window to the other screen of a dual-screen Xinerama setup. # # movewin.sh (modified version) # allows movement of windows left and right between multiple monitors # # Requires: wmctrl, xprop, xwininfo # # Original Author: Raphael Wimmer # raphman@gmx.de # # Modified by: Gary Fixler # gfixler+bash@gmail.com function getNumberOfMonitors { # simply must be hardcoded # e.g. MatroxTripleHead2Go can service 3 screens, # but appears as only one monitor to the computer # change to your number of monitors echo 2 } function getMonitorWidth { numberOfMonitors=$(getNumberOfMonitors) monitorLine=$(xwininfo -root | grep "Width") monitorWidth=$((${monitorLine:8}/$numberOfMonitors )) echo $monitorWidth } function getActiveWindowID { activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)") activeWinID="${activeWinLine:40}" echo $activeWinID } function getActiveWindowHorizontalPosition { activeWinID=$(getActiveWindowID) xPosLine=$(xwininfo -id $activeWinID | grep "Absolute upper-left X") xPos=${xPosLine:25} echo $xPos } function getActiveWindowWidth { activeWinID=$(getActiveWindowID) xWidthLine=$(xwininfo -id $activeWinID | grep "Width") xWidth=${xWidthLine:8} echo $xWidth } function getActiveWindowCurrentMonitor { numberOfMonitors=$(getNumberOfMonitors) monitorWidth=$(getMonitorWidth) activeWinID=$(getActiveWindowID) xPos=$(getActiveWindowHorizontalPosition) i="0" while [ $xPos -gt $monitorWidth ] do xPos=$[$xPos-$monitorWidth] i=$[$i+1] done echo $i } function getActiveWindowPositionOneMonitorToTheLeft { monitorWidth=$(getMonitorWidth) currentMonitor=$(getActiveWindowCurrentMonitor) activeWinID=$(getActiveWindowID) xPos=$(getActiveWindowHorizontalPosition) xPos=$[$xPos-$monitorWidth] echo $xPos } function getActiveWindowPositionOneMonitorToTheRight { monitorWidth=$(getMonitorWidth) numberOfMonitors=$(getNumberOfMonitors) currentMonitor=$(getActiveWindowCurrentMonitor) activeWinID=$(getActiveWindowID) xPos=$(getActiveWindowHorizontalPosition) xPos=$[$xPos+$monitorWidth] echo $xPos } function changeActiveWindowMonitor { activeWinID=$(getActiveWindowID) if [ $1 -eq "0" ] then newXPos=$(getActiveWindowPositionOneMonitorToTheLeft) newXPos=$[$newXPos-5] else newXPos=$(getActiveWindowPositionOneMonitorToTheRight) newXPos=$[$newXPos-5] fi winState=$(xprop -id ${activeWinID} | grep "_NET_WM_STATE(ATOM)" ) if [[ `echo ${winState} | grep "_NET_WM_STATE_MAXIMIZED_HORZ"` != "" ]] then maxH=1 wmctrl -i -r ${activeWinID} -b remove,maximized_horz fi if [[ `echo ${winState} | grep "_NET_WM_STATE_MAXIMIZED_VERT"` != "" ]] then maxV=1 wmctrl -i -r ${activeWinID} -b remove,maximized_vert fi if [[ `echo ${winState} | grep "_NET_WM_STATE_FULLSCREEN"` != "" ]] then fulls=1 wmctrl -i -r ${activeWinID} -b remove,fullscreen fi # move window (finally) wmctrl -i -r ${activeWinID} -e 0,${newXPos},-1,-1,-1 # restore maximization ((${maxV})) && wmctrl -i -r ${activeWinID} -b add,maximized_vert ((${maxH})) && wmctrl -i -r ${activeWinID} -b add,maximized_horz ((${fulls})) && wmctrl -i -r ${activeWinID} -b add,fullscreen # raise window (seems to be necessary sometimes) wmctrl -i -a ${activeWinID} } function moveActiveWindowOneMonitorToTheLeft { changeActiveWindowMonitor 0 } function moveActiveWindowOneMonitorToTheRight { changeActiveWindowMonitor 1 } "$1" exit 0
3. Setup your hot keys with compiz-fusion. Go to System >> Preferences >> Advanced Desktop Effects. Inside “General Options“, click on the command tab (I apologize for my heinous blue links).
Use
scripts/./movewin.sh moveActiveWindowOneMonitorToTheRight
and
scripts/./movewin.sh moveActiveWindowOneMonitorToTheLeft
respectively
Per Application Window Effects in Ubuntu
Bring character and tickle your soul with per application window effects
Another cool feature Compiz-fusion has is window animations. My friend James Lindsay recently reminded me about Window Effects… which when I first install Ubuntu on my laptop, I experimented my butt off… but being a laptop… I just used simple ones I’d turn off half the time anyway. He asked me why I don’t use them on my desktop and I didn’t have a good reason. Well, now I have 2 good reasons to keep using compiz.
I made my Thunderbird use the airplane effect so when I send emails, it flys away and for Geany, I used the magic lamp for open, close, maximize and minimize (different speeds). It’s a fun little effect that breaks up the stiffness of the desktop.
Default File Associations in Ubuntu
geany > gedit
I was tired of gedit popping up when geany’s just as lightweight but more affective. So found a command and altered it a bit to make my default editor geany.
1. Open the terminal and create\open the following file:
gedit ~/.local/share/applications/defaults.list
If it’s blank, add “[Default Applications]“. If it’s not, find “[Default Applications]“.
2. Then, back to the terminal, grep the default files associations and replace gedit with your editor of choice
grep gedit /usr/share/applications/defaults.list | sed s/gedit/geany/g
Copy (ctrl+shift+c) and paste the output into gedit, below the “[Default Applications]” header.
3. Restart nautilus to load the changes (will close all your file managers that are open and blink/freeze your desktop for a second)
pkill nautilus
Good luck, have fun and happy coding
Bash script to convert pngs to jpgs, thumbnail them and generate forum code
Aug 11th
I’ve been working on a tutorial for Nexuiz Ninjaz that requires a lot of screen shots. I’ve been utilizing the command line tool scrot to take screenshots on specific windows. These images however, are large pngs because the scrot date pattern wasn’t working properly when I tried to generate jpgs while repeating the same command. I went forward knowing I could find a way to batch compress these pngs later. Figuring I might as well “add a turbo while I’m under the hood”, I opted to both thumbnail the images (duh) and generate the forum thumbnail code (VROOOM).
So, to convert pngs to jpgs, I created a bash script which uses mogrify to convert, compress and thumbnail them and sed to assist in generating the forum code.
#!/bin/bash # # Convert pngs to jpgs, thumbnail them and generate forum code # Created by Tyler Mulligan - www.doknowevil.net condir=converted if [ ! -d $condir ];then mkdir -p $condir;fi pagename="http://www.nexuizninjaz.com/pics/howtos/map_link_a_ninja/" # Convert to jpg and create thumbnails echo -e "backing up originals...\n" cp *.png originals echo -e "converting to jpg...\n" mogrify -format jpg *.png echo -e "copying to converted directory...\n" cp *.jpg $condir echo -e "creating thumbnails...\n" mogrify -resize 50% *.jpg for file in *.jpg ; do mv $file `echo $file | sed 's/\(.*\.\)jpg/thumb_\1jpg/'` ; done mv *.jpg $condir echo -e "cleaning up\n" rm *.png # Generate forum code for file in $condir/thumb_*.jpg ; do tempname=`echo $file | sed 's/thumb_\(.*\)/\1/'`; echo "[url=${pagename}${tempname}][img]thumb_${tempname}[/img][/url]" done
Future plans call for adding flags to support different image types, and including the ability to take screen shots and generate the forum code on a per screen shot basis.
Sorta Off Topic: I’ve taken a swing at frameworks be developing a new layer of organization on top of cfg files in nexuiz. I’ve thoroughly documented this scalable, fully customizable package I’ve dubbed the Ninja Pack for Nexuiz
Geany, the Almost Notepad++, Improved gedit with a Few Extras That Make You Smile
Jul 21st
I was browsing around linuxappfinder.com today and came across Geany, which I’ve already gotten quite comfortable with.
Some features I found that make it similar to notepad++
- The hotkeys are very similar if not identical to notepad++ (gedit has different ones)
- It supports regex find/replace
- It supports ‘find in files’ – by using grep
- It’s a lightweight and efficient IDE
Some features Geany has that notepad++ doesn’t
- Status window with a history
- Scribble pad
- Built in terminal
- Color picker
- Support for projects
- Tight integration with my window manager
- The functions menu is expanded to contain all sorts of clever information that I can fold in a non buggy tree
Some features notepad++ has that geany doesn’t
- TextFX (neat macros that help you with string related pattern updates)
- GUI for changing theme colors
- Tabbed find/replace and find in all (nit pick)
Why I’m quickly choosing Geany over Notepad++
With tight integration with gnome (as opposed to notepad++ which I have to run through wine) and a package of dark themes which I was able to find quickly through the Geany’s FAQ.
I haven’t tried it on Windows yet but I’d imagine it’d run pretty well.. though you are missing out on a lot of things you can take advantage of in linux. If you’re a windows user and would like to give it a whirl, this will help you.
Where I’ve been (June 2008 Edition)
Jun 13th
So it’s been another interesting stretch of not blogging. A quick recap involves school, work, play and Nexuiz (which is a cross between work and play). For school, I managed a project called Object Organizer which you can learn more about in the wiki. I learned a lot about code, projects and people during this experience. I hope to share some techniques, such as the jQuery AJAX login I’ve developed with you all soon.
I’ve been really busy with my Senior Project / Nexuiz Community, Nexuiz Ninjaz developing a web based statistics frontend for players to check their stats. It will be similar to an already existing statistics script but we plan on doing a few things different. As the project grows, I will post information I find interesting about the project(s).
My main computer died and my thinkpad was going haywire so I was able to get another computer from a friend in exchange for work and I did a fresh OS install on my thinkpad. Both computers use Ubuntu Hardy Heron 8.04, the desktop dual boots into XP 64bit. I’ve stayed booted into Ubuntu most the time. And I’ve done many neat things with syncing my laptop and desktop. Utilizing programs such as Synergy and Unison.
Ubuntu has improved drastically since I’ve lasted tried it. There are a few annoying bugs… like the fact that xinerama is buggy with games causing me to create a single monitor xorg.conf I run in a different tty just for games but the time I’m spending configuring, is time I was wasting on windows before. As crappy as having my desktop die was, due to good planning I was able to recovery everything I need and this event has gotten me back into Linux.
I hope to have something more for you next post but if you can’t wait, start reading some of my other sites
.
Daily database backups on dreamhost
Dec 13th
To do daily database backups, I use cron jobs. If you aren’t familiar with cron jobs, think of the as scripts that run on a timer. Much like ‘scheduled tasks’ on windows. To edit your cron jobs on dreamhost, locate the ‘cron jobs‘ menu item located under ‘goodies‘ on the main menu:

Before we add a cron job though, I want to familiarize you with the script and have you run a test to save you a headache later.
#! /bin/sh # Daily backups on your database with email notification # Tyler Mulligan # file dateVar=$(date +%m-%d) # Date variable to append to filename (default: month-day | 11-24) savePath="/home/tyler/backups/" # Backups are stored here fileName="my_db_backup" # File name minus the date # email subject="My Database Backup ${dateVar}" email="db_robot@mydomain.com" # database username="root" # username password="" # password hostname="localhost" # hostname database="database" # database mysqldump -u $username -p$password -h $hostname $database | gzip > $savePath$fileName-$dateVar.sql.gz uuencode $savePath$fileName-$dateVar.sql.gz $fileName-$dateVar.sql.gz | mail -s "$subject" $email
I’ve set it up so you fill out your information like any other config file, the last two lines do all the work.
I suggest you create a new text file called ‘dbbackup.txt’, and paste the above code in and saving it for future reference. It’s always good to have a clean slate to start from. Once you have that done, fill in your file, email and database variables and give it a test run.
Create a shell script through ssh and run that.
Copy your personalized database dump code, log into your server and type:
vi my_db_test.sh [press i] right click (to paste the copied code) [press esc][type ":wq"] [press enter]
Your script is now written to a file called ‘my_db_test.sh’.
chmod +x the file and run it:
chmod +x my_db_test.sh ./my_db_test.sh
Once you receive the email, check your backup directory and verify that the database was properly dumped. If you don’t receive and email, you did something wrong.
If everything worked fine, return to the dreamhost cron job page, add a cron job and paste your working code into your newly created cron job.
Save, wait a day and you should receive your email. It’s a wise idea to grab a copy of your backup every week or so to store locally.
Dreamhost is actually offering a special for their 10th anniversary right now, 500gb disk space, 5TB transfer for only $5.95 a month. I’ve been with them 2 years and I’ve been pleased.
Organizing Your Email on the Fly
Dec 8th
Email can be a hassle but it doesn’t have to be if you lay out the ground work properly. Folders are a great solution but they only bring you so far. I know I don’t want to manually sort all my email. If you’re like me, you’ll love thunderbird’s filters and tags. Filters allow you to sort, delete, tag and so much more automagically.
To get started, click tools > message filters…

And you are brought to a dialog similar to this (mine obviously has a few filters):

Click ‘new…’ to get started.
In this dialog, conditions are defined at the top and actions are defined below. In the example above, you’ll notice that my condition is based on the Subject of the email. When this condition is true, it will perform the actions below. Move to the BOA folder and tag the message as important.
A little note about this window that confuses people, those + and – buttons are to add and remove conditions/actions. You do not need to click + if you are just filling in the one field, thunderbird knows it’s there.
Also note, Thunderbird allows you to add your own tags with a nice array of colors to choose from (though I would prefer hex).

To access this dialog, click the tag button on the tool bar and select ‘new…’
If you have any questions, feel free to leave a message. Happy sorting!
Bookmark Organization
Dec 6th
Bookmarks are something most of us don’t really keep up to par. Sometimes you just ctrl+d on a whim, losing that page in your lack of a hierarchy forever. Well, at least that’s how it’s been for me. However, once in a while I give myself a kick in the ass and try to shape up. Based upon the patterns I’ve learned in the past and the general direction I wish to go, I reevaluate my mess and decide the proper way forward. In this case it was the standard, “Make general categories and add sub-folders if they need more organization” route… with a little extra spice.
This time around, I decided to utilize folders in the bookmarks toolbar. Maybe I’m blind to this but I feel like most people don’t utilize this helpful feature, I know I didn’t until now. After spending a few days using folders on my toolbar, I’ve come to the conclusion that it is both effective and efficient.
I spend a lot of time developing locally and often do rounds on my live sites and rather than waste 4 seconds typing in a 32 character URL, I’d rather waste 0.4 making two clicks. Yes, that’s right, I’m shaving off seconds to increase my efficiency. It might not seem like a lot but it adds up to minutes a day and hours a year.
Now, because I’m going to be spending a lot of time on my laptop, I needed a global solution to my bookmarks. The path I chose to get is syncing them with the Firefox extension, Bookmark Sync and Sort. If you don’t have your own server, there are some hosted alternatives such as Foxmarks Bookmark Synchronizer. Those trendy bookmark sites aren’t really the solution for me for a few reasons.
1) I like to control my data.
2) Those sites are usually distracting to me
3) While the Firefox bookmarks manager isn’t the ideal solution, the GUI is far more advanced than something you’ll find on a social bookmarking site.
Admittedly, there is an advantage to these sites, and that’s the fact that I can get to my bookmarks quickly no matter what computer I’m on. But again, I can argue that I can find a link just as fast (if not faster) with SSH by greping the xml file Bookmark Sync and Sort generates.
Back on track, once you have the extension installed, click ‘Bookmarks’ > ‘Synchronize Bookmarks’ and fill in the dialog with your information as such:

What kind of man would I be if I didn’t take advantage of this moment to sort my bookmarks?

Mmm, alphabetical order.
Now I just need to upkeep as best I can… I’ll let you know when I come up with a better solution for that. Right now, I just force myself to take the time to find the correct folder in the hierarchy. It’s a good habit but a hard one to keep. If you have any advice, please share. Good luck and happy bookmarking.
P.S. I edited the file wp-admin/admin-functions.php, line 2126 to increase the generated thumbnail size in wordpress. Just replace ’128′ with the max you wish. Thought maybe some of you could use that information.
Organizing Your Precious Internet Memories
May 27th
Back when I first became a part of these internets, I’d get a lol or two via a link to a picture or a website. With the exception of a few of these pictures (thanks digg) most of these pictures have become distant memories of my past. After a while it occurred to me, why aren’t I saving these pictures?
However obsessive, I made it my job, nay, my duty to summon the strength to save and sort ever picture that strikes the slightest bit of interest. This, as you could imagine was a tedious task. Right click, navigate to proper folder, rename image (if needed) and save. My commitment was strong but apparently no match for this mundane method. Slowly, I would stop navigating to sub-folders and just drop them all in a folder I like to call “Internet Garbage”. Currently in the root of this folder, there resides over 3,000 unsorted images.
DON’T WAIT TO SORT YOUR FILES! This is the best advice I can give to anyone. Sure it’s easy to save everything to your desktop but chances are, you’ll mix it up, lose it, delete or whatever. If you put in the extra 20 seconds navigating/creating a relevant folder, you’ll save yourself a boatload of suffering.
Getting back on track though… I came across a Firefox extension a while back called Save Image in Folder. This extension saves you so much time and trouble, that you’d actually be wasting resources by saving files the old fashion way.
Go Install that extension and come back for a tutorial if you too, would like to start saving some ‘Internet Garbage’.
After Installing the extension, right click an image (it can be any image, we’re just using this to set things up quickly). You can use this image if you’d like:

Select “Save Image in Folder… >> Edit folders…”

Select “New”, click the folder button next to the “Path” textbox and create a new folder called “Internet Garbage”. Create all your sub folders inside of that folder.
For this example, I used:
- Art
- Funny
- Gross
- Macro
- Nerdy
- Sexy
- Wallpaper
You can add more whenever you please.

Note: You can prefix or suffice the filenames however you’d like. It’s not a bad idea to prefix the files with a short date… but it’s all up to you.
Once you have all your folders created, it’s a good idea to sort them alphabetically by using the up and down arrows located on the side of the Options dialog.

Now it’s as simple as right clicking an image and picking a folder it’s most relevant to save to.



