Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

14 February 2009

The World of Goo ... and it tastes Goooood in Linuxland!

The common problem about running Linux at home is that you get so left out when it comes to games. Ive only just found out about OpenArena and Nexiuz, which satisfies my FPS needs. Im not much of a puzzle fan, but once in a while, a surprising and really interesting game comes along.

The game is called "The World of Goo". It features blobs which you can manipulate into wobbly shapes to build structures; towers, bridges to get the goo blobs from one place to another. It looks like a really souped up Flash game, except that the gameplay is far more complex and enthralling.

Whats better, the developers invested a little bit more to release it on Linux (deb, rpm and tarballs are available.) And it doesn't cost that much, at USD20.
This is what it looks like when you are tasked to build a bridge over a crevase. The links between the goo blobs are strong, but very wobbly. Any chance of latching on to solid walls must be taken advantaged of to build rigidity.
I really liked the Frog level, which was entitled "Not too high, not too low" because as you can see in the background of this screenshot, the "tongue" of the frog has to be suspended by the pink baloons which you manipulate. However if you place too many baloons, the ceiling is laced with spikes which would explode em, dropping your bridge to the bottom which destroys your ladder. Its quite evil.
What Im really impressed about is the art direction of this game. Its very colourful, the UI elements blend extremely well including the blobby cursor. The sound is cute, with a suitable soundtrack. The squeels of the blobs as you pick and place them remind me of Lemmings. Infact the game play is Lemming-like.
2D Boy, the developers have not DRM'ed the game, and offered Chapter 1 as the free demo levels. Ive played it Linux, and the performance was smooth, with no problems full-screen and windowed (as pictured). There is virtually no help in the game, not that its needed, but each level has some sign boards which are crypting and haiku like. Annoying but you just have to click on it.
Its a really good game, and I would recommend it, especially for those who love abit of puzzle solving, mouse dexterity and good clean fun.

Read on for more info via the HeliOS project.

yk

29 September 2008

-"We're sorry, this video is no longer available" YouTube downloader

More often than not, when the planets and moons aren't oriented in the right manner, I get the dreaded "We're sorry, this video is no longer available" from YouTube. I know that the video is certainly NOT "no longer available" because its clearly viewable by other people.

Fortunately in the linux world, there is this little python utility called youtube-dl which can be run from the command line to download any YouTube file. So when you get this error, copy the URL of the YouTube file, and do this:

# sudo apt-get install youtube-dl
# youtube-dl http://www.youtube.com/watch?v=videofile001

if it doesn't work, it will complain with this verbose error:

Retrieving video webpage... done.
Extracting URL "t" parameter... done.
Requesting video file... failed.
Error: unable to download video data.
Try again several times. It may be a temporary problem.
Other typical problems:

* Video no longer exists.
* Video requires age confirmation but you did not provide an account.
* You provided the account data, but it is not valid.
* The connection was cut suddenly for some reason.
* YouTube changed their system, and the program no longer works.

Try to confirm you are able to view the video using a web browser.
Use the same video URL and account information, if needed, with this program.
When using a proxy, make sure http_proxy has http://host:port format.
Try again several times and contact me if the problem persists.

You can then repeat this process over and over again, until it succeeds. Unfortunately this requires effort. And we computer users hate expending any unnecessary energy if possible. After all, focusing on the terminal, clicking the up arrow and hitting return is so so tedious.

So I wrote a little bash script to complement youtube-dl as it sports a few extra features:
  1. It will automatically try and retry to youtube-download the file until it is successful (thanks to $?)
  2. It will rename the resultant flv video filename to the current date and time, instead of the random garbage filename. (using date +%F...)
  3. It terminates gracefully when the user hits Ctrl-C (by setting a trap ...)
  4. It promotes world peace by waiting a few seconds before trying again (sleep is always good)
And here it is:

#!/bin/bash

i=1
fname=`date +%F-%H%M`

result=1

while [ $result = 1 ]; do
echo Attempt $i "$fname".flv
trap "echo User killing the download; exit" INT TERM
youtube-dl $1 -o "$fname".flv
result=$?
let i=i+1
if [ $result = 1 ]; then
sleep 10
fi
done

Try it out. The most I had to wait was 24 attempts. Thats 46 keypresses saved!


yk.

8 September 2008

Lotus Notes 8 and wrestling with attachments in Linux

A gripe about opening attachments in Lotus Notes 8 is that LN will fail silently, leaving the user guessing whether things are happening or not. If a user double clicks on an attachment, a dialog will pop up requesting if the user wants to "Open", "Edit", "View", "Save" or "Cancel".

Clicking on View for me gives a strange error: "Unable to create view: Device is disposed" and gives a whole load of eclipse errors in the details. I dont have the time to figure that one out.

So the next best thing is to "Open" the attachment. However that doesn't do anything, and LN fails to report that something has failed. The solution for this however is available here: "IBM - Attachments do not open from Lotus Notes for Linux Client when Open, Edit, or View is chosen in the 'Open Attachment' dialog" The trick is to remove IBM's own "openwith" program with whichever desktop manager you happen to install.

# sudo mv /opt/ibm/lotus/notes/openwith /opt/ibm/lotus/notes/openwith.old
# sudo ln -s $(which kde-open) /opt/ibm/lotus/notes/openwith


It works, but its amazing that we have to jump through these hoops just to open attachments!

yk

12 August 2008

IE6 on Linux ... why?!

Revamping a website to make it more CSS compliant, and getting rid of a whole load of <table> gunk. Playing with unordered lists and list items and tailoring the look with simple CSS is very addictive and somewhat rewarding. However this comes with a price, and its the Microsoft tax yet again. This time its a tax on my patience. Things just don't appear as they should on IE6, while Firefox, Netscape, Konqueror, Safari and Opera works perfectly. Considering that it still has about 30% market share (still way more than Firefox), it is a problem which needs to be addressed.

So to help me debug it without having to pull up a Remote Desktop, I had to install IE on my Linux machine. Eugh.

Fortunately the pain of installation was rather ... painless. IE4Linux has a great installation process which allows you to install IE5, 5.5 and 6 using wine and cabextract. The process is described here, and the screenshots looked like this:

It took about 7 minutes to download the CABs and run through the installation. The binaries are kept in a ~/.ie4linux folder. Running a user friendly symbolic link from ~/bin/ie6 displays ie in all its glorious splendour:

"Master, It Lives!"

yk

20 September 2007

Preserving time stamps on FAT32 copies

Strange thing about accessing FAT32 in Linux is that you get annoying warnings when manipulating the date and times of files. cp, tar and mv all raise wierd errors when doing the most basic things.

I especially needed to move some photos to my FAT32 mount, with the specific intention of retaining the file creation date and times. The correct command is "cp -p" where the "-p" flag means "preserve".

So we try:

$ cp -rp ../../cdrom/070915 .
cp: preserving times for `./070915/070915_P1250210.JPG': Operation not permitted
cp: preserving times for `./070915/070915_P1250211.JPG': Operation not permitted
$ ls -la 070915/
total 5344
drwxrwx--- 2 root plugdev 32768 2007-09-20 17:47 ./
drwxrwx--- 34 root plugdev 32768 2007-09-20 17:47 ../
-rwxrwx--- 1 root plugdev 593386 2007-09-20 17:47 070915_P1250210.JPG*
-rwxrwx--- 1 root plugdev 596410 2007-09-20 17:47 070915_P1250211.JPG*

The problem here is that the file creation date should be sometime on the 15th of September. NOT today. Did a google, and it brought me to this nugget of information:

This forum post:
if your own user id does not match the 'virtual' user-id, cp can not change the file date back to file date the source file.

The solution is clear - find out your user id (XXX), mount the partition with uid=XXX, and all the files on that partition belong to you - even the newly created ones. This way cp -a can set the original file date.

This works, of course, only for ONE user (and root).
So I changed the /etc/fstab file. Im quite disturbed by the new UUID usage instead of the ole fashioned /dev/hda access:

# Entry for /dev/sda5 :
UUID=41BD-AB60 /media/M vfat defaults,gid=users,utf8,umask=007 0 1

to

UUID=41BD-AB60 /media/M vfat defaults,uid=1000,gid=users,utf8,umask=002 0 0

Please note the changes in bold. A quick remount:

# umount /media/M
# mount -a

and copy:

# cp -rp ../../cdrom/070915 M/Photos/

Gives us:

# ls -la M/Photos/070915/070915_P1250210.JPG
-r-xr-xr-x 1 yky users 593386 2007-09-15 09:47 M/Photos/070915/070915_P1250210.JPG*

woohoo!

yk.

23 August 2007

Adjusting your swap files

I have a small Xen server which wouldn't start up with a swap partition. Whenever I add it in, it gives a strange error. Something which Ill have to figure out one of these days.

However its not a big deal, because its easy to set up a file based swap file in linux anyway.

First thing is to create the file to allocate disk space for it, for this case I just need a 500MB swapfile:

# dd if=/dev/zero of=swap.file bs=1M count=500
# chmod 600 swap.file
# mkswap swap.file
Setting up swapspace version 1, size = 524283 kB


Next is to make sure that it gets used at each bootup.
# cat >> /etc/fstab
/mnt/data/swap/swap.file none swap sw 0 0


but if you need it now, you just use 'swapon':

# free | grep swap
Swap: 0 0 0
# swapon /mnt/data/swap/swap.file
# free | grep swap
Swap: 511992 0 511992


and if you do a top,
top - 17:13:31 up 1 day, 6:57, 1 user, load average: 0.02, 0.03, 0.00
Tasks: 53 total, 2 running, 51 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 257024k total, 251808k used, 5216k free, 1036k buffers
Swap: 511992k total, 0k used, 511992k free, 183108k cached


Nice swap!

You can dynamically change the size of your swap files using swapon / swapoff combos.

yk.

25 April 2007

Ubuntu: Feisty Fawn

I managed to download ubuntu Feisty Fawn from the Taiwanese servers and got it relatively quickly. I installed it last Friday, and have been using it for a few days now and Im glad to say its pretty good!

First off, the installation process was OK, although it b0rked slightly while doing a Windows document migration. I just clicked cancel and it went away. Just slightly disconcerting.

After installation, I went into System/Preference/Desktop Effects, and immediately enabled compiz. Magically, it started up immediately, and it worked out of the box without me having to install any other drivers for my laptop's ATI Mobility Radeon 9200. Wobbly windows galore!

note: nice drop shadows, transparency on background windows and frames

Not wanting to miss out on the new eye candy, I installed beryl following these instructions: 3D Desktop (Beryl and Xgl) on Ubuntu Edgy Eft with ATI card
Installation, as I have now taken to expect, was a breeze. Synaptic is very nice. I just wish it would download files in parallel, and/or change to faster mirrors on the fly (ala Download Manager).

Beryl Settings and its Emerald Theme manager are extensive. There are a whole load of gizmos to test out and modify. Changing the drop shadow blur, the K factor in the wobbly windows, how windows minimize and appear, and whether to have over-the-top effects is addictive, and can waste a good hour or two of your life. Beware.

The other things I have done in making myself at home is to leverage on Google's tools to self integrate in the many different platforms. The Google Browser Sync for Firefox makes sure that my bookmarks and cookies are stored outside my Windows and Linux partitions. Ive also had to download my must have Add-ons, Mouse Gestures, PermaTabs, Google Notebook and Chatzilla.

I have Lotus Notes installed, running on CrossOver Office. Unfortunately the Lotus Notes window crashes or rather disapears when I do a beryl rotation of the cube. Its strange.

Ive setup some network printers. Pointing to a HP printer via JetDirect was easy, but setting up a printer which was shared by Windows was strange. I set SMB as the protocol, and everytime my computer located a Windows machine, a pop up appeared asking for a password. So if your network contains many machines (like mine) "Good Luck." Other than that, I managed to type in the Windows share name, and CUPS managed to find the appropriate share on that machine and I was up and running after selecting the correct printer driver.

Only now I wish there was an option to print 2 pages in one as most Windows HP drivers have the option to.

peeking behind Firefox... Lotus Notes, GIMP and OOo Calc running 'transparently' in the back ground

Other than that, the fonts look really good on my LCD display, and its certainly an impressive distro. Try it out today.

I passed a copy to Aizat and he too is finding it worthy of an upgrade.


yk

10 September 2006

PopTop - PPTP Windows VPN on a Linux Server

Our old PPTP server finally died last week.

It was an old Windows NT (!!!) server, and we were just wondering how long it would take before it got taken down. Well, it finally got found, and was subsequently infected with numerous viruses by the script kiddies out there. Comparitively, it lasted long enough, a good 8 years plus, so it had a good run!

We got rid of the viruses, and put it back on, and within a day, it got infected again.

Fortunately we dont have anything important running on it, most of our VPN requirements have been converted to IPSec. However is a small number of users who do want to connect from home, via the very convenient PPTP connections on their Windows machines. Very easy to set up and run. Not a crucial requirement, but nice to have...

So we decided to try PopTop.
"Using Poptop, Linux servers can now function seamlessly in a PPTP VPN environment. This enables administrators to leverage the considerable benefits of both Microsoft and Linux operating systems."
Setting this up was relatively easy. I followed the online instructions as described here: Redhat-howto. However there were problems.

At first the WinXP client would not connect to the server. Upon checking, I found out that the firewall was enabled on the server. So we opened up port 1723 for PPTP.

Then the WinXP client connected, but complained about the server not supporting certificates; either 40bit or 128bit encryption. My fault, didnt set the options.pptp file correctly with require-mschap-v2 and require-mppe-128 as options.

I used the webmin-PPTP-Server to do the administration (comes standard with webmin), and it was pretty much full featured except that it didnt have a section to define the MS-DNS and MS-WINS options as in the options.pptp file. Not a major problem; vi helped.

Its hard to debug the connection. Somehow I never got to ping the PPTP server when connected. So for a good 3 hours I was trying to find out what was wrong, and making sure that the routes are correct. Its annoying because a 'route print' nor a 'ipconfig' on the WinXP doesnt provide any useful information regarding the VPN setup.

And then finally I found this nugget of information: 'deselect "Use default gateway on remote network"' I tried it, and mysteriously it worked.

It took me longer that I anticipated to set up the server, however it was not because of the server setup, rather it was an obscure setting on the client to get it to work.

So now we have completely replaced the unsupported, defunct, aging, crackable Windows NT with a shiny new Fedora Core 5 server running PopTop. Users just have to make a small adjustment to their client setting to reconnect. I have since brought up the firewall to only allow certain traffic to flow through this connection to prevent future cracks.

Its amazing what FOSS can do for you.

yk.

30 August 2006

Ubuntu "Dapper Drake" LTS v6.06

I got a copy of Ubuntu from Aizat at the myoss stall at the PC Fair. Unfortunately it got me puzzled, as my laptop didn't recognise the disc as a bootable one. So it looked like a dud disk. However the content is OK, in that its viewable. So my only guess is that the person who prepared it mounted the ISO image and burnt the CD from the contents, and not the ISO directly. Ive seen this happen before, even by some computer experts. So if you happen to have this disc from the PC Fair, please throw it away and get a proper one.



I managed to get a bootable Ubuntu, and tried installing it on my laptop. Its a Compaq Presario x1407, which sports a widescreen 1600x1050 res. This gave X alot of problems in that my resolutions are not standard, and I often have to manually edit the config files just to get the settings right.

So I was rather pleasantly surprised when Ubuntu booted up into its glorious GUI and detected my display correctly. Its wonderful that these live installers allow the user to test drive the desktop before installing. Isn't it novel that linux can do that? "Try me, if you like me, install me". So I did. I clicked on the little icon, the only one available on the top right and proceeded to install Ubuntu, for the first time.

There were quite a few quirks with the Ubuntu installer, and I will list the few here in my notes during the installation.
  1. The time was wierd. After setting my timezone to KL, (which was on the map, fortunately) it added 7 hours to my system clock. This is wierd because my other OSs are ok with it. So I just went with it and readjusted the clock back 7 hours.
  2. The Keyboard selection was unique, it even has a text entry to try out the keys. However the screen on the right was conspicuously blank, which really show show a bitmap/SVG of the keyboards selected. The ability to support multi-languages out of the box is a real plus.
  3. The Disc Partitioner is slightly obscure. I have a 5GB partition which I leave for testing out OSes (the previous was linspire). I couldn't for the life of me figure out how to 'flag' which partition to install Ubuntu's root to. So I just deleted the linspire partition, and recreated it as ext3 with the option to format it. After clicking 'Next' it becomes obvious on how to set the partitions for installation, where we define the mount points. However it wasnt obvious when it mattered.
  4. It was great that it recognises all my partitions immediately and offers to mount all of them, including NTFS and FAT32s. My fedora 5 install requires me to jump through hoops for NTFS support.
  5. However the installer should show what the filetypes are to help us define the mountpoints. It would be great to have the graphic of the partitions displayed too.
  6. It took a mere 15 minutes to copy the gist of Ubuntu into the HDD. In the meantime, I could play all the games supplied in the GUI, and even browse the 'net as TCPIP was correctly configured. Thats quite a nice touch, and it beats Fedora's Anaconda which takes up the entire screen, or Window's text based installer.
  7. There were some issues with the GUI widgets: buttons started changing colours and only reverted on mouseover or when clicked and other oddities.
  8. So after the copying, I rebooted. Only to be greeted by a new grub, with WinXP correctly identified as a boot option. The cute drums upon login is a nice touch.
  9. 'sudo -i' is the means of getting the root shell. Use the users password, not roots.
  10. To get mp3 and all the other 'patented' goodies to work under Ubuntu, its relatively easy... in synaptic, select the 'Universe' and 'Multiverse' repos and reload the package info. Then install gstreamer and all the other stuff as described in this HowTo.
  11. One great thing is that Hibernate works out of the box! I assigned the power button to Hibernate, and after about 20 seconds, the computer shuts down. Starting up and resuming work would take about 50 seconds. Im not complaining, cos I never got it to work before.
  12. I added the Weather applet on the gnome panel. Unfortunately 'Kuala Lumpur' still is NOT an option under 'Asia/Malaysia'! The closest city is Subang, so I selected that.
  13. At home, the Wifi worked out well.
So its just been a few days of playing with this distro, and I must say, Im very impressed with it. Just one CD, and its quite a nice desktop, with all the apps to make it functional. The 'interactive' install is a definite bonus. I now know why this distro has so many fans and understand why it has grown so popular that quickly.

Well done to the guys at Canonical!

yk.