Friday, October 31, 2008


Making money using Linux

Yes, it is possible! :)

First you can run ads on your web site and/or blog. Like many others I have tried Adbrite and Adsense. Both services will work using a Linux server. Of the two services most people will probably earn more money with Adsense but there is no reason why you can't try both. The usual logic applies here, the more traffic = more clicks = more earnings.

Another way you can generate some extra money is to participate in online surveys. My experience so far is that one can make more money with surveys than with ads. If you are Canadian then one of the best survey sites is Webperspectives. This is a really good site and it pays via paypal but I'm not sure it is 100% Linux compatible. I hate to say this but if you are a Linux user it may be a good idea to have a second computer handy running Windows 2000 or newer just in case you encounter a survey that uses activex or is otherwise Linux unfriendly. I can also recommend InboxDollars (link to the left or at the bottom) but unfortunately this one will probably require a Windows computer.

There are also many sites that will pay you to look at ads. You can even buy referrals so you can receive money via other people looking at ads. There are tons of these types of sites but I had the most luck with One advantage is that many of these sites will pay out quickly via Paypal or Alertpay. I haven't had any problems using my Linux computer and Firefox to use these sites, but the earnings were significantly less than the survey sites, at least without buying any referrals.

A third method for making money is to write articles for services like PayPerPost and Blogsvertise. PayPerPost requires a blog to be at least 90 days old and have 20 articles or more before it can be considered for paying jobs. Evidently some people are making some serious money, upwards to $20,000. So far I haven't made anything from these services as my blog is too new. On a positive note it appears that Linux users will have no problem signing up and the people there seem friendly.

This topic definitely needs a follow-up so I'll be sure to write more on my future experiences, especially where PayPerPost is concerned. I enjoyed most of the surveys and it didn't really eat up too much time. Getting paid to look at ads is definitely less fun and the money doesn't seem to be too good but some others do report earnings of hundreds of dollars. The trends are clear, it seems online jobs are here to stay and if one is determined enough you can indeed make some money. If you feel that the earnings are too meager with one particular site don't be afraid to drop it as there are tons of sites out there.

Tuesday, October 28, 2008


Determining Filenames for Devices

In Linux each device is given a filename but it is not always obvious what filename goes with each device. One package which can help is sg3_utils. Download it and do the usual ./configure and make all. Once the package is installed do as root:

sg_scan -i

On my system the output is as follows:

/dev/sg0: scsi0 channel=0 id=0 lun=0 [em]
Generic USB SD Reader 1.00 [rmb=1 cmdq=0 pqual=0 pdev=0x0]
/dev/sg1: scsi0 channel=0 id=0 lun=1 [em]
Generic USB CF Reader 1.01 [rmb=1 cmdq=0 pqual=0 pdev=0x0]
/dev/sg2: scsi0 channel=0 id=0 lun=2 [em]
Generic USB SM Reader 1.02 [rmb=1 cmdq=0 pqual=0 pdev=0x0]
/dev/sg3: scsi0 channel=0 id=0 lun=3 [em]
Generic USB MS Reader 1.03 [rmb=1 cmdq=0 pqual=0 pdev=0x0]
/dev/sg4: scsi1 channel=0 id=0 lun=0 [em]
ST380211 0A 0000 [rmb=0 cmdq=0 pqual=0 pdev=0x0]
/dev/sg5: scsi2 channel=0 id=0 lun=0 [em]
SONY DVD RW DRU-190A 1.64 [rmb=1 cmdq=0 pqual=0 pdev=0x5]
/dev/sg6: scsi2 channel=0 id=1 lun=0 [em]
BENQ DVD DUAL DW1610 B8B9 [rmb=1 cmdq=0 pqual=0 pdev=0x5]

Now it's clear what the filenames are for each device but it's still rather hard to remember that one's second DVD burner is called /dev/sg6. So we use the sg_map command as root:


The output on my system:

/dev/sg0 /dev/sda
/dev/sg1 /dev/sdb
/dev/sg2 /dev/sdc
/dev/sg3 /dev/sdd
/dev/sg4 /dev/sde
/dev/sg5 /dev/scd0
/dev/sg6 /dev/scd1

Now we have enough information to figure out what the names are for each of the sg devices. In my case it includes the multi-card reader (sda to sdd), the external usb hard drive (sde) and the two DVD writers (scd0 and scd1).

To mount an SD card:

mount /dev/sda1 /mnt/usb3

On my system I don't usually refer to /dev/scd0 when I'm accessing one of my DVD writers. Instead I link it do a more descriptive name:

ln -sf scd0 /dev/dvd1
ln -sf scd1 /dev/dvd2

This does not include everything, only those units the system considers sg devices. You may find that the device names are different on your version of Linux. Finally one can check out the filenames for their scanners via:

scanimage --list-devices

Which outputs on my system:

device `v4l:/dev/video0' is a Noname BT878(Hauppauge (bt878)) virtual device
device `hp:/dev/usb/scanner0' is a Hewlett-Packard ScanJet 5200C flatbed scanner

If I want to tell kooka to use the HP scanner I do:

kooka -d hp:/dev/usb/scanner0

Friday, October 24, 2008


Sherlock Holmes in the 21st Century

It was a cold day in October as Holmes and I went to visit the computer museum. The streets were rather crowded with automobiles and we were glad to remove from this somewhat hazardous environment. Although we considered ourselves Victorian gentleman it had become obvious to both of us that we needed to become familiar with these new devices. As we looked about us the museum seemed a stark clinical place with very little charm. The walls and floor were white with computers lined up against both sides. There was a time-piece visible as we came in which had a red digital LED display, common in this era.

Holmes keen eyes quickly took in the surroundings and remarked "Well Watson, how do you like the 21st century so far?".

I was feeling out of place and had a slight headache. "It seems to me that the world has become very noisy Holmes. Was it really necessary to come here?"

"We must fully avail our minds with the technology of the times, Watson. Our purpose here is to find a suitable computing device for us both. You can be sure that the criminals of this era have already done so. But since computer technology changes so quickly it is not in the hardware we should concentrate on, but the software."

"Software Holmes? I'm not even sure what the term means! I gather that these devices here that resemble typewriters are the hardware, but what is meant by software?"

Holmes began typing on one of the units, a somewhat out of date machine called an 'Amiga 4000'. There were various cables and plugs, one of which disappeared into the wall.

"It is a bit like cooking Watson. Think of the recipes your wife kept in the kitchen. A list of instructions to prepare a meal. Although it is more sophisticated than that as there are different kinds of software. In this case we are interested in operating systems."

"Why operating systems Holmes?"

Holmes folded his arms and formed a judicial pose.

"Well you see hardware is transitory, due to the rapid improvements in technology. If we were to choose this machine here we would be at a dead-end. It's operating system is no longer maintained and improved upon, so despite the fact that it was an excellent computer in it's day, it is not a good choice in the long run. We need an operating system that is actively maintained and there are three choices which come to mind."

I looked around spotted three devices which were separated from all the others.

"Do these ones here represent your final choices Holmes?"

"Yes, indeed" Holmes remarked as he walked over to me. "These three computers have actively maintained software and represent the best of what is available. There was a fourth one which I briefly considered called 'Macintosh' but I discounted it on the basis of cost. These three computers have generic hardware and are all identical save for the operating system on each."

Holmes gestured to the computer on the left.

"This one has Windows XP, a fairly modern incarnation of the series. It is the most commonly used OS and has the advantage of being fairly easy to use. It's main disadvantage is that it is a closed system and the user can not modify except in a very limited fashion and also the user must pay a significant price to legally use it."

Holmes pointed to the computer on the right.

"On this one we have BSD which stands for Berkeley Software Distribution. It's advantage is in it's security. It is very difficult to attack it from the outside. It is also an open system which is freely downloadable. Thus a dedicated user can modify and make improvements to their taste. It's main disadvantage is the lack of applications for it which makes for a rather boring desktop, nevertheless it makes an excellent server."

Holmes sat down to the computer in the centre position.

"Finally we have the Linux operating system which has many programs to choose from, has no cost to download and can be tailored to the taste of the user. It has most of the advantages of the other two and has an actively growing user base and most importantly a good variety of applications. While other systems have fallen by the wayside over the years this one, much like it's mascot the penguin, continues to endure in a harsh environment. This is the system we must now learn Watson."

I looked over to my companion with rather bleary eyes and commented "Surely not now Holmes. I'm feeling rather weary and in the need of some sustenance."

Holmes rubbed his hands together and said "I know just what you need Old Boy: Fish and Chips!"

I groaned "Please Holmes, not Fishbone Alley again! I'll never live down that interpretation of myself!"

Holmes grin broadened. "Surely such a dire fate can be avoided Watson. I'll get Mrs. Hudson to make us some shepherd's pie."

Somewhat mollified I allowed Holmes to lead the way back to Baker's street. Even though I still felt uncertain of my ability to learn computers, given sufficient time and Holmes' help surely I would become competent at least.

Sunday, October 19, 2008


Fixing FTP Problems with Blogger

There's plenty of folks out there having ftp problems with blogger. There are a lot of folks running blogs on their own domains. I was one of those people. Basically any time I tried to publish a post for my blog it would timeout.

First, a little background information. I run my own server which is connected to a Dlink DI-704P router. My first piece of advice to people in this situation is to make sure your router is getting the proper power it needs! Many times I have seen routers and DSL modems not work correctly because the DC power transformer was faulty. Sometimes the transformer will heat up a lot and that is a sign that it could be defective. If you are in doubt check your transformers with a volt meter.

The problem I was having occurred when I had to switch from a DI-604 router to the older DI-704P router. The power transformer failed on the DI-604 and so I swapped the DI-704P router in. After the DI-704P router was connected I couldn't publish any blogger posts. I use vsftpd as my FTP server so I started looking at vsftpd.conf and tried different things to get it to work.

Now I know that blogger is using passive ftp so one needs to make sure that their ftp server is set up for that. In my vsftpd.conf file there are the following lines:


Now as it turns out I had everything set correctly on the router itself. It had the necessary ports 1023 to 1500 open. The next line in the vsftpd.conf was the cause of all my problems:


This is the INTERNAL ip address of the computer on my LAN that runs the ftp server. I changed this address to my EXTERNAL IP ADDRESS and after a quick "/sbin/service vsftpd restart" everything worked perfectly. Now the strange part was that I was able to publish posts on the DI-604 with vsftpd set up with "pasv_address=" before. It didn't always work but it worked some of the time. When I switched over to the DI-704P it would always have the timeout problem when posting. Now I'm pleased to say I can publish my blogger posts with no timeout problems.

Friday, October 17, 2008


How Linux Friendly are Media Sites?

A while ago I evaluated how easy it was to access video on several news and media sites. Below is how I rated them:
sux          doesn't work at all
marginal works with severe limitations (e.g. flash-only)
good works with some limitations (e.g. microsoft formats only)
excellent works with standard formats (e.g. mp4)   citytv (toronto) sux sux good good marginal flash 9, mp4 excellent wmv, realplayer excellent mp4 excellent

Since that time I had to again revise my opinion on the level of Linux friendliness of It was never that good but recently it's become downright hostile to Linux users. Not too long ago I could use flash 9 to see videos on cnn and before that I could look at the page source and actually capture video to the hard drive. Now one needs to have the "Turner Media Plugin" if you want to see the videos.

As you can see from the list TVO and BBC were excellent, CBC was good and CTV was awful. Now I must add CNN to the list of awful sites (with respect to Linux). Now when I try to see a video all I get is a gray rectangle with the words "General Error". Like a bad virus keeps morphing itself so that Linux users are unable to use their video services.

In the past I would delve into CNN's site and try to decipher all the technical mumbo-jumbo, but this is the end. If by some miracle one manages to figure out a way to see videos on CNN under Linux no doubt it will morph again and all your work and time spent will be wasted. So now I will no longer bother with it and move over to other sites.

As alternatives allow me to suggest TVO and WNED.

UPDATE: Oct. 21, 2008
Did a quick check on CITYTV (the Canadian TV channel's web page) and for the Linux aficionado the pickings are slim. There are lots of flash ads and little interesting content.

Tuesday, October 14, 2008


Common uses of Mencoder

One of the most popular uses of the internet is viewing videos on youtube. The 10 minute limit is rather short and often users will upload videos in parts to comply with the time limit. Let's say the video you're interested in is in three parts. One can download all the parts via a python script and use mencoder to combine the parts together:

mencoder part1.flv part2.flv part3.flv -o all.flv -ovc copy -oac copy -of lavf -lavfopts format=flv

Another interesting problem I came across was a video on VHS that was recorded on it's side. The reason this was done was because it was a recording of an upright video game and the display was higher than it was tall. The bash script to record from VHS to the computer is here.

Then I used mencoder like so:

mencoder -vf rotate=2 -o tempest-rotated.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg1video tempest.avi

One can also use mencoder to take a bunch of png files and make a video out of it:

mencoder "mf://*.png" -mf fps=10 -ovc lavc -o file.avi

This only scratches the surface of what mencoder can do, but it's definitely a useful tool.

Tuesday, October 7, 2008


Archiving Important Data

One important job that doesn't always get the attention it deserves is the archiving of data. Even though I've told people many times to back up their files once a week this usually isn't done. But in the case of irreplaceable data merely copying your files to DVD may not be enough.

Let's consider the parchive utility. For Linux purposes you can find the source here. When you have very important files, you don't want to just copy those files to a DVD. A DVD could become scratched or degraded due to bitrot so a bit of extra protection is nice to have. Here is an example of using the par2 utility to backup all the files in the current directory to a par archive called "test":

par2 c -r10 test *

In the case above we are specifying a level of redundancy of 10%. It seems that if you use an asterisk to represent all the files in the current directory there can be no subdirectories underneath otherwise this example will not work. In this case it is recommended to use the tar utility first:

tar -zcvf test.tar.gz *

then proceed with:

par2 c -r10 test.tar.gz

The result will be a series of files something like this:


Using the tar utility has the added benefit of storing metadata such as the owner and permissions of the files.

Finally the files can be archived to some optical disc format. I usually use k3b for this purpose.

Friday, October 3, 2008


Getting More out of Mplayer

Most Linux users know that mplayer is an invaluable tool. When it is configured and compiled with the proper options it can be used to watch television, listen to the radio (over antenna or via the internet), rotate videos upside-down and even watch videos with their colours inverted. Reading through the documentation can be a daunting task and I seriously doubt that any one person is familiar with all of mplayer's options and remembering how to type in all the options is next to impossible. Here are some uses of mplayer which may be infrequently used and therefore unfamiliar to most users:

Watch and rotate a video 90 degrees clockwise:
mplayer video.mpg -vf rotate=1

Watch a video with the colours inverted:
mplayer -vo xv -vf eq2=1.0:-.8 file.mpg

You have two DVD players and wish to use your 2nd drive:
mplayer -dvd-device /dev/cdrom dvd://1

Watch a video in ASCII mode:
mplayer -vo aa -monitorpixelaspect 0.5. video.mpg

Watch a video and use post-processing:
(this is an example of using the linear blend deinterlacer, very useful in certain cases)
mplayer video.mpg -vf pp=lb

Learn more about post-processing options:
mplayer -pphelp

Learn more about video output drivers:
mplayer -vo help

Learn more about audio output drivers:
mplayer -ao help

Listen to the radio off the antenna:
mplayer radio://88.7

Watch a video 37 minutes in:
mplayer -ss 37:00 video.mpg

Process audio from a wmv file to a wav file:
mplayer test.wmv -ao pcm:file=test.wav

Listen to WBFO (National Public Radio) streaming over the internet:
mplayer -playlist

Naturally to get all of these features out of mplayer you will need to use configure with additional options. The base mplayer may not be able to use your radio card for example.
Surely mplayer must be one of the most sophisticated and useful utilities ever written.

Wednesday, October 1, 2008


Majesty Gold for Linux

Some older games are still fun to play. I tend to play older games longer than most people, e.g. Railroad Tycoon 2. This game has excellent longevity but it would seem that the only way to buy it would be to find old stock on Ebay. One can have a lot of fun with extremely long games (more so than most) which I detail here. That game started in the year 1870 and went to 2749.

RT2 is an RTS or Real Time Strategy game first published in 1998. There is a tutorial, campaigns and scenarios for the player to work through and also a map editor. The Linux version is called "Railroad Tycoon 2 Gold Edition" which includes the Second Century expansion pack. It has the ability to be played over the internet but this feature doesn't seem to work in modern Linux versions. Even after all this time I still haven't finished all the campaigns.

Majesty Gold for Linux is another RTS game from LGP. You can see a description of the game and purchase it here. By buying it from here you are helping to support the development of an updated version of the game.

The game Majesty Gold also has great longevity. Even after playing the game off and on for years, I don't feel I have exhausted all the strategic possibilities. Sometimes I try to finish a quest with only one class of hero, e.g. playing "The Fertile Plain" and using only Temples of Krypta. Unfortunately the promise of downloadable quests was never fully realized. There were only two downloadable quests ever released: "Balance of Twilight" and "Wrath of Krolm". It is possible in theory to have more than one downloadable quest for 'majesty' the original game, but it is very problematic for the newer game 'majx'.

I have finished all the quests but one quest is by far the most difficult and that is "Legendary Heroes". The big problem in solving this quest is there is only 30 days of game time given before a huge earthquake destroys your palace. This is 30 minutes in real time if the game is played at regular speed. It is possible to win though and the two main strategies which seem to work best are 1) cover the map with wizard towers and using lightning on the barrows or 2) Recruit as many monks and possible and then put them in an outpost and then use the Wrath of Krolm to give them all super-speed (I have more fun with this method). My fastest time for this quest is 26 days.

Another interesting quest for Majesty Gold is "Valley of the Serpents". In this quest you must try to defend all the Elven Bungalows. To win you must have at least one Bungalow escape destruction and eradicate all the Snake Pits. One thing that makes this quest difficult is the Ice Dragons who will immediately try to destroy the Bungalows. Things escalate for both heroes and monsters as both sides receive re-enforcements throughout the quest. It is possible to get the jump on the monsters and destroy all the Snake Pits in as little as 8 days.

I would be very interested in hearing from anyone who still plays Majesty Gold or RT2. Judging by some of the comments I've seen these games still have a following.

Finally if you are interested in Linux games the place to check out is TuxGames. They have a great selection of games and continue to expand their selection. You can also chat with other gamers in #lgp on IRC on the Freenode network.

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]