Suramya's Blog

Visit suramya.com Who am I?

July 10, 2012

Wireless finally working on the RaspberryPi

I finally managed to get wireless working on the RaspberryPi (Go Me!). The main problem was that when I connected the USB dongle directly to the Pi it wasn’t getting enough power, then when I connected it via a powered USB hub I kept getting error messages. If you like you can read about me previous attempts to get the wireless working here and here. Since I didn’t feel like spending more time on this (and because I thought that the problem was caused because of a problem with the USB hub) I stopped fiddling with it. Then I had to switch the SD card I was using in the Pi (the old one was the card from my camera so I replaced it with another 2GB card) so I downloaded and installed Debian Wheezy on it.

Turns out that the Wheezy doesn’t have the same problems with the USB hub as Squeeze did, so all I had to do was plug in the stuff, install the firmware and I was ready to go. To configure the wireless network I installed wicd as I have found that to be the easiest way to work with wireless networks, I also installed the wicd-curses interface so that I could configure the system from the commandline. The commands I used were as follows:

apt-get install wicd wicd-curses

Then ran wicd-curses to configure the Wifi, That’s it. Now my Pi is connected to net wirelessly and I have one less cable running across my desk, which is great.

Well this is all for now. Will post more later, its time for me to hit the sack. Have an early day tomorrow.

– Suramya

June 27, 2012

Installing Citrix on the RaspberryPi + Other Pi related stuff

One of the use cases I had for the Pi was to use it as a portable thin client that could connect to a Windows server using Citrix. After a little experimentation I managed to get Citrix installed on the Pi and was able to connect to a Windows server successfully and work. I documented the steps I followed to get this to work on the RaspberryPi forum, check out the Tutorial (How to get Citrix working on a RaspberryPi) if you are interested.

Getting Citrix working was a positive thing, other than that I spent some time trying to install my Wireless network dongle (3Com OfficeConnect Wireless. Model # 3CRUSB10075) on the Pi and hit some hurdles in the process. If you remember the last time when I tried this I thought the problem was caused because the card was pulling more power than the Pi could provide. So I went and got a Belkin powered USB hub (I needed it anyways as I need to connect more than 2 USB devices to the Pi).

When I initially plugged in the hub everything seemed to work without issues and the keyboard + mouse I had connected to the hub worked without issues. So I plugged in the wireless dongle, as soon as I plugged it in my mouse and keyboard both stopped working. I then unplugged the dongle and both the mouse & keyboard started working again. I then plugged the keyboard directly on the Pi and the dongle on the hub, now the keyboard worked but the mouse had issues. Looking at the /var/messages log I saw a ton of error messages like the following:

Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

Tried a few things but nothing worked and since it was 3:30 in the morning I gave up and crashed for the day. Will try again when I have had some sleep and get some dedicated time to play with the Pi.

– Suramya

March 13, 2012

Running Ubuntu on my Samsung Galaxy Tablet

Filed under: Computer Software,My Thoughts,Techie Stuff — Suramya @ 1:25 AM

A couple of days about someone at work posted an email asking about Ubuntu Installer and if anyone has tried installing Ubuntu on their android tablet using this software (Sorry I can’t remember your name but am too lazy to log on to the office network to find it in my mailbox). I volunteered to try it out because it sounded interesting and cool to have. This application allows you to install Ubuntu on your Android device on top of android so you basically run Ubuntu as a virtual machine in Android in a fairly easy and painless way. From the FAQ on the developer’s website:

This projects aim is to bring a range of linux distros to your android device through a method known as ‘chroot’, see it has running a linux distro within a virtual machine on your phone. You can access this virtual machine and run it on your phone without causing any damage to your device, or having to overwrite anything. Why might you want this? well my apps are designed to make the install and set up process as easy as possible (more so in the paid apps) while still giving you some flexibility. Once you have the distro up and running then you can pretty much run and install any linux software you like (so long as there is a arm port or it is not architecturaly depenedent), sure there a very few big benefits over what android itself can do but it is still pretty dam cool. (and with the free ubuntu version, hey its free does it matter how useful you find it?)

Excluding the time it took to download the image, the entire process took me about 15 mins to complete so that shows you how easy & painless the entire process was. The app install takes only a couple of mins to complete and that just installs an application that gives you a user guide that explains the install process and buttons to make the process faster/easier. The process is pretty self explanatory and if you can read and understand English and are good at following directions you should have no issues installing. :) I would really suggest downloading the images over WiFi because downloading 1.5GB over 3G/GPRS would be too expensive.

There are two Ubuntu images available: small (450 MB) & large which is 1.5 GB, The large image requires 3.5GB of free space on your SD card and the small image requires 2.5GB of free space. If you have enough free space then you should go for the larger image as that has the Gnome desktop plus a ton of applications pre-installed the small one doesn’t have too many applications preinstalled and uses LXDE instead of GNOME. I first downloaded the small image to try it out and liked it enough to download the large image.

The install itself was mostly painless. I did hit an issue initially when unzip’ing the small image file (the download is a zip file) with AndroZip as it was unable to handle the large file size and kept dying on me. Using Astro’s built in extractor resolved this and I was then able to extract the file without issues. Learning from this I downloaded the large image on my computer and copied it over after extracting it there (plus I didn’t have enough space to download the file and then extract it on the tablet itself).

After you download the images, the instructions tell you to install the VNCViewer app and the Terminal app. It wasn’t clear from the instructions that VNC was required to see the actual desktop itself so I didn’t install it at first thinking that it was so that you could connect to your laptop/desktop from the tablet. I later realized that it was needed to see the Gnome desktop so installed it and was good to go.

The process to start Ubuntu is a bit cumbersome and requires you to type a few commands on the Terminal but once you start the image and select the desktop size you are good to go and all you have to do then is connect to the Ubuntu desktop using VNC. The desktop is fairly responsive and you can zoom in for more fine grained control. The large image installs the Gnome desktop and not Unity but still it was pretty good. Would have liked to get the option to try Unity as it was designed for tablets but I guess that is a project for another day.

Below is an photo of the tablet with the Gnome desktop running on it (Taking a photo of a tablet at night is a pain because the flash reflects off the screen and without the flash the photo is too dark):

Ubuntu on Samsung Galaxy Tab
Ubuntu on Samsung Galaxy Tab

Over all a cool and geeky thing to have, but not really that useful in the long run unless you have programs that you want to be able to work on when not at your desktop and don’t have net access.

– Suramya

January 13, 2012

Official style guide for Android developers launched

Filed under: Computer Software,Interesting Sites — Suramya @ 3:01 PM

Google has just launched Android Design, a website created to help aid developers in the creation of applications for ICS. This makes it easier for developers to code visually consistent applications, so if you are interested in Android development check it out. I took a look and it has some good tips/suggestions on design etc.

Duarte wants to remedy this. On Thursday, Google launched Android Design, a web site created specifically to help aid developers in the creation of applications for ICS. The site offers a comprehensive visual to third-party application developers, giving suggestions on everything from how to implement different visual elements to overall back-end patterns for the OS itself.

In theory, it will help developers better understand just how the Android team thinks about layout and implementation, while simultaneously giving suggestions to interaction designers on how to maintain visual integrity. Basically, it will help both first-time developers and Android veterans make apps look less crappy.

Since have been thinking of diving back into mobile development for the past few days, this site will be very useful and has been launched at just the right time. Considering the previous experience I have with mobile development was on Symbian using Python, I can use all the design help I can get.

– Suramya

October 26, 2011

Connecting a WordPress blog to Facebook

Filed under: Computer Software,Linux/Unix Related,Techie Stuff,Tutorials — Suramya @ 5:01 PM

Over the past few months I have been trying to connect my blog to my Facebook account so that whenever a post is made on the blog it automatically gets posted on Facebook to varying degree’s of success. Most of the attempts would work for a while and then stop. I even tried using some of the existing plugins for WordPress but since they required a developer account (which needs a valid phone no or CC#) and for some reason I never get the validation code on my cell I was never able to get them to work.

Then I found an article on Linux Magazine on a Command Line interface for Facebook and decided to build on top of that to get the linkage working. Now this is a very hackey way and is not at all elegant or anything but it gets the work done which is what I wanted, so I am good. :) All the work was done in about 2 hours including testing so that should tell you something on its own.

I had to install this on my local system since my webhost didn’t have all the per-requisites to get this to work. That and the fact that I can’t connect to my MySQL db’s from a machine outside of my hosting provider is why this convoluted method was created. The steps I followed to get this to work are as follows.

Install Facebook Commandline

To install Facebook Commandline, follow the instructions on their site.

Authenticate the Application to be able to talk to Facebook

For some reason there was a difference when I run the application from the commandline and when I run it from the web, in as to where the preferences file and the session details were saved, so all the steps have to be done either from the command line or via the web, you can’t interchange the two.

Creating a Web interface for the FBCMD

Since I wanted to be able to get data from WordPress and pass it on to FBCMD I created a new PHP page called run.php that basically pulls the data from WordPress and then passes it to FBCMD as command line parameters. I know that using passthru is probably not very secure and I should have modified the FBCMD file to accept parameters as a URL but didn’t want to spend that much time trying to get this to work. (Hey! I told you it was a quick and dirty ‘fix’).

The contents of this file are very simple:

error_reporting(E_ALL);
$handle = fopen('http://www.suramya.com/blog/LatestPost.php', 'r');
$current = fopen('/var/www/fbcmd/latest.dat', 'r');
$current_id = fgets($current, 4096);
fclose ($current);

if ($handle) 
{
 $ID = fgets($handle, 4096);
 $link = fgets($handle, 4096);
 $title = fgets($handle, 4096);
 $content = fgets($handle, 596);
 $content = chunk_split(htmlspecialchars(strip_tags($content)), 500) . "...";

 if($ID != $current_id)
 {
  // If we have a new post then call FBCMD to make a post
  $command = '/usr/bin/php /var/www/fbcmd/lib/fbcmd/fbcmd.php POST " " "' . chop($title) . '" "' . 
              chop($link) . '" "' . $content . '"';
  passthru ($command);
  // Write the new PostID to a file
  $current = fopen('/var/www/fbcmd/latest.dat', 'w');
  fputs($current, $ID);
  fclose($current);
 }
}

The file basically calls ‘LatestPost.php’ and gets the latest post details on the blog(see below for details), then it checks if the post made is newer than the last post processed and if so it proceeds to post to Facebook using FBCMD.

‘LatestPost.php’ file looks like this:

< ?php

define('WP_USE_THEMES', true);
require_once( dirname(__FILE__) . '/wp-load.php' );

$month = $_GET['month'];
$year = $_GET['year'];

$args = array( 'numberposts' => 1);
$myposts = get_posts( $args );

//print_r($myposts);

foreach( $myposts as $post ) : setup_postdata($post); 
echo $post->ID . "\n";
the_permalink();
echo "\n";
the_title();
echo "\n";
the_content();
endforeach; ?>

This file need to be put on the server in the WordPress Root directory and when called returns an output in the following format:

Post ID
Post Link
Post Title
Post Content

Once all this is done and the FBCMD has access to post to Facebook all we need is a cron job to run on a frequent basis to run the code. So I created a shell script that contains the following line and have it run every 15 mins.

/usr/bin/curl http://localhost/fbcmd/run.php > /tmp/FBPost.out

That’s it. So far it looks like its working great and if this post shows up on my FB wall then all is well. If not, then its back to the code to see what went wrong this time.

– Suramya

September 19, 2011

Trouble-Maker: Learn to fix computer issues

Filed under: Computer Software,Linux/Unix Related,Techie Stuff — Suramya @ 2:38 AM

This interesting app randomly breaks your system so you can learn how to fix it.

Haven’t tried it yet because as of now I only have one working Linux system at home, but as soon as I fix that I will be installing this on my secondary system. Once I do that I will log my experiences here.

You can download it from Trouble-Maker‘s site.

– Suramya

May 18, 2010

Boot From a USB Drive even when your BIOS Won’t Let You

Filed under: Computer Software,Computer Tips — Suramya @ 11:37 PM

If you are like me then you have gotten into the habit of carrying a Live Linux CD with you at times, I keep mine in my Laptop bag so its there when I need it. However CD’s have a lot of inherent problems like, an inability to update the version without burning a new disk and a susceptibility to scratches.

Having a Bootable USB drive with the latest version of Linux solves all these problems. USB drives are quite cheap now and it makes sense to have one available loaded with the latest diagnostic tools. But till date I didn’t carry a bootable USB drive with me because a lot of the systems I encountered didn’t allow me to boot from USB which made the bootable drive pretty much useless. Now, there is a way to fix the problem. What you need is a Blank CD and the latest version of PLoP.

PLoP is a Bootmanager that allows you to create a boot CD that will enable the system to boot from a USB drive even when that option is not supported by the BIOS. You can download PLoP from here. Installing it is quite easy. You just need to extract the .ZIP file that you downloaded and burn the .iso image to a CD. There are two ISO images on the CD and you can use either one of them, however according to the readme file plpbtnoemul.iso should work “everywhere” so if you have some doubt use that image.

Once you burn the image to the CD, reboot the system and configure it to boot off the CD. When the system boots up you will get a boot menu that will allow you to choose USB as the device to boot from. Once you do that the system will boot off the USB drive as normal and you can proceed from there.

Hope you find this as helpful as I am going to.

– Suramya

Source: Boot From a USB Drive Even if your BIOS Won’t Let You – How-To Geek.

February 24, 2010

Getting Wireless on my HP Pavilion DV5000 to work on Linux

Filed under: Computer Software,Knowledgebase,Linux/Unix Related — Suramya @ 10:46 PM

I have heard that connecting to wireless networks can give a lot of trouble in Linux. I have even experienced the same when I tried out Debian and Red Hat Enterprise Linux (RHEL) 5 on my HP Pavilion DV5000 laptop. In Debian I managed to get the card working but on RHEL I couldn’t get it to work.

Actually I could have gotten it to work but lacked the time to spend trying out various solutions. Plus the final solution wasn’t very elegant or portable. Basically what I ended up doing was hardcoding the config file to connect to a particular wireless network. Which obviously wasn’t a very portable solution.

When I decided to try out Backtrack 4 which is a Linux-based penetration testing distribution that is based off Ubuntu I was worried that my wireless card (Broadcom BCM4318) would again cause issues. If you have been using Linux then you probably have heard of this-chip set as earlier versions of Linux had a lot of problems getting this card to work and so I was expecting a lot of work before I got the card to work.

While the OS was installing I did a little search on google and that reminded me of a post on Tech Republic that talked about 10 tools to connect to wireless networks in Linux so I decided to try out each of them to see which one worked for me.

Fortunately for me the first program I tried (wicd) solved my problem. All I had to do to get the network working was: log in as root and then run the following command:

/etc/init.d/wicd start

Once I ran the command all my network cards were automatically detected and I could configure them. However since its a pain to configure the cards manually, I ran the following command to start the GUI based client for wicd:

wicd-client

When you run wicd-client a new icon shows up in the system tray (next to the clock) and if you double click on the icon the Wicd manager starts and allows you to configure any wireless/wired network that the system detects.

Over all, wicd is quite easy and a lot more intuitive than the default KDE Network manager, plus another advantage is that wicd supports WPA which the default KDE Network manager doesn’t.

Now that I have gotten the card working on Ubuntu I am going to re-install RHEL on the laptop and see if wicd can get the card working over there also. But that’s work for another day.

– Suramya

February 15, 2010

Augmented Reality: Tattoo that transforms into a flying dragon

Filed under: Computer Related,Computer Software,My Thoughts,Techie Stuff — Suramya @ 7:52 PM

Augmented reality, the words bring to mind a science fiction world where people wear glasses hooked up to computers that give additional information on the item being looked at. I have read scores of novels where this technology is in use by humans (both in a positive and negative sense) but till date this technology was still in the realm of Science Fiction.

Now this has changed. ThinkAnApp studio based in Buenos Aries has developed specialized software that allows them to create a tattoo that when viewed through a camera gets transformed into a flying dragon. Or anything else you want. Pretty cool eh?

Here’s what the Tattoo looks like when viewed through a camera:

Check out the video demoing the tattoo in action here.

This is just a prototype and isn’t released for public use yet. But it is a step in the right direction and slowly but surely we are moving closer to the day when the virtual world will overlay the real world and open up all the awesome possibilities that entails.

Source: ThinkAnApp – Augmented Reality (tattoo).

– Suramya

December 11, 2009

Google Calendar Notifications/Issues

Filed under: Computer Software — Suramya @ 4:12 AM

Google recently made a change to its Calender service that I had been waiting for a long time. Actually they might have launched it a while ago but I only noticed it recently.

You now have the ability to send the reminder for an event to a mobile phone as a SMS. The best part is that it even works with my cell phone in India. So now I get reminders even when I don’t have access to my email (which I admit is pretty rare).

The only issue I have found so far is that the reminder via SMS is set about a day before the event no matter what setting I put in the interface. I have set the system so that I get a reminder 15 mins before any appointment set in my calender but I keep getting the reminder a day before, i.e. if the event is on the 8th I get the reminder on my cell phone on the 7th. Hopefully they will fix it soon.

The other issue I hit on the calender is that it seems to be impossible to change the date for an existing event. I wanted to change the date and time for a reminder but it refused to let me change the date. It did change the time to the new time but kept the event on the old date. I finally had to delete the old event and create a new event.

Now if I can get it to sync with my Phone it would be great. I got the phone to sync with my system but still need to get Google to sync to evolution. (The connection keeps timing out for some reason).

Other than these minor issues I really like the Google Calender.

– Suramya

Older Posts »

Powered by WordPress