Pages

Wednesday, 21 September 2011

We can install Haskell Compiler like GHC and Haskell Platform using synaptic package manager in Ubuntu. But to get the latest version, we might have to install it manually.

1. Download the Glasgow Haskell Compiler binary.
2. Decompress the downloaded file and go into the ghc directory.
3. Now you need to configure the ghc binary. You can give the path of installation using the prefix flag.

./configure --prefix=/usr/local/ghc/7.0.3

Here I have downloaded v7.0.3. Since I wanted to keep different version of the compiler, I keep folders with version number under the ghc folder. Accordingly, you give the path to the configure script.
4. Install. It is already compiled, because you downloaded the binary.

sudo make install

5. Now you need to add the ghc directory to your path so that your bash shell can find it. There are numerous ways to do it. Create a file say "ghc-7.0.3.sh" in "/etc/profile.d"

Log out and log in. Open your terminal (Ctrl + Alt + T) and type "ghc --version" to ensure ghc is available.
6. Now you have a working Haskell Compiler. It is highly recommended to install Haskell-Platform which are a set of libraries for Haskell. For that you go to Haskell-Platform page and download the tar.gz file under the "Build from source" section. Decompress the downloaded file.
7. There are dependency files that you need to have installed before proceeding to compile the Haskell-Platform. So, let us install aptitude, which is a ncurses front-end to APT. Then we shall install 'happy', 'alex' and 'darcs' using 'aptitude' which are haskell libraries.

sudo apt-get install aptitude
sudo aptitude install happy alex darcs

Now we need to install C dependencies. To find that we will use a script. In general, the C dependencies are 'libedit-dev', 'libbsd-dev', 'libgmp3-dev', 'zlib1g-dev', 'freeglut3-dev'. You will need to run the below script to find out.
Let us call the below script 'depcheck'. Put it in 'bin' folder under your home directory. The 'bin' folder is added to you bash path. So bash can find all the scripts inside that folder.

Now go to the haskell-platform directory which you decompressed in step 6 and run depcheck. (Just type depcheck and press enter).
It will print out a lot of library names. You need to install all the ones which ends with a '-dev'. So the libraries shown to me are 'libedit-dev', 'libbsd-dev', 'libgmp3-dev', 'zlib1g-dev', 'freeglut3-dev' and 'libglu1-mesa-dev'. (Just in case, if your installation aborted saying that it is missing some library, then you can install them and continue the installation).

8. Now that you have got all your dependencies installed, you can proceed with the Haskell-Platform. (You are now in the haskell-platform directory).

./configure --prefix=/usr/local/haskell-platform/2011.2.0.1
make
sudo make install

It will take a while to complete.
9. After the successful installation of Haskell-Platform, you need to add the directory to your path. Like in step 5, you create a file say 'haskell-platform-2011.2.0.1.sh' in '/etc/profile.d/' folder.

Sunday, 7 August 2011

There are various compression formats, of which the mostly used under GNU/Linux are gzip and bzip2.

Compression:
tar.gz
To use gzip to create .gz package, you need to first create a container. For that tar can be used. Packaging files into a container and compression are two different things. gzip is mainly used for compression of a single file, which can be a container made from tar as well.

Saturday, 6 August 2011

Some codecs like libdvdcss2 are restricted due to its proprietary nature. They are required to play dvds. To install them in Ubuntu, you can add the medibuntu repository and do an apt-get.
1. Add the repository

To play videos, .rm and other realvideo formats in Ubuntu, the only way that seems to work is to install RealPlayer under Wine.
I have tried custom build of mplayer, w32codecs, kaffeine etc. None of them works. Also the realplayer for GNU/Linux. It loads the video, displays the first frame, crashes and quits just like that.
And to convert them, using mencoder fails giving the error "Video Stream is mandatory!".
The command I used to convert is given below:

Monday, 27 June 2011

If you have Ubuntu installed along with Windows, you will have Grub as the bootloader. So if you decided to remove Ubuntu, then restoring the default Windows bootloader is required (else you can keep grub, but that's not the point), which you must do at first.

The easiest and the least time consuming way to restore Windows bootloader is to install lilo bootloader under ubuntu. And do a restore as shown below:

sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

Now you have updated the MBR (Master Boot Record), and it will boot into Windows. You can use any harddisk management tool to format the GNU/Linux partition back to NTFS.

Saturday, 30 April 2011

When you try to install Adobe CS5 products, you might get an error like: "Installer failed to initialize. Please download adobe support advisor to detect the problem". Downloading the support advisor didn't help me because it showed me what OS version I'm running, and a link to adobe support. Hmm.
Here is what you need to do.
1. Goto to your temp directory. (Press Windows+R key and type %temp% and press enter).
2. Open the file PDApp.log.
3. Look for any [Fatal] entries.
4. What I have got is that the installer wasn't able to create C:\DOCUME~1\username\LOCALS~1\Adobe\OOBE\PDApp\PDApp.exe.
5. Now create those folders for the installer, and run the installer once again.

Sunday, 10 April 2011

If you get "su: Sorry for normal user account" under FreeBSD implies you are a normal user and cannot switch to root. To enable the current user to switch to root by 'su' command the user must be a member of the group "wheel".
You can add your user account to the wheel group by:

pw user mod username -G wheel

Example:

pw user mod Alice -G wheel

Btw you need to be root or have sufficient privileges to add a user to the group.

Monday, 4 April 2011

(This post is up-to-date with Ubuntu release 12.04).
These are just the steps to install tor and the necessary software to make it run smoothly on your Ubuntu. For detailed info on what each parts does, you can always refer to the tor docs.
1. Add the following to the end of your /etc/apt/sources.list file.
The format here is

deb http://deb.torproject.org/torproject.org <distribution> main

Since we are using Ubuntu 12.04 we will use 'precise' for the distribution

6. (Optional but recommended) If you want a GUI frontend for tor install vidalia

sudo apt-get install vidalia

Vidalia will show a message on how it should handle tor. You can choose 'complete takeover'.
7. Append the following at the end of /etc/privoxy/config file or uncomment the line

sudo vim /etc/privoxy/config
forward-socks5 / 127.0.0.1:9050 .

Note that there is a space and a dot after 9050
8. Now we have successfully installed and configured the tor and its family, we need to tell the browser to use the network.
Assuming that tor is running else, start tor by

sudo /etc/init.d/tor start

Open firefox, and install tor addon.
If you install the tor button addon, then choose use polipo in the browser network settings.
Else to configure manually goto preference->advanced->network->settings->manual proxy configuration and enter the values for the following

And click test settings. If things went well you'll get 'Tor proxy test successful' message.
You can check you IP address to see the difference.
9. Take about:config in the Firefox browser and set the value for network.proxy.socks_remote_dns to true to avoid DNS leaks.
NB: Its better not to run P2P software in tor network. The main purpose of tor is to provide anonymity for browsing. To make the tor network faster, you can consider running a tor relay on your system as well.
I highly recommend using the HTTPS Everywhere extension for firefox from eff.org. It will make your browser to choose https protocol over http if the target server supports one.

Friday, 11 March 2011

This is a video tutorial on how to flash Nokia N900 completely.
Here I'm flashing using the Global firmware. If you don't have skype pre-installed, its a good idea to flash it using a global version since it includes skype.

Flashing procedure
1. Install maemo-flasher.
2. Switch off the device, press 'u' on the phone's keyboard and plugin via USB. The phone will boot with a USB icon on the top right corner.
3. Run the following commands as required.

NB: The commands for flashing are (in order):

flasher-3.5.exe -F "path to eMMC image (vanilla)" -f

which is for flashing eMMC, and then

flasher-3.5.exe -F "path to Combined image (fiasco)" -f -R

for flashing the OS.
To flash the OS only, run the second command (fiasco). It is not recommended to only flash the eMMC (user content). So in that case, we need to flash the OS as well.

Friday, 18 February 2011

"Windows installer service can not update one or more protected windows files, installation failed" and the setup rolls back any changes. This happens because some dll are missing in your Windows XP.
1. Download fp4autl.dll and Fpencode.dll
2. Copy them to the "C:\Program Files\Common Files\Microsoft Shared\web server extensions\40\bin" directory.
3. Run the Office 2007 setup once again.

Sunday, 16 January 2011

After installing chromium, you might not see "Add to Launcher" for the chromium browser in the Ubuntu Unity interface. For that to appear what you need to do is just reboot. Now run chromium, right-click the icon and you'll see "Add to Launcher" option.

Friday, 14 January 2011

Appcelerator Titanium is handy if you like to develop desktop as well as mobile (and web applications) entirely using JavaScript or other scripting languages like Python or Ruby. It supports html5 and css3. Its an alternative solution to the proprietary Adobe AIR and Adobe Flash. Yes, flash is still proprietary and the eclipse pig IDE, the Flash Builder (without which it would be an overkill to use the Flex sdk) costs like crazy.
Back to installing titanium v1.2.2 on Ubuntu 10.10 Maverick Meerkat.
1. Download the linux package from the appcelerator download page.
Mine is 32 bit OS. Note that if you have less than 4 GB of RAM, don't even bother installing a 64 bit OS, because its useless in every sense.
2. Extract it and navigate into the folder.
3. Run Titanium Developer.
You can do it by using

./Titanium\ Developer

4. Install to say your home directory.
It will download two packages and it closes.
5. Run it again (step 3).
It will throw the error:

Note the * at the end of the filename. There are files ending with .la*, .so@, .so.0@ etc. Its to delete all of them.
8. Also the python linked by appcelerator is version 2.5 where as in Ubuntu 10.10 it has version 2.6. So fix it.

Tuesday, 4 January 2011

Squiggly SDK can be used to add spell check for your Flex components.
1. Download Squiggly SDK from Adobe Labs.
2. Create a new Flex Project.
3. Copy the libs in the SDK to the libs in the Project folder.
4. Copy the contents in the src folder of the SDK to the src folder in your Project.
5. Import the Class