»
S
I
D
E
B
A
R
«
Firefox Extensions /me can’t do without
Aug 5th, 2009 by sayanriju

Ok, so if you google around, you’ll find some 7,370,000 search results on ‘top  firefox extensions’. But this post is gonna be a bit different. Its not about the universally top Firefox Extensions (if such a thing even exists!), but about the ones which /me uses most! NO recommendations!
Here’s the list (in alphabetical order):

  1. DataFox : BSNL DataOne Broadband fuels my Internet. And it has a 500GB ul/dl limit per month. That’s why /me can’t do without the tiny statusbar applet this nice extension provides to keep a tab on monthly usage.
  2. Download Helper : The easy way to download YouTube videos to hard disk (when /me is not using youtube-dl script from the CLI i.e.!)
  3. Download Statusbar : “View and manage downloads from a tidy statusbar - without the download window getting in the way of your web browsing”. Yeh…works just as advertised, esp. that ‘getting in the way’ bit.
  4. DownThemAll : The only download manager /me ever uses, be it on or off the web browser. /me just loves its filtering options.
  5. FireFTP : /me’s favourite FTP client.
  6. Fire Gesture : The extensions /me uses all the time. Real handy, to the point of making /me kinda lazy!
  7. Flashblock : /me hates those silly flash ads eating into my monthly data usage limit, not to mention the elevated page loading times.
  8. Identifox / Twitterfox : Ever since /me discovered microblogging, these extensions are his constant companions!
  9. InFormEnter : /me is too lazy to type all those form information over and over again.
  10. Orkut Toolbar : /me spends lotsa time on Orkut, and this is the BEST orkut related extension for Firefox. Its great that it has recently been updated to spport Firefox 3.5
  11. UrlLink : Very useful for converting those non-hyperlinks into hyperlinks and open them in new/same tabs.

Using a local Ubuntu repository to avoid redownloading packages on a reinstall
Jul 31st, 2009 by sayanriju

Imagine the following  situation. You have been happily installing lots of stuff on your Ubuntu. All was going fine until you face a problem XYZ, the only feasible solution to which is a complete re-installation! You can probably back up all your precious personal data safely, but what about all those software you had installed? You need to re-install each and every of those in your new install of Ubuntu, but if your Internet connection is slow and/or expensive, that could be a major problem. A solution is to create a local repository with all those installed packages and use it temporarily in your new install to reinstall those packages.That is what this guide will attempt to teach you. Read the rest of this entry »

A simple bash script to schedule tasks
Feb 9th, 2009 by sayanriju

For some bizzarre reason, I have never been able to run cron successfully on my system. Mostly, I need functionalities like that offered by cron when I schedule my downloads to stop at the end of ‘happy hours’ of BSNL Broadband (2 am to 8 am).
Instead of trying to google up and solve my problem, I just wrote a simple bash script which will address my needs! The job the script does is quite elementary: it takes as argument a time and a command, and runs the command at that scheduled time.

Here’s the script:

#!/usr/bin/env bash

if [ "$#" -ne 2 -o `echo "$1" | awk -F ":" '{print NF}'` -ne 3 -o "$1" == "-h" -o "$1" == "--help" ];then
	## Print uasge instructions
	echo -e "Usage:	 mycron  \n	(Both arguments are mandatory)\nRuns specified command at specified time\n"
	echo -e "Note: You must specify the time for execution EXACTLY as HH:MM:SS\n"
	echo -e " E.g.: 09:00:00 instead of 9:00:00 or 09:00 "
	echo -e "\nAlso, 24 Hour clock format is expected,\nso use 21:00:00 instead of 09:00:00 if you mean PM\n\n"
	echo -e "mycron -h, --help : Display this help message and exit\n"
	exit
fi

while true;do
    ctime=`date | tr -s ' ' | cut -d' ' -f4 `
    if [ "$ctime" == "$1" ];then
	"$2" &
	echo -e "Process $2 with PID $! has been run at $ctime\nAborting script $0"
	exit
    fi
done

Of course, this script can be made to do things a lot better, but right now, it does exactly what I need!

Plans for an Ebook Collection Manager in PHP for DOEACC Project
Jan 29th, 2009 by sayanriju

I submitted the guide selection form for doing my DOEACC A Level projects yesterday. I had to choose a ‘Software platform’ to code on. My primary choice was of course Python, but unfortunately there’s no guide available at the Institute with any expertise in Python. Hence, I had to choose PHP/MySql as my language! :-(
The trouble is, I don’t know PHP at all! :P I’ve begun to learn it from some ebooks and w3schhols, and so far, my take on the language is pretty good.
The syntax is not as lucid and natural as Python (obviously!), but I’m really enjoying the way it can be used to manipulate HTML stuff! Since I’ve never done any web programming at all, this entire concept is like a new toy for me. Currently, I’m playing with connecting to a mysql database server (I’m fairly comfortable with SQL stuf) and viewing the result of my queries on the browser. The only time I need to stop is to check on with HTML syntax, because I am not at all well versed with HTML at all. Perhaps a bit of Javascript knowledge would also come in handy.

The idea of the project I have in mind is to develop some kind of a Ebook Library Manager. For long, I myself have felt the need of such an application to manage my reasonably large collection (nearly 2 gigs) of ebooks I have on my hard disk. None of the existing collection managers (like GCstar, Alexandria,etc) catered to my needs, so I needed to write an application of my own. Originally, my plan was to do it in Python with an Sqlite3 database backend and WxPython for the GUI. Now, Php would replace Python, MySql would replace Sqlite, and of course, there would be no need for a GUI toolkit as the frontend will be handled on the web browser itself by using HTML/JS. This is a rather good thing because I won’t have to worry about the WxPython codes, which is quite difficult & time consuming to perfect(esp. the layouts & alignments) in absence of a proper RAD tool. Also, the program will now be web-based & hence platform independent with no need for a specific GUI toolkit to be installed. On the downside, using PHP and MySql makes running a webserver like Apache mandatory, which sounds a bit overkill & out-of-context since the purpose of the program is to manage local ebooks. And I have to learn PHP, HTML and Javascript fairly well before starting the project.

I hope that this idea qualifies as a valid A Level Project, esp. with the aprox. 350 man hours involvement requirement posed my DOEACC. Formal allocation of guide and commencement of projects will begin from 3rd week of February. I intend to have a working draft of the project by then to show. Till then, onwards to w3schhols and the PHP Manual!

A small Python script for merging PDFs
Jan 27th, 2009 by sayanriju

I am a frequent downloader of ebooks in pdf format (yeh…I know its piracy and all! :P).
Very often the uploaders put up the ebook in parts, probably because of the large size of unsplitted pdfs. Here’s a simple script I wrote in Python to merge several pdf-s neatly in order.

#!/usr/bin/env python

from pyPdf import PdfFileWriter, PdfFileReader
import sys

opfile=sys.argv[-1]
output = PdfFileWriter()

for ipfile in sys.argv[1:-1]:
	input=PdfFileReader(file(ipfile, "rb"))
	for pnum in range(0,input.getNumPages()):
		output.addPage(input.getPage(pnum))
outputStream = file(opfile, "wb")
output.write(outputStream)
outputStream.close()

Its really easy to use it. Save it as pypdfmerge.py, and run it as:
python pypdfmerge.py  <input_file1> <input_file2> <input_file3> .... <output_file>
The last argument is always taken as the output file.
Note that it will throw some Deprecation warnings, but they are generally harmless, so ignore them.

Tux Avatars with March Linux logo
Jan 22nd, 2009 by sayanriju

What a way to start off this blog! :-)
Here are a couple of kewl tux avatars bearing the March linux logo on their stomach. I found the templates on the net and added the March Linux logo using The GIMP.

Tux Avatar with March logo

Tux Avatar with March logo

Another Tux Avatar with March logo

Another Tux Avatar with March logo

»  Substance: WordPress   »  Style: Ahren Ahimsa
© Sayan Chakrabarti (http://sayanriju.co.cc)