Feeds:
Posts
Comments

Archive for the ‘Techie’ Category

Fixing Matlab errors in Ubuntu 12.10

I recently installed Ubuntu 12.10 in my system and found that the upgrade a lot of my system. A reasonable number of fixes were simple but some of them were very annoying. In this post I just wanted to discuss two specific errors I faced and how to fix them.

I use the student version of Matlab (32 bit) on a 64 bit machine. As part of upgrade to Ubuntu 12.10 , the installer removed multiple 32 bit files which caused the issue. When I tried to run Matlab , I got the following errors :

~/matlab/bin/matlab: 1: ~/matlab/bin/util/oscheck.sh: /lib/libc.so.6: not found

~/matlab/bin/glnx86/MATLAB: error while loading shared libraries: libXpm.so.4: cannot open shared object file: No such file or directory

The first error is mostly harmless – I will describe how to fix it later in the blog post. Fixing the first error needed to install 386 (32bit) version of few packages. Of course, fixing one exposed the next error and so on. In the interest of time, I will put all the packages in the single command.

sudo apt-get install libxpm4:i386 libxmu6:i386 libxp6:i386

Running the above command worked and allowed Matlab to run. However, I then faced another issue – when I tried to save a plot, it was failing again with the following error : (fixing first caused the second)

MATLAB:dispatcher:loadLibrary Can’t load ‘~/matlab/bin/glnx86/libmwdastudio.so’: libXfixes.so.3: cannot open shared object file: No such file or directory.
??? Error while evaluating uipushtool ClickedCallback

MATLAB:dispatcher:loadLibrary Can’t load ‘~/matlab/bin/glnx86/libmwdastudio.so’: libGLU.so.1: cannot open shared object file: No such file or directory.
??? Error while evaluating uipushtool ClickedCallback

 

To fix this, run the following command :

sudo apt-get install libxfixes3:i386 libglu1-mesa:i386

Finally, to fix the innocuous error :

~matlab/bin/matlab: 1: /home/neo/gLingua/matlab/bin/util/oscheck.sh: /lib/libc.so.6: not found

do the following :

sudo ln -s /lib/x86_64-linux-gnu/libc-2.15.so /lib/libc.so.6

Of course, make sure the libc-2.xx.so version is the correct one before running this command.

 

Hope this post helped !

Read Full Post »

As part of my research, I collaborate and share datasets with fellow researchers. These datasets are usually huge and hence cannot be shared via email. Since I started using Dropbox, I felt it to be a convenient mechanism t share them.

The workflow I came up with was very simple. Create a folder inside my Dropbox public folder, put the dataset in it and share the link with my friends. Sounds simple enough. Although in practice I hit a snag.

I was surprised to find that I was not able to get a shareable link for folders within Public folder. For any other folder in my Dropbox, I was able to right click and get  a shareable link. Long story short, the way to enable it is very simple. You just need to visit this site :

https://www.dropbox.com/enable_shmodel

 

Now you can right click on any folder (either using the client or in Web UI) to get the shareable link. An interesting side effect was that I was able to get the shareable link for any file/folder in my Dropbox folder. That’s right – I was able to share a folder that was not in my Public folder. This is a bit surprising but could be useful someday nevertheless.

Read Full Post »

I have been a happy Amazon Prime customer for the last couple of years. One of the biggest perks of using it the availability of large number of videos available for instantly watching. Infact, I watched almost all episodes of Star Trek (TOS to Voyager) using this method.

Sometime in the second or third week of January, this method broke down. Whenever, I tried to play the episodes of Voyager, I got an error in Flash player. Basically, it will open a dialog box saying ‘Updating Player’ which will soon error out saying "an error occurred and your player could not be updated”. If you retry, it will get stuck with ‘Updating Player’ .

I was using Ubuntu 11.10 on a 64 bit machine. I tried lot of things and nothing really worked. I installed and reinstalled Adobe Flash plugin and other codecs and basically made a mess of my system. Finally, I found a simple solution in Amazon Instant Video forum in an unrelated thread. The link is here . The solution is very simple . Install hal and libhal1 package for your distro. If you are using Ubuntu, the command is

sudo apt-get install libhal1 hal

 

Few of my friends also had this issue and installing these packages seems to fix the issue. Unfortunately, this useful tip seems buried under other  noise and hence I decided to put a separate blog post. If this did not fix the issue I recommend looking at Adobe’s Problems playing protected video content on 64-bit Ubuntu Linux page. This has some additional information on making flash work.

Read Full Post »

In this post , I assume that you use Ubuntu (with English) and want to use it to read or write Tamil stuff. Hence , I discuss steps to view Tamil web pages and also edit files in Tamil. This post will not tell you how to get a localized Tamil version of Ubuntu.

Reading Web Pages in Tamil

This is the most common requirement. You have Ubuntu and you want to visit and read , say, Tamil newspapers or blog posts. To do that install the following packages :

sudo apt-get install language-support-fonts-ta ttf-tamil-fonts ttf-indic-fonts-core

These three packages should solve the problem of Tamil fonts from multiple websites. ttf-indic-fonts-core  adds some popular Tamil fonts (in addition to other fonts for Indian languages) and ttf-tamil-fonts adds some more additional Tamil fonts.

Writing in Tamil

Writing in Tamil is done by adding Tamil keyboard layout to Ubuntu. If you are in a version before Natty (11.04), then use “System -> Preferences –> Keyboard” . If you are using Natty, then click on the power icon on the right hand top of the screen and select “System Settings”. In the settings dialog, choose Hardware tab and then select Keyboard. This will open up keyboard preferences menu.

Select the “Layouts” tab and click on Add . In the “Choose a Layout” dialog, go to the Language tab and select Tamil as the language. Choose your preferred variant . I have chosen “India Tamil Unicode”.  Click “Add” to add the language.

If you notice, the top panel will automatically get the keyboard layout indicator which highlights the currently selected language. This selection is application specific . For eg, if you selected Tamil when typing in gedit and then went to say LibreOffice, you will be typing in your default language in LibreOffice. Initially this behavior is a bit confusing, but usually makes lot of sense in practice.

In the Layouts tab, click on Options and set an appropriate key combination in the entry “Key(s) to change layout”.  I use “Shift+Caps Lock”. This is useful as otherwise , you need to key toggling in the keyboard indicator. If you are keyboard person, this is the best way to switch over all the languages in your layout. If there are multiple, then pressing “Shift+Caps Lock” cycles through your choices. The keyboard applet/indicator will change appropriately.

Unfortunately, most Tamil keyboard layouts are not mnemonic based and it takes quite a while to get used to. But once it starts working, it’s a great liberating feeling to type in another languages.

Using Tamil

Since Linux has a great internationalization support, you can use Tamil for other purposes also. For eg, I use Tamil to name folders ! Or sometimes even write some personal stuff 🙂 . Most applications including Nautilus has multilingual support and things should seamlessly !

Read Full Post »

I am not a big fan of Twitter but lot of geeks I respect seem to use it. I used to follow a few Twitter accounts using RSS in Google Reader. Basically, I will go to the Twitter account’s page and there will be a RSS icon. Clicking it will subscribe the feed in your favorite RSS reader. I can follow the accounts from Google Reader as if it is yet another blog.

Unfortunately, Twitter recently announced that they are not planning to support RSS directly. If you go to the latest Twitter page of the account you want to follow, you will not see a RSS icon. This annoyed me to no end as it used to provide a convenient way for me to follow the accounts in the comfort of Google Reader. The following are are some of the hacks that you can use to get the RSS feed url to subscribe in your reader. I have arranged them from easy to hard.

Method 1 : Using Google Reader’s Add Subscription

This seems to work for me as of now and hopefully will work in the near future. If you are using Google Reader, click on "Add Subscription" button. In the textbox, enter the url as "http://twitter.com/username" . Change the username to the actual account name that you want to follow. This will subscribe you to the account’s feed.

Method 2: Using Account Name in Twitter API

If the above did not work or if you are using other RSS reader , there is an alternative. If you know only the account name, use the following as the feed url :

 http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=accountName

This technique uses information from Twitter’s dev wiki of the API that returns the last 20 statuses of the user.

Method 3: Using User ID in Twitter API

This method is slightly more advanced and assumes that you know the user id of the account that you want to follow. This number is not easy to find – especially in the new twitter. The following instructions assume you use Chrome, but the instructions for Firefox must be similar. For other browser users, you can use the overall idea given here and adapt it to your browser.

(1) Go to the account that you want to follow. Click on the "Tweets" tab so that the last few tweets are visible.
(2) Now select few of the initial tweets using the mouse.
(3) Right click -> Inspect Element
(4) In the develop tools that is now shown, enter the account name of the user. Find the instance that comes with the user-id field. A sample might be :

<a class="tweet-screen-name user-profile-link" data-user-id="1234567890" href="/#!/accountname" title="Account Name">Account Name</a>

Alternatively, you can search for  "data-user-id" (without quotes) in the search box. Note that entering part of it (say user-id) will not work. It has to be exact. Find the element that corresponds to the user profile.
(5) In the list of elements that are matched, find the number whose length is between 8-10 – eg 1234567890.
(6) This is the user id of the account.

Once you get the user id, there are two methods to subscribe. One uses the variation of previous method. Enter the feed url as (replace 1234567890 with the actual one)

  http://api.twitter.com/1/statuses/user_timeline.rss?user_id=1234567890

The other alternative is to use the following as the feed url (replace 1234567890 with the actual one)

  https://twitter.com/statuses/user_timeline/1234567890.rss
   

I hope one of the methods works for you and helps you to follow your favorite Twitter accounts using your greatest RSS reader 🙂

Read Full Post »

Note  : This post is intended for students of UT Arlington who wants to connect UTA Auto Login wireless network.

Please follow the steps below to connect to the network :

  1. Go to Settings –> Wireless and Network –> Wi-Fi Settings
  2. Make sure that Wi-Fi is enabled.
  3. Your mobile must now scan and list the available networks.
  4. Select “UTA Auto Login”
  5. Set EAP method as PEAP
  6. Set Phase 2 Auth as MSCHAPV2
  7. Set CA certificate as NA
  8. Enter your netid in Identification.
  9. Enter the password associated with Netid.
  10. Voila ! You are now connected to UTA Auto login.

Hope this little post helps some folks !

Read Full Post »

MIT OCW is one of the best things that happened in education in the last few years. It features hundreds of course materials available for free to anyone who is interested. I became interested in OCW to improve my CS and Math skills. So far, I have completed multiple courses and currently I am trying to follow their MultiVariable Calculus course.

It always amazed me that MIT was willing to put such high quality stuff out in the open – Sure, my toiling on Calculus or Linear Algebra does not have a “tangible” outcome – meaning, I am not going to get MIT certified for all the hours I spent on it. But it does help me do well in courses in my university based on these courses. For eg,  I have a different perspective of how things work in data mining or machine learning after watching few of MIT lectures on  Calculus / Linear Algebra etc.

MIT OCW has a detailed page on donating where they provide all necessary information. I do try to support MIT OCW by donating at least couple of times a year – But as a student my monetary contributions are limited which always bothered me. 

A Simple Idea

Few days back, I got an idea after reading this post . Basically, the post details the amount of referral money that GNOME foundation gets from Amazon when users buy songs from Amazon MP3 store via Banshee. Sure, the amount is small as the audience is small – People who use Linux AND Banshee AND buy from Amazon within Banshee !

I also remembered that MIT OCW does have Amazon referral link. More details are given at OCW’s Amazon referral page. Amazon gives MIT OCW 10% referral when people buy items from Amazon when either clicking on book links from OCW or when they visit to Amazon through the URLs in the referral page. Since the OCW audience is considerably bigger, I searched for the amount of referral money that Amazon brings. The details are scarce but this link says the amount is around $30,000 at the end of 2009.  That is pretty impressive considering it is almost 20% of the visitor donation of 2009 !

Whenever I want to buy something in Amazon (that’s my primary choice as I have Amazon Prime) , I directly search using the Chrome’s Amazon search instead of going to Google. So, I reasoned that if I could somehow make MIT OCW as the referrer, then OCW will get the referral fees from whatever purchases I make. Even though it might be limited, it indirectly increases my “contribution” to MIT OCW.

A small technical detour

Before we modify our browsers to make MIT OCW as the referrer , we might have to change some habits – Don’t worry , it will only make you more efficient 🙂

First, when you are buying do consider Amazon. Of course, not at the expense of your finance. But lot of times, I find that Amazon has the cheapest rate or the difference is reasonably negligible. Since most of the blog readers are students, you may be interested to know that they offer one year free Amazon Prime for students. Your shipping will be free if you chose two day shipping. Even otherwise, Amazon has free super saver shipping for most items above $25. Most of textbooks cost  a fortune and you will be eligible most of the time.

The next is to directly search in Amazon instead of searching the item in Google and going to Amazon by clicking the link. If you feel you might miss some cheaper alternatives, check out other book search engines like vialibri.net which searches multiple sources anyway.

One of the coolest Chrome Geek tip is to use its search engines effectively – Chrome comes with lot of built-in ones and allows you to assign keywords for them. To manage them, click on the Wrench icons and select “Preferences” (Options in Windows) . In the “Basics” tab, go to the section on “Search” and click on “Manage”. You will get a new window listing known search engines.

Lets change the way you search items, in say, Wikipedia. Go to the entry for Wikipedia and click on ‘Edit’. You will see a new smaller window. The item we are interested is the second textbox which is labeled as “Keyword”. Set it to some mnemonic you want -  For eg wiki. I set it just w. Now click save and close the window. Go to Chrome’s address bar and type “wiki Blah” (or in my case w blah). Watch Chrome magically take you to the appropriate wikipedia page directly – No intermediaries like Google ! Think of all the seconds that you can shave off for each Wikpedia search 🙂

I have mnemonics for everything in my Chrome. I use y for Yahoo, b for Bing, a for Amazon and so on. So all you need to do to search for some item in Amazon is to type “a item” in Google’s address bar (assuming ‘a’ is mnemonic for Amazon).

If you are using Firefox, then its now as straightforward. Firefox does come up bundled with few search engines and Amazon is one of them – but reaching is a bit tricky. Now press “ctrl+k” to reach the search pane (or use the mouse !) Once you are in search pane, you can switch search engines, by using the arrow keys. Once Amazon search engine is selected, type the appropriate keyword and the Amazon’s result page pops up.

Firefox also offers an easier way. Click on the list of search engines list in search pane and select ‘Manage Search Engines’ . Now in the new window, select the appropriate search engine and click on ‘Edit Keyword’. For eg, you can set ‘a’ for Amazon. Then you will be able to type “a item” in address bar to search for “item” in Amazon directly !

Changing Referrer in Chrome

Changing the referrer in Chrome is easy. Click on the Wrench icon and select “Preferences” (Options in Windows) . In the “Basics” tab, go to the section on “Search” and click on “Manage”. You will get a new window listing known search engines. Now select the entry for Amazon and click Edit. (I f you cannot find the search engine for Amazon, then go to Amazon and search for dummy stuff and check again). In the “URL” textbox append the words “&tag=mitopencourse-20”. In Ubuntu, your URL field will look like this (you can even copy this one !)

http://www.amazon.com/exec/obidos/external-search/?field-keywords=%s&mode=blended&tag=mitopencourse-20

In Windows, my entry looked like this :

http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=%s&x=0&y=0&tag=mitopencourse-20

The word “tag=mitopencourse-20” is what that makes MIT OCW as the referrer. I have assumed that you are using Amazon US. If you are other versions of Amazon, use the following table and swap the word “mitopencourse-20” with the other.

Amazon Locale

Referrer Code

US

mitopencourse-20

Canada

miop-20

France

miop0c-21

Germany

miop0a-21

Italy

miop01-21

UK

miop-21

 

Now search for something in Amazon directly using the keyword you set previously. For eg, if you used “a” as mnemonic then try “a itemName” and find if the tag that you just set appears in the url of the search results page. If so, then great ! Else, recheck the previous steps.

 

Changing Referrer in Firefox

Changing the referrer in Firefox is a two step process – Since Amazon comes a default search engine, modifying it directly does not seem to work. Instead , you have to move the item to your local search plugins folder and then change referrer there .

Ubuntu (Or Linux)

1. Find your user specific firefox search plugin folder. Typically it is at ~/.mozilla/firefox/<profileFolder>/searchplugins. Replace the word <profileFolder> with appropriate name. For me it is at ~/.mozilla/firefox/72p71i29.default/searchplugins . If it does not exist, create it.

2. Assuming English as your firefox locale , move the file /usr/lib/firefox-addons/searchplugins/en-US/amazondotcom.xml to your profile folder. It is important that you move the file and not just copy it.

3. Open the file in some editor like vim. Check for the line that starts like

<Param name="tag" value="someRandomText"/>

4. Now modify that line and change the value to “mitopencourse-20”. Your line must look like

<Param name="tag" value="mitopencourse-20"/>

 

Of course if your Amazon locale is different, use the above table to find the appropriate referred id. Reopen Firefox and search for something in Amazon directly using the search engine (either the search engine in search pane or using its keyword). If the search result has the tag for MIT, then great ! Else please repeat the steps again more carefully.

 

Windows 7

1. Find your user specific firefox search plugin folder. Typically it is at C:\Users\<userName>\AppData\Roaming\Mozilla\Firefox\Profiles\<profileName>\searchplugins . Replace <username> with your actual username and profile name with your actual profile name. For me it is at C:\Users\zionWin\AppData\Roaming\Mozilla\Firefox\Profiles\jon9mxki.default\searchplugins . If it does not exist, create it.

2. Move the file “C:\Program Files\Mozilla Firefox\searchplugins\amazondotcom.xml” to your profile folder. It is important that you move the file and not just copy it.

3. Open the file in some editor like notepad++. Check for the line that starts like

<Param name="tag" value="someRandomText"/>

4. Now modify that line and change the value to “mitopencourse-20”. Your line must look like

<Param name="tag" value="mitopencourse-20"/>

 

Of course if your Amazon locale is different, use the above table to find the appropriate referred id. Reopen Firefox and search for something in Amazon directly using the search engine (either the search engine in search pane or using its keyword). If the search result has the tag for MIT, then great ! Else please repeat the steps again more carefully.

 

Conclusion

The effort needed to make this change will be only few minutes – You are not killing kittens. Also this does NOT increase the price of your item that you buy from Amazon. All that happens is that when you buy something from Amazon, MIT OCW will get a 10% cut.  It is not clear to me whether that applies only to textbooks or to any items. Typically, referrals works for all items.

I think this might be the simplest way that you can contribute to MIT OCW without much effort from you. Please spread the word !

Read Full Post »

Older Posts »