eXTReMe Tracker
Nov 162011
 

On most Linux/Unix based systems, you can save your Matlab figure as a postscript instead of saving it as a png or jpg. One advantage of saving figures in this manner is that you can save multiple images as separate pages on that .ps document, whereas with png/jpg you have to save each image as a separate file.

To print the current image to postscript, all you need to run is:

print(‘-dpsc2′,’filename’);

To have multiple images appended within the postscript document, you need to use the -append switch.

print(‘-dpsc2’, ‘-append’, ‘filename’);

Your output postscript will have the name filename.ps

To convert the postscripts to pdf format, just run the ps2pdf command in the terminal window:

ps2fpdf filename.ps

The output of this would be filename.pdf

And you’re done.

Nov 102011
 

In order to install l1-SPIRiT Compressed Sensing Parallel MRI, we need to have a couple of programs installed – fftw3, lbz2.  Usually you encounter the following error while running build routine in Matlab.

/usr/bin/ld: cannot find -lbz2
collect2: ld returned 1 exit status

sudo apt-get install libbz2-dev

After installing libbz2-dev this error is corrected.

Nov 092011
 

Some .avi files tend to have an out of sync audio track, some can’t be scrolled through (forward/reverse), while others might show an message that says the index file needs to be recreated.

Solution is to create a copy of that file that has an index recreated and remove the original and save the copy and all the usual replacement methods.

mencoder -idx files1.avi -ovc copy -oac copy -o file2.avi

Here file1.avi is the input file, and file2 is the output file with corrected index.

Sep 192011
 

The latest version of Ubuntu is heavily based upon Unity environment. Unfortunately Unity has no track record of playing nice with existing gnome programs. For network applications such as VNC, Unity crashes the program with whole bunch of errors. These crashes are observed occasionally in the Ubuntu 11.04 (Natty Narwhal) release, and most certainly in the latest beta 1 release of Ubuntu 11.10 (Oneiric Ocelot).

If you have gotten comfortable with Ubuntu and want to continue using Gnome as the main environment, you can do so by using Linux Mint 11 (Katya). It has the same repositories as Ubuntu and you can even use the ubuntu-restricted-extras and build-essential packages which lets you obtain some of the fonts, codecs and libraries that Ubuntu fetches for you.

Ubuntu is starting to put more emphasis on making their release into an eye-candy, at the cost of reduced functionality. Having used Ubuntu since Dapper Drake days, its sad to ditch it for another distro. IMO Ubuntu 10.04 was the cleanest distro they put out – things have been going downhill after that. Linux Mint on the other hand picked up at the point when Ubuntu started to go dysfunctional. It has everything that Ubuntu should have been. There isn’t much to write about Mint 11. Its very similar to Ubuntu 10.04, has a newer kernel 2.6.38.xx, clean graphics, and the same repositories as Ubuntu. The transition is very easy, and things look a lot more neater in Mint.

To recap: If you are currently using Ubuntu and are afraid to upgrade to the 11.10 release, your fear is quite justified. Make a backup of your /home folder and go for a clean install of Linux Mint instead. I moved to Mint about a month ago and have had a rather smooth sailing so far.

Apr 202010
 

Some of the countries that had remarkably high data transfer rates were reporting a drop in network speeds as a result of smart phones gaining popularity over the past year or so. Following that train of links, one ends up article after article about which nation ranks first in network speeds, and where US lies on that list and so on. There was one website which gave a really comprehensive set of results and analysis, right till the ISP level for pretty much every nation on the planet.

speedtest.net

Speedtest - Analyze network speeds and compare results

Seems like the site is pretty up to date too.

Jun 262009
 

Since the analog TV signals have been discontinued in most cases throughout the country, the only way to catch TV signals is to have TV which can capture and process digital transmission, or if you subscribe to cable. Since I’m not too terribly interested in watching TV, there was no point in investing in a new TV and subscribing to cable was totally out of the question. The option then was to get the reception on my desktop computer.

The solution was to get a cheap ATSC tuner which plugged into the USB port and which had a loop antenna for reception.

ATSC digital Tuner Antenna

ATSC digital Tuner Antenna

The antenna plugs into the USB port through a TV tuner card. The one I own is an Artec tuner card. I learned after I purchased it that it didn’t have support in Linux yet. Schade!

ATSC USB tuner for tuning digital TV reception

ATSC USB tuner for tuning digital TV reception

Once the hardware is setup is complete, we can get the local TV station information through Windows Media Center. That program pleasantly surprised me. After asking you for your zip code, it connects to a database and gets the TV schedules for all broadcast stations in your city. Then it scans for available channels and sets up a list of stations with their programming schedule.

Options seen under Windows Media Center, including one for Live TV.

Options seen under Windows Media Center, including one for Live TV.

You can either watch recorded shows or watch Live TV.

You can either watch recorded shows or watch Live TV.

Windows Media Center Live TV in action.

Windows Media Center Live TV in action.

Once Windows Media Center has scanned for the available channels, you can watch HDTV right on your own computer. In addition to being a TV tuner, Windows Media Center converts you computer into a DVR, where you can record programs or Pause and Rewind the shows that you are watching in real time. Pretty impressive stuff. Whats more impressive is that the equipment costed less than $30, that includes shipping.

Unfortunately the Artec card can’t be used within Linux since the kernel still hasn’t incorporated the hardware specs of Artec USB tuners  in video4linux (v4l). But I’m pretty sure it will be available pretty soon.

Feb 102009
 

Recently I bought a student version of Matlab2008b. It was for Linux platform. Here’s my experience with installing the program on 64-bit Linux (Debian) architecture, what problems arose along the way and how they were addressed – with help from Mathworks tech support.

Matlab at work

Matlab at work

Installing Matlab 7.7 (i.e. Matlab2008b) the old fashioned way was a breeze, but getting it to actually run on 64-bit architecture involved a few steps, which I didn’t know. I sent a query to Mathworks tech support saying:

The installation files were able to successfully install Matlab2008b on Ubuntu 9.04 (Jaunty), however, the program failed to load since it cannot find the jre files for 64-bit architecture. Is there a workaround for running the 32-bit program on 64-bit platform?

And they replied with a procedure to be followed to make that happen:

Yes – here is a full walkthrough:

1) When running the MATLAB installer (install_unix.sh) use the -glnx86 flag.  This will allow it to install properly on a 64-bit Linux machine:

./install_unix.sh -glnx86 -t

2) Once the installer is finished, you will need to activate through mathworks.com, as the activation client will not work properly on 64-bit computers.  To do so, follow the instructions below:

http://www.mathworks.com/support/solutions/data/1-3YZBZ6.html?solution=1-3YZBZ6

3) Once MATLAB is installed and activated, you will need to run MATLAB using the same -glnx86 flag that you used to install:

$MATLAB/bin/matlab -glnx86

(where $MATLAB is the MATLAB installation folder)

NOTE: Some users have problems loading the JRE when running in this configuration.  Creating a symlink in $MATLAB/sys/java/jre named glnxa64 pointing to glnx86 should resolve this issue.  You can do this with the following command:

ln -s $MATLAB/sys/java/jre/glnx86 $MATLAB/sys/java/jre/glnxa64

And now it works. Haven’t had any GUI crash on me yet, but it been less than an hour since I’ve been using it. One way to avoid typing matlab -glnx86 before each launch is to create a local alias.

gedit ~/.bashrc

Under one of the listing for aliases, you can type in:

alias mat='matlab -glnx86 &'

Save and exit. Then onward, you can launch the program by simply typing in mat in the terminal.

In case your compiz is enabled, you might not see the menus correctly. To fix that problem, you have to run the following command at the terminal.

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/
Jan 302009
 

Until today’s kernel update to 2.6.28.6, the Atheros wifi card was not functioning correctly. Since the update to new kernel, the wifi card can now be used with the ath5k module which can be found in linux-backports-modules.

In order to get the Atheros 5007EG card to work, you first need to disable the built-in hardware driver.

System >> Administration  >> Hardware Drivers > Deactivate “Support for Atheros 802.11 cards”

Selection of Hardware Drivers in Januty

Selection of Hardware Drivers in Januty

Disable the Support for Atheros 802.11 cards

Disable the Support for Atheros 802.11 cards

After the card has been deactivated, open the terminal and install the backports modules for Jaunty.

sudo apt-get update && sudo apt-get install linux-backports-modules-jaunty

Install Jaunty backports modules

Install Jaunty backports modules

This adds the ath5k module which supports the Atheros 5007EG card.

The computer needs to be Shutdown and powered back on. Somehow Restarting doesn’t work at times. The card has to be completely powered down for a few seconds and then started during power up.

You should be able to see the available wireless network list by clicking on the network manager icon. Thereon, you all know what to do 🙂

Jan 232009
 

The recently released Windows 7 Beta (Build 7000) has several improvements in its GUI. Many of these features have been discussed at length in several blogs. Among other things, there is a deafult option to stack all program tabs in the taskbar keeping it from running out of space.  There is a mouse-over feature that shows a preview of that program and brings that program to the foreground when the mouse is moved over that preview.

Then there is one tiny feature in the Windows Explorer that should have been implemented long time ago, but its good to finally see it in this release.

Organize >> Folder and Search Options >> View >> Use Check boxes to select items

Windows Explorer Checkbox Option

Windows Explorer Checkbox Option

Once that option is selected, a checkbox is displayed in front of the file each time the mouse hovers over it. This options overcomes the need to select individual files by keeping the ‘Control’ key press at all times.

Checkbox is displayed in front of file icon

Checkbox is displayed in front of file icon

This is one of the features I’d like to see ported over into Gnome for use in Linux distros.