The Road to Elysium

January 28, 2011

Recommended Google Chrome extensions

I’ve been a very avid user of Firefox these past years. But of late I’ve been getting the feeling of Firefox getting slower and slower. I haven’t tried the latest beta yet, but the fact that Firefox dies if one of your tabs are in trouble, just doesn’t cut it for me. So I decided to try out Google Chrome, and boy do I enjoy it. I’ll have to address the benefits of using Google Chrome some other time, but now, I present you with what I consider to be some of the better Google Chrome extensions out there. If you have anything to add, let me know. :)

  • AdBlock
    • The most popular Chrome extension, with over 1.5 million users! Blocks ads all over the web.
  • Alarm
    • This extension help you to remember yours appointments.
  • Clickable Links
    • Turns unclickable urls & email addresses into clickable ones.
  • FlashBlock
    • FlashBlock for Chrome. Block them all, or be selective with the embedded whitelist manager
  • Google Mail Checker
    • Displays the number of unread messages in your Google Mail inbox, or Google Apps. You can also click the button to open your inbox.
  • Tab Menu
    • Select, close, rearrange, and search your tabs from a toolbar menu!
  • Timer
    • Losing track of time on the web? This simple timer tells you when your time is up.
  • ToodleChrome
    • Manage your tasks and todo lists! Get quick access to Toodledo, with the option to show a badge indicating tasks due
  • Xmarks Bookmark Sync
    • Backup and sync your bookmarks, passwords and open tabs across computers and browsers. Xmarks is also available for Firefox, Safari and IE.

January 17, 2011

Vim: Commenting out multiple lines

Filed under: Snippets — jorge @ 11:31

There are two ways to do this without a vim plugin:

  1. Select your lines with VISUAL BLOCK (CTRL-V), then press I to insert before all highlighted lines. Next type your comment character (#, ;, depending on the language), then press ESC twice.
  2. Select your lines with VISUAL LINE (SHIFT-V) then type:
s/^/#

In other words, substitute the selected start of lines with the # character.

December 22, 2010

What a journey

Filed under: Day to day — jorge @ 06:17

The time is 05:53 in the morning, and I’ve been up at least two hours. I am SO tired! Our two lovely sons have kept me awake most of the night, our youngest having been awake the most. The 7th of January I should be back at work, and the reason for the lack of activity on this blog, amongst other things, has been because I’ve been on a paternity leave since November. It’s been a great, exhausting journey, but I wouldn’t have been without it. During this time I’ve really connected with my kids, especially our youngest, Noah. And I even got to see his first steps! That’s just amazing, and now he keeps on walking like there’s no tomorrow. As for Michael, wow, he has developed his language, is able to express himself better, and really seems to be growing into a young boy. He likes his toy cars, dad’s tools and like to draw everywhere. Including on his little brother. Some of the (now) funnier experiences with the boys have been:

  • Michael showering our room with cinnamon
  • Michael deciding to wash the floor of his room with milk
  • Michael getting up during the night, robbing the fridge for food, hiding under the covers of his bed eating
  • Michael drawing on walls, furniture and his little brother
  • Noah eating from our dog’s/cat’s food bowl

As you can see, Michael has done most of the things mentioned. I am less than keen to see if Noah ends up doing the same stuff as his brother. Did I mention that I’m tired?

Anyway, besides having spent time with my sons, I’ve really gotten into the role of being a father, and I’ve finally achieved something that was difficult for me – getting my driverslicense. We’ve remodeled our kitchen, and Marte and I are in a great place when it comes to our relationship. So things are going really really well. I have to admit though, I am a bit scared of starting to work again, I’m concerned that I’ve lost some of my skill. I had such plans before going on this paternity leave. I was going to study during the evenings, perhaps a bit during the day if I had time. Time, hah, never did I know what it took to take care of two kids. Needless to say I respect more mothers all over the world – taking care of children, wow, that’s something.

So, now you know. The blog has been pretty dormant, mainly because of the paternity leave, but I’m hoping that things will pick up once I start working again. But, that remains to be seen.

Ah well, so long for now.

October 20, 2010

Select browser from variable DISPLAY

Filed under: Snippets — Tags: , , , , , , , , , , — jorge @ 11:20

I have two monitors at work, which I like to use in a separate X-screen setup. Meaning that each monitor has an own X-server running on it. Thing is though, I like to use Firefox on Monitor 1, while I use Google Chrome on Monitor 2. So with this script, right-clicking a link in Monitor 1 will open it up in Firefox, while if I do so on Monitor 2, it will open it up in Google Chrome. Very nifty. Just go to System -> Preferences -> Preferred Applications (if you’re using GNOME like moi) and select this script instead of a regular browser.

#!/bin/bash
# A little script that selects a browser
# to show an URL on, based on the variable
# DISPLAY on a separate X-screen setup.
# In other words, the active monitor.
#
# Jorge Enrique Barrera <jorge@fbarr.net>
 
if [ "$DISPLAY" = ":0.0" ]; then
    /usr/bin/firefox $1
elif [ "$DISPLAY" = ":0.1" ]; then
    /usr/bin/google-chrome $1
fi

September 16, 2010

Rapidshare Linux Script Revisited

Filed under: Linux — Tags: , , , , , , , , , — jorge @ 12:53

Update: I just added a new variable in the script, DAYS, which specifies how many days the cookie you create is valid for.
Update 2011-09-13: Seems Rapidshare have been tampering with their API, which made the cookie-generating script useless. I basically changed the getaccountdetails_v1 with getaccountdetails, and the script is working fine now. I’ve fixed the script below to reflect this.

The code to get the Rapidshare-cookie in my previous post about this subject, Rapidshare Linux Script, unfortunately doesn’t work anymore. It seems that Rapidshare has moved from using https://ssl.rapidshare.com/premzone.html to https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi, so things just don’t work as they used to. This is for people with a premium account.

However, there’s a solution. First off, log in to your Rapidshare-account, go to Settings and make sure to check the box named Direct downloads, requested files are saved without redirection via RapidShare.

To grab the cookie you need, place the piece of code below in a file, save it, do a chmod +x on it. Just remember to replace MyUserName and MyPassword with your username and password before you run the script:

Note: The script requires curl to be installed.

#!/bin/bash
# Script to get your Rapidshare-cookie, nom nom
# Jorge Enrique Barrera
 
# Variables you can change
USERNAME="MyUserName" # Username to your Rapidshare premium-account
PASSWORD="MyPassword" # Password
COOKIEJAR="/home/jorge/.cookies" # Where the cookies are to be placed
DAYS="30" # The number of days the cookie is valid for
 
 
## Do not change anything below here ##
 
DATA="sub=getaccountdetails&withcookie=1&type=prem&login=$USERNAME&password=$PASSWORD"
COOKIE_STRING=$(curl -s --data "$DATA" "https://api.rapidshare.com/cgi-bin/rsapi.cgi" | grep cookie | cut -c 8-)
COOKIE=".rapidshare.com TRUE / FALSE $(($(date +%s)+24*60*60*$DAYS)) enc $COOKIE_STRING"
 
if [ ! -d $COOKIEJAR ]; then
        echo "Creating the directory $COOKIEJAR."
        mkdir $COOKIEJAR
        echo "Done."
fi
 
echo "$COOKIE" | tr ' ' '\t' > $COOKIEJAR/rapidshare

Now that the cookie is present, you can proceed by downloading the files you want. Which way you do that, is up to you.

Either way I will paste two scripts, one with wget and the other one with aria2, and you can then make your pick. Just place the URL of the files you want to download in /home/jorge/Downloads/.url, one in each line:

wget

#!/bin/bash
LIST="/home/jorge/Downloads/.url"
cd ~/Downloads
for url in `cat $LIST`
do
    wget -c --load-cookies /home/jorge/.cookies/rapidshare $url
done

Save this file as wrsd.sh and make it executable by doing a:

$ chmod +x wrsd.sh

aria2

#!/bin/bash
cd ~/Downloads
aria2c -j 5 -c --load-cookies=/home/jorge/.cookies/rapidshare -i /home/jorge/Downloads/.url

Enjoy. :)

« Newer PostsOlder Posts »

Powered by WordPress