tag:blogger.com,1999:blog-69916426476314265522024-03-12T18:04:14.503-04:00Linux LivingA place where I can write down my thoughts, tips, and tricks that help me live without windows on my computer. Sometimes with things to say about programming and cool software that I use.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-6991642647631426552.post-12397477895490470712010-05-03T18:24:00.002-04:002010-05-03T18:26:01.895-04:00acpitool as an Alternative Suspend Method for Ubuntu 10.04 (Lucid Lynx)I've noticed that people still seem to be having difficulties suspending their laptops after upgrading to Ubuntu 10.04 LTS (Lucid Lynx). I had mentioned <a href="http://nixliving.blogspot.com/2010/03/workaround-for-broken-ubuntu-suspend.html">previously</a> that there is a command-line tool called <b>powersaved</b> that allowed me to put my Toshiba Satellite A200 laptop in suspend mode when the main suspend function in Ubuntu 9.10 could not. The good news, after upgrading to Lucid Lynx, is that the main suspend function (accessed through the session management menu in Gnome-Panel) actually suspends my laptop! The bad news is that, for those of you who are still having suspend issues after upgrading to Lucid, <b>powersaved</b> is no longer available.<br />
<br />
To help, I set my mind to searching <b>Synaptic Package Manager</b> for a command-line program that works like <b>powersaved</b> but is actually available to Lucid Lynx users. I have thus far found a very helpful little command-line program called <b>acpitool</b>. It's so simple to use! Once you install it, just type <span style="color: green;">sudo acpitool -s</span> and your computer will go into suspend! If you follow my directions on how to make a launcher script from my previous post regarding <a href="http://nixliving.blogspot.com/2010/03/workaround-for-broken-ubuntu-suspend.html">powersaved</a> then you'll also have a button to make it even easier to use this command-line tool.<br />
<br />
Hope this helps people!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com18tag:blogger.com,1999:blog-6991642647631426552.post-29827361528471297312010-05-02T12:30:00.003-04:002010-05-02T13:23:42.206-04:00My Experience Upgrading to Ubuntu 10.04 LTS (Lucid Lynx)I recently upgraded my Ubuntu 9.10 installation to Ubuntu 10.04 LTS. At the outset of the process I was really hoping that I could just start the upgrade, leave my computer running over night, and come back to find that the upgrade all finished. Unfortunately, I was wrong. Throughout the upgrade process there were several points where I needed to decide whether I wanted to keep some old configuration file or overwrite it with something completely new. Seeing as how I kept leaving my computer as it was upgrading (in the hope that it would finish automatically) only to come back and find that it wanted me to tell it what to do at these decision points, the whole process took about a day! <br />
<br />
While it was certainly annoying to get through the upgrade, I'm very happy to report that absolutely nothing cataclysmic or annoying happened to the programs I had installed in my 9.10 installation or the data that I had accumulated. Everything's running very smoothly: My OpenSSH server, Alpine, PostgreSQL, R, Python, Firefox and Thunderbird, and so forth.<br />
<br />
The one thing that kind of annoyed me was the messaging menu. It's a little envelope icon that sits next to the volume icon in the Indicator Applet. I'm not really that into microblogging, so I don't have a use for a panel applet that facilitates such functionality. Thankfully, I learned a way of getting rid of it. Just go into your terminal and type in <span style="color: green;">sudo apt-get remove indicator-messages</span>. Once the process completes, you right click on the indicator applet (the volume icon and the envelope icon together), click on "Remove From Panel", then right click where the two icons previously were, click on "Add to Panel...", highlight the Indicator Applet and then click on "Add". Voila! The messaging menu is gone :)<br />
<br />
I've read numerous times of people having problems upgrading Ubuntu, versus doing a fresh install of a new version. Thankfully in the case of upgrading to Lucid Lynx from Karmic Koala, I have seen no issues! So, I heartily reccomend upgrading to the latest and greatest version of Ubuntu.<br />
<br />
----------------- Addendum:<br />
<br />
I mentioned <a href="http://nixliving.blogspot.com/2010/03/workaround-for-broken-ubuntu-suspend.html">previously </a>that Ubuntu 9.10 tended to have problems trying to suspend my Toshiba Satellite A200 laptop. I'm happy to report that Ubuntu 10.04 does not have such problems.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com2tag:blogger.com,1999:blog-6991642647631426552.post-2284367166425776242010-04-26T20:14:00.002-04:002010-04-26T20:17:33.924-04:00My Review of SimplyMEPIS 8.5 and Xubuntu 10.04 RCI am soon going to be getting a perfectly functional laptop from my older brother that has a broken screen. I want to use this laptop strictly as an easy-to-use home server computer, and so I will mostly be using it by logging into it from other computers (hence why I don't care that the screen is broken). After the laptop was promised to me, I began looking for a debian-based distribution that would perhaps be a bit lighter on resources (and still easy to use) than Ubuntu. I've so far tried out <a href="http://distrowatch.com/table.php?distribution=mepis">SimplyMEPIS 8.5</a> and <a href="http://distrowatch.com/table.php?distribution=xubuntu">Xubuntu 10.04 RC</a>. In both cases I downloaded the ISO archive containing the setup files and mounted each on my USB stick as a live usb using the wonderful <a href="http://unetbootin.sourceforge.net/">UNetbootin</a>.<br />
<br />
SimplyMEPIS was pretty easy/harmless to install. Once installed, I set about the task of learning the basics of getting around in its KDE 4.3.4 interface. Having used Ubuntu for almost a year now, I am very familiar with where things are when GNOME is the main graphical interface. Needless to say, KDE was very different for me. One thing that really impressed me was how <b>very</b> easy it was to set up samba network shares between my computer and my wife's computer. This was a difficult issue for me to get around in the past using Ubuntu, which I wrote about <a href="http://nixliving.blogspot.com/2009/12/permissions-samba-sharing-external-ntfs.html">earlier</a>. <br />
<br />
A few things that bothered me about SimplyMEPIS: 1) I don't know why but try as I might I could not get my HP Laserjet P1505 printer to work properly!! Whenever I tried to print something from any application, my printer would feed the paper through and not print anything on it. It was very weird; almost like my computer had established a connection to the printer but was not sending any print data to it. 2) The distro repositories that I was using weren't so fast. I looked for faster repos to use, but didn't find anything that impressed me like what I get in Ubuntu. In Ubuntu you always have the option in the <b>Software Sources</b> menu applet to select the best repository so that you get maximum download speed. Couple with the fact that there are many repositories that offer Ubuntu updates and you get a powerful combination. 3) Okay this is a very superficial reason, but KDE makes linux too Windows-y! No more comments on this point, hehe.<br />
<br />
Like SimplyMEPIS, Xubuntu was pretty easy/harmless to install. Once installed, I noticed that the Xfce interface is laid out very similarly to the GNOME interface. It's definitely a biasing factor, as it means there is less to learn. Once I set up my <b>/etc/fstab</b> and my <b>/etc/samba/smb.conf</b> files to be the equivalent of the same file on my Ubuntu installation, I learned that all I had to do to set up shares from my wife's computer on my own is a quick terminal command, <span style="color: green;">smbmount //servername/sharename /mountdirectory</span>. When using Ubuntu, this would normally be done through GNOME's Nautilus file browser.<br />
<br />
In Xfce, there doesn't seem to be native network share browsing, necessitating a move to the command line for setting up your desired network share mounts. According to a post in <a href="http://ubuntuforums.org/showthread.php?t=255872">Ubuntu Forums</a>, you can modify your <b>/etc/fstab</b> file so that the network share you want access to is automatically initialized when your computer starts up. Just type in the following line (making the appropriate replacements for your situation): <span style="color: green;">//servername/sharename /mountdirectory smbfs username=windowsuserename,password=windowspassword 0 0</span>.<br />
<br />
Finding out that Xubuntu doesn't allow easy GUI driven network browsing was a bit of a disappointment, but there are still a few things that make me believe it's the best choice of the two: 1) The Xfce interface is <b>really</b> nice, clean, and simple looking. Navigating through GUI elements was remarkably simple. 2) It comes with the ease of updating using the fast, expansive Ubuntu repositories. 3) Functionality in general using Xubuntu was indeed pretty fast and lightweight.<br />
<br />
So, it looks like I'll be installing Xubuntu on my brother's laptop with the broken screen. It will be a good use of his laptop, which will as a consequence see more years than my brother ever thought.<br />
<br />
If you think I should try out any other (light-weight and easy-to-use) operating system before I get this new-old laptop, tell me your opinion!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com2tag:blogger.com,1999:blog-6991642647631426552.post-80829939961587326422010-03-17T21:20:00.002-04:002010-03-17T21:21:27.445-04:00Get your Android Phone and Thunderbird in Ubuntu to work with MS ExchangeI recently got full time employment in an organization that depends on Microsoft Exchange for all of its email and scheduling needs. So, something that I investigated as soon as I could was how I could get my Rogers HTC Dream (a.k.a. the T-Mobile G1) and my Ubuntu Linux Laptop to connect to my new employer's MS Exchange server to receive and send emails, and to do my scheduling.<br />
<br />
I was <b>delightfully</b> impressed with how <b>incredibly</b> easy it was to set up my new MS Exchange-based email account on my HTC dream. I just navigated to the <b>Data Synchronization</b> submenu in my phone's settings menu, clicked on "Microsoft Exchange", entered in my new email address and my password, waited while it communicated with the server, and then <b>voila</b> it finished!<br />
<br />
Unfortunately it was not that easy on Ubuntu! It took me a week before I found any answers on the internet, but I finally got my MS Exchange email and calendar account set-up in Thunderbird. I first tried to use Ubuntu's pre-installed Evolution Mail to connect to MS Exchange, but alas it didn't work.<br />
<br />
The solution came in the form of a <b>Gateway</b> program called <a href="http://sourceforge.net/projects/davmail/files/davmail/3.6.4/davmail_3.6.4-954-1_all.deb/download">DavMail</a>. The principle of this program is that it mediates a (POP3/IMAP/Caldav) connection between your email client and the MS Exchange server in a way that makes both parties happy. Although I haven't tried this with a program other than Thunderbird, it should in theory work alright.<br />
<br />
Once you've downloaded and installed DavMail using the link above, make sure that you have Sun Java version 6 installed. To do so, type in <span style="color: green;">sudo apt-get install sun-java6-bin</span>. After you're finished, start up DavMail by navigating through the following Gnome menu items: <b>Applications > Internet > Davmail</b>. A yellow circular icon will appear in the Gnome system tray indicating that DavMail has started up. Right-click on that icon, then click on settings, and then input your organizations <b>Outlook Web Access</b> (OWA) address. It may be something like <i>https://mail.domain.org/owa</i>. Take note of the local ports that it's opening up for various services (e.g. POP3/IMAP/Caldav) to see what ports your programs will need to use to access those services.<br />
<br />
The next step for me was enabling IMAP access to my MS Exchange email. You can choose POP3 if you like, but IMAP will ensure that you have access to all the email folders that you regularly access at work. The DavMail folks already set up a nice tutorial on how to set-up Thunderbird with IMAP, so go through the steps <a href="http://davmail.sourceforge.net/thunderbirdimapmailsetup.html">they've already posted</a> (warning, their screenshots are in French. This shouldn't be a problem though, as their instructions are in English!). Once you've completed those steps, go into your Thunderbird Account Settings for your new account and make sure that the port number it uses for accessing your email through IMAP is the same as the DavMail setting (the default is <b>1143</b>).<br />
<br />
Next item of business is to set up your MS Exchange calendar through Thunderbird's Lightning extension. Again, the DavMail folks have covered the steps to do these so do <a href="http://davmail.sourceforge.net/thunderbirdcalendarsetup.html">read what they've posted</a>. Now you should have access to your email and calendar from Thunderbird at home!<br />
<br />
The caveat to all of this is that, as a Gateway program, DavMail has to be running for you to communicate with your employer's MS Exchange server. So, be sure to start up DavMail if you want to check your MS Exchange email/calendar. It would be nice if this functionality was native in Thunderbird, but oh well. At least these steps allow you to use Thunderbird at all!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com4tag:blogger.com,1999:blog-6991642647631426552.post-14937766532523473892010-03-06T20:03:00.002-05:002010-03-06T20:06:25.849-05:00Workaround for broken Ubuntu Suspend functionality in your Toshiba SatelliteLately I've been noticing that my Toshiba Satellite A200 Laptop, on which I'm running Ubuntu 9.10, simply won't go into Suspend-mode properly. I did some googling and found out that there's an alternative program you can download to put your computer in suspend mode called <a href="http://powersave.sourceforge.net/powersave/index.html">Powersave</a>. Its use is remarkably easy and I'm happy to report that it is managing to put my laptop in suspend when the regular suspend in Ubuntu can not manage.<br />
<br />
<b>Usage</b><br />
<br />
Go into your terminal and type in: <span style="color: green;">powersave -u</span>. That's it!! It is also technically supposed to be able to put your computer in hibernate by typing in <span style="color: green;">powersave -U</span>, but it simply doesn't work on my computer for some reason.<br />
<br />
<b>Installation</b><br />
<br />
If you are having similar problems as I am and want to install this program, either go to <b>Synaptic Package Manager</b> and look for and install <b>powersaved</b>, or go to your terminal and type in <span style="color: green;">sudo apt-get install powersaved</span>. You can make it even easier on yourself by creating a shell script containing the powersave command with the suspend argument. Simply navigate in Nautilus to the directory where you want to create your shell script, right click on the background of that directory's window, click on <b>Create Document > Empty File</b>, and then add the following into the empty document:<br />
<div style="color: #38761d;"><br />
</div><div style="color: #38761d;">#! /bin/bash</div><div style="color: #38761d;"><br />
</div><div style="color: #38761d;">powersave -u</div><br />
When you're done, save it with a filename such as <b>suspend.sh</b>, and then create a launcher that activates your script. I right-clicked on my upper Gnome-Panel and clicked on <b>Add To Panel... > Custom Application Launcher</b>, entered in "Suspend" in the name field, <b>sh /home/inkhorn/Scripts/suspend.sh</b> in the command field, and chose a custom icon to represent the launcher on my panel. <br />
<br />
Now all I have to do is click on my newly created launcher button on my Gnome-Panel and my computer goes into Suspend mode like it should! You of course don't need to go through the trouble to make a button for this on your Gnome-Panel like I have, but it certainly saves typing in the long run.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com7tag:blogger.com,1999:blog-6991642647631426552.post-84616414434740375282010-02-25T22:22:00.003-05:002010-02-25T22:26:45.981-05:00Block image and flash-based advertisements in FirefoxOne of my biggest pet peeves about browsing through my daily regimen of websites is the advertisements that I come across. Usually they are something about "getting ripped" in 3 weeks or whitening your teeth. I'm not the kind of person who can just ignore things like that so easily, so anything that takes away those annoying advertisements is like candy to me. Enter in Firefox's native image-blocking abilities, and <a href="https://addons.mozilla.org/en-US/firefox/addon/433">Flashblock</a>. Behold the following screenshot of a web-site and look at all the wonderful, advertisement-free white-space:<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKi1p7NVpPU1xAD7z_dzdenoXwDw53yv7avU05ZuBMyIR5sALh5o_ck6zOE9uLkVGJhNhT0vttZDTUBpg15MN86KKupX4J-8PT_XzJmWDz4HYi1dX07wuX7Ensn059rIjleuLkIgvEVEI/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKi1p7NVpPU1xAD7z_dzdenoXwDw53yv7avU05ZuBMyIR5sALh5o_ck6zOE9uLkVGJhNhT0vttZDTUBpg15MN86KKupX4J-8PT_XzJmWDz4HYi1dX07wuX7Ensn059rIjleuLkIgvEVEI/" width="90%" /></a></center><br />
The lack of stuff to fill in the white-space may scream out at you, but it's a huge relief to me. With Firefox and Flashblock, locking image-based or flash-based advertisements is a cinch! For image-based advertisements, all you have to do is right click on the image, and then click on <b>Block images from ...</b> and you're set. For flash-based advertisements, Flashblock basically turns all instances of Flash on websites into buttons that you can click on if the Flash is a functional part of the website. If you want to get rid of the button altogether, all you have to do is right click on it and then click on <b>Remove Flash</b>.<br />
<br />
<center><img align="middle" border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU8qFCp-H7mgHj9NnouYycCZLYlKLlvB3KHMA5M8At7NQAaBP4JJojrj5jwdhhZg-RtxVLMX6Oa87835QK8BkK3JhzG6uawKB-LS5bIcrtDtAimSBIctCjmyRwCuT4ORfmBTh9sp95qHE/" width="222" /></center><br />
That's all! Enjoy surfing with no advertisements :)Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0tag:blogger.com,1999:blog-6991642647631426552.post-51416139850534811802010-02-23T20:49:00.002-05:002010-02-23T20:52:26.860-05:00Wireless just works better with WICD than Gnome Network ManagerAs I mentioned in my post about getting Ubuntu to <a href="http://nixliving.blogspot.com/2010/02/start-your-wireless-connection-on-boot.html">start your wireless connection before login</a>, <b>Gnome Network Manager</b> has to be uninstalled so that Ubuntu will rely on your <b>/etc/network/interfaces</b> file to start up your wireless connection. This worked great for me and my Ubuntu laptop until I started having to take my laptop away from home and use other wireless networks. In order to connect to other wireless networks, I would have to set my <b>/etc/network/interfaces</b> file so that my wlan0 interface relied on dhcp instead of static settings. I would then have to re-initialize my networking settings and then use the command-line to scan for dhcp requests on my wireless interface. This was no good!<br />
<br />
To remedy the situation, I discovered another graphical network manager called <a href="http://wicd.sourceforge.net/">WICD</a>. The version in the Ubuntu repositories was actually a bit buggy, so I went directly to the <a href="https://launchpad.net/wicd">WICD launchpad website</a> and downloaded the <a href="http://launchpad.net/wicd/1.7/1.7.0/+download/wicd-1.7.0.tar.gz">latest release</a> (version 1.7.0). I've tested it out at home and away and I can now say that it works quite nicely. WICD allows Ubuntu to start up my wireless connection before the Login screen. It also allows me to connect to other wireless networks despite the settings in my <b>/etc/network/interfaces</b> file.<br />
<br />
<br />
<center><img align="middle" border="0" height="60" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjydATyPaWE3AU3xOQqwNDpY051RmQy-_6al3I1QbEk8Hrp90fmua3XSNB2L5_w1GHhKQMsaORJCIQVLVQ7teU8o_8s0ZigjVGCuF-_bNwiwb9b4VzhOcZnvm5qt2VaHItp2yMt41VWZ9Q/" width="278" /></center><br />
As you can see above, WICD puts an icon in your system tray with a green indicator bar that tells you how good your signal is. If you hover your mouse over the icon it tells you what network you're connected to, what percentage signal strength you have, and what your IP address is.<br />
<br />
<br />
<center><img align="middle" border="0" height="645" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmT1LqhTRyqgQutHzlV4Zx5G9TjFJ-fu4Ly60IIB8htipPtiQlQ6n_8BAMtomBNnkP3EllIjeKXuCR6trSzxYivj1C_JmjiD8wJ-TyVHak_vUNPOEL2UQs4tFYh-GE_pHpnAl8DexP0c8/" width="538" /></center><br />
Above is the window that pops up when you left click on the WICD icon in the system tray. As you can see, the window contains information about all available wireless network SSIDs in your vicinity, how strong the signal is to those networks, and what type of encryption (if any) protects each network. You can click on the properties button for any network that you want to connect to if you have to put in a wireless encryption key. The screen that pops up follows<br />
<br />
<br />
<center><img align="middle" border="0" height="626" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7GPaYP7FoitFlyAlIpnZAooJLnjAwLaOGNH_lAS_bcjpcyPCuJ5tmdAMVeySPeNL0kkWtAzVWlJ8PeD0fLRSjv0u8raBTKmFzwgyM_227O3uSg1EWOmFERs0OsZA2zzNqhoqXaeJaltE/" width="425" /></center><br />
Once you're ready, you can click on the <b>Connect</b> button and you're on your way!<br />
<br />
<b>Setting Up WICD</b><br />
<br />
As I mentioned above, I first installed WICD from the Ubuntu Repositories. I think this forced my computer to install all the appropriate dependencies so that the newer version could work. When you download the <a href="http://launchpad.net/wicd/1.7/1.7.0/+download/wicd-1.7.0.tar.gz">newer version</a>, extract it to whatever directory you want. Then, open up your terminal, navigate to the directory with the WICD setup files that you just extracted, and type in <span style="color: green;">sudo python setup.py install</span>. Now, when you restart your computer, you should see WICD in your system tray ready to do your bidding.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com3tag:blogger.com,1999:blog-6991642647631426552.post-89681986465682644532010-02-11T20:11:00.002-05:002010-02-11T20:14:21.461-05:00Install OpenOffice 3.2 in Ubuntu!Today I checked the <a href="http://www.openoffice.org/">openoffice.org website</a> to see if OO 3.2 was released yet. I discovered it was, and decided to download and try to install it. I think this is the first time that I've tried to completely remove one installation of OpenOffice in Ubuntu and install another. If you'd like to do the same and check out the new OpenOffice, here are the steps I used:<br />
<ol><li>Choose a <a href="http://distribution.openoffice.org/mirrors/#mirrors">mirror site</a> to download an Archive containing the appropriate OpenOffice.org installation for your system</li>
<li>Once you've downloaded the archive, extract it to your directory of choice</li>
<li>Navigate to that directory in your terminal</li>
<li>Now, remove all packages in your system associated with OpenOffice by typing in <span style="color: green;">sudo apt-get remove openoffice*</span>. For some reason this removed <b>alpine</b> from my system. It was easy enough to reinstall alpine and I discovered that none of my settings were lost. Do take note of what your system removes using the previous command</li>
<li>Now, navigate to the <b>DEBS</b> subfolder of your openoffice setup directory</li>
<li>Install all openoffice packages by typing in <span style="color: green;">sudo dpkg -i --force-overwrite *deb</span></li>
<li>Finally, navigate to the <b>dekstop-integration</b> subfolder of the <b>DEBS</b> directory and type in <span style="color: green;">sudo dpkg -i --force-overwrite *deb</span></li>
</ol>Now you will have the new stable OpenOffice Suite version 3.2 installed on your Ubuntu system!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com1tag:blogger.com,1999:blog-6991642647631426552.post-29562543873379284982010-02-09T09:02:00.003-05:002010-02-11T22:26:33.659-05:00Start your wireless connection before Ubuntu loginRecently I started asking myself how I could get Ubuntu to forge its wireless connection (with WEP encryption) to my router without having to log-in through the GUI. I noticed that the default way of logging in through the GUI and then having a wireless connection available was limiting for two reasons: (1) If I wanted to be able to connect to my openSSH server then I needed to be logged in, and (2) If there was something wrong with the GUI and I had to log-in through the command line then I wouldn't have internet access.<br />
<br />
So I started looking around on the net. Most pages that I found showed messageboard threads suggesting modifications to the <b>/etc/network/interfaces</b> file. This is the file that is supposed to tell your Linux system what to do with your network interfaces at boot-up. I tried to modify it so that my wireless card would start-up with a static IP at boot-up, but no matter how I changed this file, nothing worked.<br />
<br />
Finally, I decided to <a href="http://ubuntuforums.org/showthread.php?t=1401075">ask a question on ubuntuforums</a>. I found out that <b>Gnome Network Manager</b>, the program in Ubuntu which manages all your wired and wireless network connections, works terribly with the settings in the <b>/etc/network/interfaces</b> file. In other words, if you want Ubuntu to start your wireless connection at bootup instead of after login, you have to get rid of Gnome Network Manager!<br />
<br />
So, on the advice of <i>chili555</i> from ubuntuforums, I got rid of Gnome Network Manager by typing in <span style="color: green;">sudo apt-get remove --purge network-manager</span> and modified my <b>/etc/network/interfaces</b> file to look like the following (SSID and WEP key changed for privacy):<br />
<br />
<span style="color: blue;">auto lo<br />
iface lo inet loopback<br />
<br />
auto wlan0<br />
iface wlan0 inet static<br />
address 192.168.2.11<br />
netmask 255.255.255.0<br />
gateway 192.168.2.1<br />
wireless-essid MYSSID<br />
wireless-key 12345678912345678912345678<br />
<br />
iface eth0 inet dhcp</span><br />
<br />
Now, every time I start my computer, my wireless connection is available before login so that I can login to my openSSH server or go to the command-line without logging in to the GUI!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com21tag:blogger.com,1999:blog-6991642647631426552.post-39958601055579125262010-02-04T11:03:00.003-05:002010-02-04T11:06:22.754-05:00Alpine, Gmail, and SSH. How to make your computer send emails when you're not there!<div xmlns="http://www.w3.org/1999/xhtml">Out of the many things I've learned in the past half year about using Linux, I find the concept of remote access of my computer through SSH to be the coolest. Periodically I will be away from home, and I'll realize that I need access to some file on my computer so that I can send it to someone. I recently learned how to set up a <span style="font-weight: bold;">Secure Shell Server</span> on my Ubuntu Linux laptop that I can access from my Android cell phone using an Android app called <a href="http://code.google.com/p/connectbot/" target="_blank">ConnectBot</a>. Once I get into my computer, I can then open up a fantastic text-mode email program called <a href="http://staff.washington.edu/chappa/alpine/alpine-info/" target="_blank">Alpine</a> and compose emails with files attached right from my computer's hard drive and then send them through my Gmail account. Nothing makes me feel more like a huge nerd than this!<br />
<br />
Here's how I set up an SSH server and then install Alpine with access to my Gmail account (my Gmail is setup to check and respond from 2 additional email addresses, so the instructions are tailored to that scenario):<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">Setting up openSSH<br />
<br />
</span></div>First you need to install the openSSH server. Easily enough you just have to type in <span style="color: #33cc00;">sudo apt-get install openssh-server <span style="color: black;">into your terminal to get the server. Amazingly, it's ready right away to be used! </span></span> I wanted the SSH server to use a different port than the default (port 22), so I opened up <span style="font-weight: bold;">/etc/ssh/sshd_config </span>and changed the port number on the 5th line to something that was wacky enough not to be predictable.<br />
<br />
Next came two considerations: (1) I'm behind a router, and therefore needed to set-up port forwarding so that I'd be able to access my openSSH server remotely. If you have a router and forget this step then prepare for lots of frustration! (2) Even having port-forwarding set-up, who wants to remember and type in an IP address so that you can connect to your server? So I needed to sign up for a free dynamic hosting service that would give me a constant host name regardless of my IP address.<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">Setting up Dynamic DNS hosting<br />
<br />
</span></div>I found a great tutorial on the Ubuntu Help Site for setting up <a href="https://help.ubuntu.com/community/DynamicDNS" target="_blank">Dynamic DNS hosting</a> for your computer. Basically, I went to <a href="http://www.dyndns.com/" target="_blank">DynDNS</a>, set-up an account for my computer, and then followed the instructions on the above-mentioned <a href="https://help.ubuntu.com/community/DynamicDNS" target="_blank">Ubuntu Help Site</a> to install and configure <span style="font-weight: bold;">ddclient</span>. ddclient will periodically send updates to DynDNS so that the hostname they provide you with always points to your IP address. When you're done configuring all of this, you will then have a host-name pointing to your computer such as tommy.gotdns.com. That's a lot easier to remember than 40.831.391.33 right?<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">Initial installation and set-up of Alpine<br />
<br />
</span></div>Next I set-up Alpine. Installing it was easy enough: <span style="color: #33cc00;">sudo apt-get install alpine<span style="color: black;">. </span></span>Once it's installed, you have to set it up to work with your Gmail account. Refer to <a href="https://www.cs.virginia.edu/%7Ecsadmin/wiki/index.php/Setting_up_Pine_%28Alpine%29_for_IMAP_Gmail" target="_blank">this tutorial</a> from the University of Virginia for a tutorial on how to do that. Be sure that when you're in the <span style="font-weight: bold;">Config </span>screen of Alpine, look for the field named <span style="font-weight: bold;">Inbox Path</span> and enter in the following: <span style="color: #33cc00;">imap.gmail.com/ssl/user=username@gmail.com</span> . Be sure to replace 'username' with your own Gmail account username. This will make sure that when you start-up Alpine and go into your Message Index, you will see the emails in your Gmail Inbox right away, instead of having to navigate to that inbox.<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">Configuring Alpine to send emails using different 'From' email addresses</span><br />
<br />
</div>Now, when I reply to emails that I've picked up using my Gmail account, I usually want to reply using different email accounts. When you're only using the web-based Gmail checker, it allows you to respond using the account that the email was downloaded from. I wanted to have that same functionality in Alpine. This is where the Alpine concept of a <span style="font-weight: bold;">Role </span>comes in handy. From the main screen of alpine, type the following keys (don't type the triangular brackets): <span style="font-weight: bold;">S > R > R > A</span> . This will bring you to a screen that allows you to set-up the conditions under which Alpine will let you send an email using a different <span style="font-weight: bold;">From </span>email address. <br />
<br />
First, set a nickname up for your role; maybe the name of your email provider (i.e. Sympatico). Next, under <span style="font-weight: bold;">Current Message Conditions</span> and beside <span style="font-weight: bold;">To Pattern</span> put one of the (or the only) email address(es) that Gmail is checking for you (e.g. bill@sympatico.ca). This creates an expectation that whenever this email address is in the the <span style="font-weight: bold;">To </span>field of an email, Alpine will do whatever you tell it in your role.<br />
<br />
Then, under <span style="font-weight: bold;">Actions Begin Here</span> and beside <span style="font-weight: bold;">Set From</span> put your name and then email address that Gmail is checking for you (e.g. Bill Nye <bill@sympatico.ca>).<br />
<br />
Finally, under <span style="font-weight: bold;">Uses Begin Here </span>you need to make the following changes (if necessary): (1) Under <span style="font-weight: bold;">Reply Use =</span> make sure to highlight and press enter on <span style="font-weight: bold;">Without Confirmation</span> and (2) Under <span style="font-weight: bold;">Compose Use =</span> make sure to highlight and press enter on <span style="font-weight: bold;">With Confirmation</span>. This will make it so that if someone emails you at bill@sympatico.ca, when you reply to that email, Alpine will automatically put bill@sypmpatico.ca in the <span style="font-weight: bold;">From </span>email address and not bill@gmail.com.<br />
<br />
When you're done, you can press <span style="font-weight: bold;">E </span>to exit the Role set-up. If you check two email accounts through Gmail like me, press <span style="font-weight: bold;">A </span>once more when you're in the <span style="font-weight: bold;">Setup Role Rules </span>screen in alpine and repeat the above instructions to set-up a role for your other email account.<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">Saving your Gmail password in Alpine so that it doesn't prompt you all the time<br />
<br />
</span></div>Finally, you'll probably be annoyed with entering in your Gmail password every time you start up Alpine. Thanks to a helpful user on <a href="http://ubuntuforums.org/showthread.php?t=710101" target="_blank">Ubuntu Forums</a>, I found out a simple way of making Alpine save your password. Open up your terminal, change directories to your home directory, <span style="color: #33cc00;">cd ~/<span style="color: black;">, and then type in </span><span style="color: #33cc00;">touch .pine-passfile<span style="color: black;">. After that, run Alpine. It will ask you for your password on start-up, and on sending an email, only to save your password indefinitely so that you no longer have to type in your password all the time.<br />
<b> </b></span></span></span><br />
<span style="color: #33cc00;"><span style="color: #33cc00;"><span style="color: black;"><b> </b> </span></span></span><br />
<div style="text-align: center;"><span style="color: #33cc00;"><span style="color: black;"><b>Conclusion</b></span></span><br />
<span style="color: #33cc00;"><span style="color: black;"><br />
</span></span><br />
<div style="text-align: left;"><div style="color: black;">Wow, those were a lot of very little steps which, put together, seem mountainous. However, now I can punch in my dynamic DNS hostname into ConnectBot on my Android cell phone, access Alpine and send emails with files attached right from my computer's hard drive! I also like that I can update my databases on the fly with important personal info, manage, and even turn my computer off from afar. It's quite neat and if you're into feeling nerdy, I highly recommend getting your own openssh server configuration.</div><span style="color: #33cc00;"><span style="font-weight: bold;"><span style="font-weight: bold;"></span></span></span></div><span style="color: #33cc00;"><span style="font-weight: bold;"><span style="color: #33cc00;"><span style="color: #33cc00;"><span style="color: black;"></span></span></span></span></span></div></div>Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com38tag:blogger.com,1999:blog-6991642647631426552.post-90208390124587937332010-01-28T21:43:00.002-05:002010-01-28T21:47:12.991-05:00Making Numeric Row Identifiers in PostgreSQLAround a month ago I started to learn how to use <a href="http://www.postgresql.org/">PostgreSQL</a> to create, maintain, and query databases. It wasn't hard to find things in my personal life that were appropriate for databasing: Job applications, Hydroelectricity usage/charges, usernames and passwords. Putting data from these aspects of my life into databases has given me some great practice using a query language. <br />
<br />
The thing about databasing that really trips me up is the concept of indexing. Depending on how you query (search) your database, any one record (row) in your database could show up in the 11th, 27th, 1st or 99th row of your query results. Hence, trying to access the record in which you stored your facebook username and password by its absolute row number just won't work. That's a concept for Python and not PostgreSQL (please correct me if I'm wrong!). What you can do however is assign each of your database records a unique numerical identifier and so any time you need to modify a single row, you can refer to it by its identifier no matter what the content in the other fields of that record.<br />
<br />
What I wish I knew when I made my database is that it is REALLY easy to create a type of column in your table that automatically assigns unique numerical identifiers to your records when you insert new values into the table. When you're making the table in your database, declare your id column as type SERIAL. Then when inserting new values into your table, all you have to do is enter the word <b>DEFAULT</b> in place of a number that you would come up with yourself. The number id in the SERIAL column type seems to start at 1 by default, obviously incrementing by 1. Nice and simple. Following is an example:<br />
<br />
<span style="color: green;">CREATE TABLE test (<br />
blah SERIAL<br />
yadda varchar(50)<br />
);<br />
INSERT INTO test VALUES(DEFAULT, 'hello');<br />
INSERT INTO test VALUES(DEFAULT, 'goodbye');<br />
<br />
SELECT * FROM test;<br />
blah | yadda <br />
------+---------<br />
1 | hello<br />
2 | goodbye<br />
(2 rows)</span><br />
<br />
<br />
In my situation, I didn't seem to be able to make a SERIAL column for my existing table, or convert a column I already had. So, I needed a way of generating unique numerical identifiers after 100 records had already been inputted. I found two solutions (if there are others, please tell) to work for me. First the easy solution:<br />
<br />
<span style="color: green;">ALTER TABLE <i>tablename</i> SET WITH OIDS;</span><br />
<br />
OIDS stands for <b>Object Identifiers</b>. When you use the above statement, PostgreSQL assigns a unique numerical identifier to each row in your table. This solution didn't look as clean to me as the scenario where the SERIAL type column was made when the table was made. The raw value that the OIDS in my table start at 16522, which is a little weird. I think this might be due to data that I have in other databases on my computer, but I can't be sure right now. The bonus is that the OIDS seem to have been assigned roughly according to the order in which I inputted these records into the table in my database. Thus it's a simple solution and allows me to refer to any one record by a simple unique identifier. I've read that the raw value of these OIDS will wrap around to something very small after you reach about 4 billion records. I don't feel in danger of that using PostgreSQL for personal matters though!<br />
<br />
The next solution was more difficult, but gave me nicer results. First you need to figure out how you want to order the records in your database. I wanted to order them by date, so let's call my record dating column <b>rdate</b>. Unfortunately, many records were inputted on the same date, which means if I only relied on the date for ordering, I would get many records having the same numerical index. So, you have to take advantage of as many additional fields in your table that will make your record unique, and ensure that the following process results in as many different numerical identifiers as there are records. Let's say that in addition to specifying <b>rdate</b> as your ordering column, you also specify columns <b>yadda,</b> and <b> blah</b>. Also, your id variable is simply named <b>id</b>. You would then define the following function in PostgreSQL (my reference for this function comes from a <a href="http://archives.postgresql.org/pgsql-sql/2005-04/msg00379.php">pgsql mailing list posting</a>):<br />
<br />
<span style="color: green;">CREATE OR REPLACE FUNCTION reorder_table() RETURNS INTEGER AS '<br />
<br />
DECLARE<br />
newcode INTEGER ;<br />
table_record RECORD ;<br />
<br />
BEGIN<br />
newcode := 1 ;<br />
<br />
FOR tablerecord IN SELECT * FROM tablename ORDER BY rdate LOOP<br />
<br />
UPDATE tablename SET id = newcode<br />
WHERE rdate = table_record.rdate AND yadda = table_record.yadda AND blah = table_record.blah;<br />
<br />
newcode := newcode + 1 ;<br />
<br />
END LOOP ;<br />
<br />
RETURN 1;<br />
END;<br />
' LANGUAGE plpgsql;</span><br />
<br />
Once you've entered this in, all you have to do is call your function through a simple statement: <span style="color: green;">SELECT reorder_table();</span>. If your inclusion of <b>yadda</b> and <b>blah</b> made each record in your table unique enough, then you will now have numerical identifiers ranging from 1 to the total number of records in your table! Of course if you want your numerical identifiers to be assigned according to the order of a different column in your table, replace <b>rdate</b> in the <b>SELECT</b> statement in the above function with the column name that you want as your ordering column. <br />
<br />
What I like about using the OIDS in my situation is that the identifers are automatically generated, whereas I would need to run the above function every time I update the table in my database in order that every record has an identifier. Suffice it to say that in the future, I will create a SERIAL type column next time I need identifiers like this!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0tag:blogger.com,1999:blog-6991642647631426552.post-48907175024797770082010-01-27T09:56:00.002-05:002010-01-27T09:58:12.984-05:00Update your Rogers HTC Dream from UbuntuAs with everybody else who owns an HTC dream/magic from Rogers, I recently started to get pestered to apply a software update to my phone so that I could safely call 911 and still be able to use my data plan. Most times I'm a pretty lazy person, and so I only got around to doing this AFTER Rogers took my data connection away from my phone. When I looked into it at first, it looked like the phone update could only be done using Windows software. Well that's a big problem for me because, as you know, I only use Ubuntu Linux on my computer!<br />
<br />
I ended up speaking with a Rogers representative on the phone and asked her what Mac users are doing about this software update, thinking that the solution for them might be good for me too. It turns out it was, and now my phone is updated and back to full functionality. Of course all the programs I previously downloaded to the phone from the Market are gone, but I don't care much. Here is what you need to do to update your phone without HTC's annoying Windows software:<br />
<br />
1. First you have to download a zip file containing the update (just a single file really, <a href="http://downloads.rogers.com/wireless/hardware/andy/stuff/HTC_Dream_Update.zip">click here for the file</a>).<br />
<br />
2. Connect the HTC dream to your linux machine via USB, pull down the notification area, press your finger on the <b>USB connected</b> notification, and press <b>Mount</b>.<br />
<br />
3. Now you'll see a notification that you've connected a media device on Ubuntu (or whatever other graphical form of linux you use). Tell your computer to open up the folder of the connected device.<br />
<br />
4. Extract the contents of the zip file you downloaded in step 1 to the root of your HTC dream's microSD card.<br />
<br />
5. Now turn off your HTC dream.<br />
<br />
6. Once your HTC dream is off, press and hold 2 buttons together: the Camera button and the Power button.<br />
<br />
7. After a few moments your HTC dream's screen should show something similar to the picture below. When you see that on your screen, press the trackball (Action) button.<br />
<br />
<img align="middle" border="0" height="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Rezd1_RUq6K3treKd2eEg6RZQi1sicNo7L-E-jsKnMojC_XLRoIK5-HULm6iWqC7QAQ0H7gwv4Jql1O8BQ5GWwE0Z7mXiq7LMlTosPbhPyHW5Ydgpxqc3R0ynZ1EnEwCD1OAXpQCzWQ/" width="375" /><br />
<br />
8. When the HTC dream tells you that it's finished, it will ask you to press the Action button to reboot. Press the trackball when that happens and you're done!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com1tag:blogger.com,1999:blog-6991642647631426552.post-18994035247988098922010-01-24T19:15:00.009-05:002010-01-28T21:48:21.487-05:00Pylab, R, and QtiPlot Plotting ComparedToday I want to compare and contrast the plotting of statistical graphics in three very neat software packages freely available: <br />
<ul><li><a href="http://matplotlib.sourceforge.net/">Pylab</a> via <a href="http://ipython.scipy.org/moin/">Ipython</a></li>
<li>The <a href="http://cran.r-project.org/">R Statistical Computing Environment</a> and</li>
<li><a href="http://soft.proindependent.com/qtiplot.html">QtiPlot</a></li>
</ul>First we'll take a look at the raw table of numbers to be plotted, I'll show you the resultant plots, and finally I'll show you the code or steps necessary to get to those plots.<br />
<br />
<hr /><br />
<br />
<br />
<br />
<center><img align="middle" border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv4rii3zyrRIQ86tymdQusXUJi7JXACfTnj32XgvKlzJBqbM4q3jDonS9D9JuS-wCfDpoaUUHiiUMz9cGD3Ba1ArfVMQf982cbLg_yYxQbgx3Hst0ID7o0lPBkemz7Ieg4q1iOhjWVbNk/" width="307" /></center><br />
<br />
In the sample dataset above, I've included an "X Axis" column composed of 7 integers simply called X. I've also included two Y columns of means and two columns containing the <a href="http://en.wikipedia.org/wiki/Standard_error_%28statistics%29">Standard Errors</a> of the datasets from which those means came. My plotting aim was to create a plot containing two lines describing the two Y columns and error bars matching the values from the two Standard Error columns.<br />
<br />
<hr /><br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwfU1MYaY78MYx9Smc_v1f2HzYuZR8wvAACFZlNUAQ8Y1aUjX7vTl0onBTGNufgStLgla5IjqEESHXEPgrzXi0sO5INJyi85-oWYU8_-zbipS9uZx_ZhpvvWlu_zSCG3HqHrLph8dZtxc/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwfU1MYaY78MYx9Smc_v1f2HzYuZR8wvAACFZlNUAQ8Y1aUjX7vTl0onBTGNufgStLgla5IjqEESHXEPgrzXi0sO5INJyi85-oWYU8_-zbipS9uZx_ZhpvvWlu_zSCG3HqHrLph8dZtxc/" width="90%" /></a></center><center><i>Pylab plot</i></center><br />
<br />
<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfgkBUDFQvUVoqZ-_W1Lmms4Q6MWTqv1YVA4EHOqcRBIN_2SZF4FNjqoplPf3JmpumTbZmjBAUJa88ifXB0SaDWlYSSV2L4ys4iX8o58Zj4slu5Fr9_9ELa27uDK5wJo81FWovJ6fGtk/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfgkBUDFQvUVoqZ-_W1Lmms4Q6MWTqv1YVA4EHOqcRBIN_2SZF4FNjqoplPf3JmpumTbZmjBAUJa88ifXB0SaDWlYSSV2L4ys4iX8o58Zj4slu5Fr9_9ELa27uDK5wJo81FWovJ6fGtk/" width="90%" /></a></center><center><i>R plot</i></center><br />
<br />
<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbaas6TKRT7OBDyDY5_IF-VPCqhQ4EbgIylkEsT1JB5_G9096Si1RcithR_nRcyeTffpsBGdy4ezAypVMzOx77cRFjgWLebc-4-ArMb2aO4M3ipvsVAwlBJYQ6NeL23UwfebMR6Ca7IOc/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbaas6TKRT7OBDyDY5_IF-VPCqhQ4EbgIylkEsT1JB5_G9096Si1RcithR_nRcyeTffpsBGdy4ezAypVMzOx77cRFjgWLebc-4-ArMb2aO4M3ipvsVAwlBJYQ6NeL23UwfebMR6Ca7IOc/" width="90%" /></a></center><center><i>QtiPlot</i></center><br />
<hr /><br />
As you can see from the above plots, no one of these three software packages produces a bad looking plot. Some of the graphical parameters (such as font size, type of major axis ticks, whether or not a full box is drawn around the plotting area, and how far the plot title is from the top of the plotting area) are different from program to program, but that's more a matter of my unwillingness to get the programs to output exactly similar graphs than an inability in the programs themselves.<br />
<br />
<br />
<br />
<center><b>How I got the plots using Pylab and R</b></center><center><b> </b></center><br />
First and foremost is the fact that Pylab and R require you to type in some <b>code</b> to do your plotting whereas QtiPlot gives you a point-and-click <b>GUI interface</b> to complete the task. Pylab and R have their own idiosyncratic syntax for plotting, but thankfully neither requires much more code than the other. If you didn't know already, Pylab is a module of python and therefore allows you to seamlessly weave plotting commands into pure python code. It will therefore be advantageous for anyone who already has a Python background to use Pylab. Below I will show you the code I used to make the plots.<br />
<br />
<b>Pylab via IPython</b><br />
<ol><li>infile = open('/home/inkhorn/Documents/data.csv','rb')</li>
<li>data = loadtxt(infile, delimiter=',')</li>
<li>errorbar(data[:,0], data[:,1], yerr=data[:,2],color='b',ecolor='k',elinewidth=1,linewidth=3);</li>
<li>errorbar(data[:,0], data[:,3], yerr=data[:,4],color='r',ecolor='k',elinewidth=1,linewidth=3);</li>
<li>axis([-0.2, 6.2, .3, 1.0]);</li>
<li>xlabel('X Axis Label', fontsize=14);</li>
<li>ylabel('Y Axis Label',fontsize=14);</li>
<li>title('Line Plot with Error Bars',fontsize=16);</li>
</ol><br />
<b>R</b><br />
<ol><li>error.bar <- function(x, y, upper, lower=upper, length=0.1,...){ if(length(x) != length(y) | length(y) !=length(lower) | length(lower) != length(upper)) { stop("vectors are not the same length")} else { arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...)} }</li>
<li> data = read.csv('/home/inkhorn/Documents/data.csv')<br />
</li>
<li>png('/home/inkhorn/Desktop/test.png', height=1033, width=813, type=c("cairo"))<br />
</li>
<li>plot(data$y2 ~ data$x, type="l",col='red',lwd=4,ylim=c(.3,1),main='Line Plot with Error Bars', xlab="X Axis Label", ylab="Y Axis Label")<br />
</li>
<li>par(new=TRUE)<br />
</li>
<li>plot(data$y1 ~ data$x, type='l', col='blue', lwd=4, axes=FALSE,ylim=c(.3,1),ann=FALSE)<br />
</li>
<li>error.bar(data$x, data$y1, data$y1err)<br />
</li>
<li>error.bar(data$x, data$y2, data$y2err)<br />
</li>
<li>dev.off()</li>
</ol>R doesn't seem to come with installed with readymade functions that allow you to easily plot error bars in your statistical graphics, which is the reason for the function definition in the entry under the R code column above. Thanks for the coding of the R error bar function goes to the maintainer of a blog called <a href="http://monkeysuncle.stanford.edu/?p=485">monkey's uncle</a>. Some people complain about the strange syntax required when using R, but you can see that you really don't need that much more typing in R than you do when you're using Pylab via Ipython. Still, Pylab gets extra points for coming installed with a readymade errorbar function!<br />
<br />
<br />
<br />
<center><b>How I got the plot in QtiPlot</b></center><center><b> </b></center> QtiPlot follows a <b>very</b> similar concept as Excel. Namely, it provides table-space to enter in your data, allows you to make plots from your table data, gives you easy point-and-click access to manipulate each component of your graph, and lets you save data and plots together in one project file. To get to the plotting, first you have to click <b>File > Import ASCII ...</b>, which brings you to the screen shown below:<br />
<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi55UQlRTQoorN8gb1Hu-XgUsfi3n1nagLYZmOFBngiO6R62uonABeNVnGG7VuQk3YeJcr0BiGT28Nc1zx4xlECAiGfK7TWfU6F-sx2vbPaJai9NqItmqE6wlIxuKW1Mdt9Zp44RaUyTDE/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi55UQlRTQoorN8gb1Hu-XgUsfi3n1nagLYZmOFBngiO6R62uonABeNVnGG7VuQk3YeJcr0BiGT28Nc1zx4xlECAiGfK7TWfU6F-sx2vbPaJai9NqItmqE6wlIxuKW1Mdt9Zp44RaUyTDE/" width="90%" /></a></center><br />
<br />
You then choose your data to import, specify the <b>separator</b>, whether or not you want to ignore lines at the top, then press <b>OK</b>.<br />
<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IpnbZZSWp6LdddcCqgZYG6u27or4oJzexVkT1pmQlwHaocv_Apidwgxejyqrd0czJvuuLtYVVw69wiiIP1PRTiJFNxzXEDEMqlnKsqRCS6JyIFJRH_TSADFqK7r4an2cDyTL4EaOMaY/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IpnbZZSWp6LdddcCqgZYG6u27or4oJzexVkT1pmQlwHaocv_Apidwgxejyqrd0czJvuuLtYVVw69wiiIP1PRTiJFNxzXEDEMqlnKsqRCS6JyIFJRH_TSADFqK7r4an2cDyTL4EaOMaY/" width="90%" /></a></center><br />
<br />
You are then shown your data in a <b>Table view</b> and must now right click on the columns and set their <b>roles</b> as shown above. As you can see, your columns can represent X variables, Y variables, Y error variables, even 3rd dimension, or Z variables. When you're done setting your column roles, navigate to the <b>Plot</b> menu and click on <b>Line</b>, as shown below.<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipLI46gQUnSFsCIW7tAibEOreZSYRGu8l1Ha-Vd15sVeGVxLvL9MM_WP8atlGXxW2VXAfKlihyphenhyphenHvpEtZdLw0GNbwp4u9BXR8AclGPaESbcxp1kA7wdH-xUvV0qpnya36mTPG-u_ufitg8/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipLI46gQUnSFsCIW7tAibEOreZSYRGu8l1Ha-Vd15sVeGVxLvL9MM_WP8atlGXxW2VXAfKlihyphenhyphenHvpEtZdLw0GNbwp4u9BXR8AclGPaESbcxp1kA7wdH-xUvV0qpnya36mTPG-u_ufitg8/" width="90%" /></a></center><br />
<br />
A line plot will then be generated, using default values that you can change to your heart's content. The plot title and axis titles are <b>very</b> easy to change; all you have to do is double click on them and edit the default text that is already there. If you want to change any other aspect of the graph, it suffices to right-click on that part of the graph, and then click on <b>Properties</b>, such as what I did below with one of the lines on the graph.<br />
<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAxyzlm6wV4csOePrp3ULFn8r8cgKjVg103TnXQa_krn2gq5KGr10o9QhGvhRfW0-fNV3Kw6zH2ArcTuaEYi_WrDTnIt9NTdEqR9TrP-EBWaJYdte_nTAquUxYwL7bfWGwtrn7lO9Gqrg/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAxyzlm6wV4csOePrp3ULFn8r8cgKjVg103TnXQa_krn2gq5KGr10o9QhGvhRfW0-fNV3Kw6zH2ArcTuaEYi_WrDTnIt9NTdEqR9TrP-EBWaJYdte_nTAquUxYwL7bfWGwtrn7lO9Gqrg/" width="90%" /></a></center><br />
<br />
You can also modify how you want each of your axes to look by right clicking on the numbers of that axis and again clicking <b>Properties</b>. You can then change some general graphical properties of each axis, or change the way that the axis is scaled.<br />
<br />
<br />
<br />
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8W96bHaQ2Hk1JP4SG31ASZVhSbHhhnfmYaLN9sGUXDA-J9v2NWUeqH_ydsur0jaRx_QCfCDVoamaP7lF2ZDbdChVw-4vtScIIV-6bvTahfeMnSesVIjdR_hr0z88_a5ZO46KeQFA0sO0/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8W96bHaQ2Hk1JP4SG31ASZVhSbHhhnfmYaLN9sGUXDA-J9v2NWUeqH_ydsur0jaRx_QCfCDVoamaP7lF2ZDbdChVw-4vtScIIV-6bvTahfeMnSesVIjdR_hr0z88_a5ZO46KeQFA0sO0/" width="90%" /></a></center><center><i>Axis options</i></center><center><i> </i></center> <center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVrPw_nI03pXxf0jmVCDewhIJVrbzZ2miUNZQ-1iRrtHt1wl8wCXMgM9Gu9FsvMYDdOEIZDMCkDQplTccXOCu5BdfVAY2kGxhIK7YPAykEw8JEI9ryIJuFHm6LZXtHdY1bTJXADply_lA/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVrPw_nI03pXxf0jmVCDewhIJVrbzZ2miUNZQ-1iRrtHt1wl8wCXMgM9Gu9FsvMYDdOEIZDMCkDQplTccXOCu5BdfVAY2kGxhIK7YPAykEw8JEI9ryIJuFHm6LZXtHdY1bTJXADply_lA/" width="90%" /></a></center><center><i>Scale options</i></center><center><i> </i></center> Once you're finished specifying your graph's visual parameters, it's then easy as pie to save it. Click <b>File > Export Graph > Current</b>, then choose a folder to save your graph in, name it, then press <b>Save</b> and you're done!<br />
<br />
<br />
<br />
<center><b>Conclusion</b></center><center><b> </b></center> The truth of the matter is that you need to choose the right tool for the right job. I have often found that it was necessary for me to load data to be plotted into Ipython that I wouldn't have been able to read into R. IPython provides the opportunity for easy interactive plotting for simple one-graph projects, but can scale up to more complex programmatic plotting in larger projects. It hasn't been often that I've had to do larger scale projects where many plots are outputted programmatically, but IPython would certainly be the environment of choice for me.<br />
<br />
R has amazingly expansive plotting capabilities and certainly does not lose points on graphical quality. As you can see however, its syntax can be difficult to manage. I've used R for making summary plots of data that I also had to statistically analyze. Therein lies the ultimate use of R; it provides a single integrated environment for the plotting and analyzing of many different types of data.<br />
<br />
When it comes down to it, however, I am quite lazy. I only recently discovered QtiPlot, and I think it's great! According to the <a href="http://soft.proindependent.com/qtiplot.html">QtiPlot website</a>, it even provides an interface that allows you to script QtiPlot operations using Python. I don't know anything about that interface just yet, but it makes me very impressed with the program overall. Given my laziness, the quality of the plots that come out of QtiPlot, and the ease with which you can manipulate them, QtiPlot rates <b>very</b> highly in my books. I will surely be using it more in the future for plotting where the data is easily accessible and will highly recommend it to others.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com5tag:blogger.com,1999:blog-6991642647631426552.post-50190137598852052010-01-19T17:46:00.002-05:002010-01-19T17:48:47.265-05:00How to screw up then fix Gnome in Ubuntu!Yesterday I read about a supposedly nice-looking <a href="http://www.omgubuntu.co.uk/2010/01/nautilus-simple-install-ppa-streamlined.html">patched version of Nautilus</A> and decided to try it out. I installed it, used it for a few hours before bed, and realized that I really hadn't gained anything special by installing it. <br />
<br />
When I uninstalled it this morning, I really screwed up my installation of gnome. So much so that I simply couldn't log into ubuntu using the Gnome Display Manager (the meat and bones of the Ubuntu Grahpical User Interface). Thankfully, I still had access to the Virtual Console by pressing <strong>Control+Alt+F2</strong> at the login screen.<br />
<br />
One thing I learned is that I still don't know how to initialize an ethernet connection to my router/DSL modem to give me an internet connection from the command line. I know that you can set your ethernet interface's IP address by typing in <font color="green">sudo ifconfig eth0 address</font> and you can substitute <font color='green'>address</font> with <font color='green'>netmask address</font> to change the netmask (I think it's usually 255.255.255.0 on most consumer routers). That didn't work for me however. I also tried toying with the <strong>route</strong> command, but I really didn't understand how to work with that.<br />
<br />
What ended up saving me was a <a href="http://ubuntuforums.org/showthread.php?t=1091881">suggestion that I read on ubuntuforums.org</A>, in response to someone in a similar situation, that they should download an <a href="http://www.ubuntu.com/getubuntu/downloadmirrors#alternate">alternative ubuntu installation iso</A>, burn it to CD and use it as a source for package updates. I didn't end up burning it to CD. Rather, I did the following: <ol><li>downloaded it to my USB stick</li>
<li>mounted the ISO in a newly made separate directory directory (using the command <font color='green'>sudo mount -o loop ubuntu-9.10-alternate-i386.iso /media/testing</font>)</li>
<li>navigated to that directory (<font color='green'>cd /media/testing</font>)</li>
<li>switched bash into root mode (<font color='green'>sudo bash -i</font>)</li>
<li>Finally I initialized an upgrade from the mounted Alternative Install ISO (<font color='green'>./cdromupgrade</font>)</li>
</ol>The alternative install ISO fixed my broken GNOME/Nautilus packages, restarted my computer and .... VOILA! Everything was back to normal! Nothing was lost and I'm now a happy camper.<br />
<br />
I'm definitely going to keep an alternative install ISO on me and probably also a regular install ISO too. After-all, they are free tools that <a href="http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-in-windows/">don't even need to be burned to CD</A>.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0tag:blogger.com,1999:blog-6991642647631426552.post-18982899176095459652010-01-18T10:09:00.003-05:002010-01-18T10:15:40.566-05:00pyBloggerU now has a GUIYesterday I sat myself in front of both Qt 4 Designer and Wing IDE and didn't tear myself away from my computer until I finished a GUI for <a href="http://nixliving.blogspot.com/2010/01/blog-from-your-html-editor-and-python_01.html">pyBloggerU</A>. <br />
<br />
For those who didn't read my original post on the matter, pyBloggerU is a script I made that will upload an html file containing your Blogger post and images to your Blogger account for online publication. The script deals with the weirdnesses inherent in how Blogger mangles the HTML code so that what you see in your HTML editor is not what you get on Blogger. <br />
<br />
Unfortunately it still is not programmed to handle HTML files generated from WYSIWYG editors, as they create too many complications for me to be able to handle with this script. But I've found that creating blog posts in an HTML editor called <a href="http://quanta.kdewebdev.org/">Quanta Plus</A> to be easy enough. Quanta Plus has lots of buttons that shoot out HTML code for you, code and tag completion, and even a Visual preview mode if you're interested.<br />
<br />
Once you've created your blog post in an HTML editor, like Quanta Plus, you just double click on the <strong>pyBloggerU_GUI.py</strong> file, press <strong>Run</strong> at the next window and enter in all the details shown in the picture below:<br />
<br />
<center><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr5Tlg8Ly-gr_yG2U2uF5yODWkYxOw31ypS3zcs9MQDMP7w5IUUK49dcAsNeKMIx5KG4DAav5Ms59o-G6fE1G42nmyC7JR0yngvYt8yGqfIvldhsEVmdLRbbSJjre6Dg7aY70yGtHelVE/" width="90%" align="middle" border="0"></center><br />
<br />
<br />
<center><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbEMKgR_rJuiKAshPTvwjRZdvo4cqvN0aMlwLcYSlHFSv726Y5K1OcQVNPe9xeVq3R6_ZfP1D_BX0b8ue1h7EPKXGe3SLxR8etZQU2_x93sPOKzyI09xXe0Lup5Yo-PazHjaJzjnPUmxk/" width="90%" align="middle" border="0"></center><br />
<br />
Be sure that any images referred to in the HTML contain their full file paths (the one above is <strong>"/home/inkhorn/Pictures/pyBloggerU.png"</strong>) so that pyBloggerU will be able to upload them from your computer to your Blog's picasa web album. When everything is set, you can press the <strong>Upload</strong> button and your HTML file will become your blog post! When pyBloggerU succeeds at sending a blog post, you'll see a "Success" information window pop up a few moments after pressing the <strong>Upload</strong> button. Also, you'll be able to save your Blogger account info by pressing <strong>Save</strong> after filling out all the fields. When you have a new post to upload to blogger, you can then double click on the entry in the list to the left and your email, password, and blog title will appear in the fields to the right.<br />
<br />
If you would like to download pyBloggerU, it's easily acccessible as a Bazaar branch on Launchpad. Even if you don't know what a Bazaar branch on Launchpad is, go to your terminal, and type in <font color="green">bzr branch lp:pybloggeru</font>. This will create a directory called <font color="purple">pybloggeru</font> in your home directory and will store the python files for the program and all of its dependencies therein.<br />
<br />
Of course if you would like to report a bug, ask a question, or contribute to the program, use the web utilities on the official <a href="https://launchpad.net/pybloggeru">pyBloggerU launchpad page</A>.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0tag:blogger.com,1999:blog-6991642647631426552.post-73066439020832897462010-01-14T21:14:00.002-05:002010-01-14T21:21:35.352-05:00Enjoy your WD My Book 1TB Drive: No more WD SmartWare icon in Ubuntu!As I mentioned in my <a href="http://nixliving.blogspot.com/2010/01/bye-bye-simpletech-and-windows-hello.html">last post</A>, I recently picked up a Western Digital My Book Essential 1 TB external hard drive. Although it doesn't as yet display the same problems that my Simpletech hard drive was having, it does come with an annoying <strong>Virtual CD</strong> installed, literally in the unit's firmware, that contains Western Digital's SmartWare backup software. Of course the software is not linux compatible and wouldn't be something I would want to use anyway. The big question I had was: how do I get rid of it?<br />
<br />
Well the problem has been well documented on the internet, with <strong>many</strong> people complaining about it. I found a helpful comment on a <a href="http://acletras.com/2009/09/28/wd-smartware/">blog maintained by a mac admin</A>. User 'yakkoj' suggests in his comment to make an entry in the <strong>/etc/fstab</strong> file on your mac that basically tells Mac OSX to ignore the Virtual CD so that it doesn't load and show up on your desktop. As Mac OSX is a relative of Linux, his comment was easily adaptable as a solution for my Ubuntu system too! Following is the line that I put in my <strong>/etc/fstab</strong> file and I can vouch that I now no longer see an icon for the <strong>WD Smartware</strong> Virtual CD on my desktop:<br />
<br />
<font color='green'>/dev/sr1 none udf rw,noauto 0 0</font><br />
<br />
The Virtual CD always shows up as /dev/sr1, and I don't think there's any danger of other devices taking up that partition label. So, put the above line into your <strong>/etc/fstab</strong> file, and it will basically tell Linux that any time a device pops up and wants to inhabit the /dev/sr1 partition then it <strong>shouldn't</strong> be mounted at all. Then you will no longer have to stare at the dumb WD SmartWare icon on your linux desktop again! However, please note that this does not in fact rid the hard drive of the software, it just tells your computer to ignore it.Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com16tag:blogger.com,1999:blog-6991642647631426552.post-41107013155445239342010-01-13T22:28:00.002-05:002010-01-13T22:30:57.209-05:00Bye bye Simpletech and Windows, Hello more space for Ubuntu!Today I exchanged my terrible terrible <a href="http://www.simpletech.com/products/storage/redrive">Simpletech 500GB [re]Drive</A> for a sleek looking <a href="http://www.wdc.com/en/products/Products.asp?DriveID=728">Western Digital 1TB My Book Essential</A>. After filling the new backup drive with the files I previously had on the Simpletech, I had a mind to doing some spring cleaning on my Windows Vista partition. <br />
<br />
Yes, I still had Windows Vista after approximately 5 months of using Ubuntu as my primary operating system. I moved some files and folders that I wanted to keep from my Vista partition to the backup drive and then thought it was about time to get rid of Windows and its partition. I never use it anymore! I only had 45 GB allocated to my active Linux partition (ext4 filesystem) and space was beginning to look a little scarce. <br />
<br />
So I downloaded a Knoppix iso (little did I know it was German!), burned it to CD, booted off of it, used GParted to get rid of my Windows partition and resized my active Linux partition. It took about 40 minutes to complete but now my computer is rid of Windows! Now Ubuntu has a 148 GB partition to run off of with 120 GB of free space :)<br />
<br />
Bye bye Windows, nice knowing ya!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0tag:blogger.com,1999:blog-6991642647631426552.post-67250656950815373442010-01-12T13:47:00.002-05:002010-01-12T14:19:10.139-05:00Search Workopolis Easily with PythonI've been looking for jobs lately and thought how nice it would be if I could skip the rigamarole of opening up my browser, going to a job search website, typing in the search arguments, and sifting through the results. In view of making job searching a little easier, I've made a Python script that for now will search <a href="http://www.workopolis.com">Workopolis.com</A> using keywords and a city location that you, the user, specify. It will then output a csv (comma separated value) file containing the job search results in the directory where you executed the script. You can then open the search results at your leisure, sift through them without the annoyances of advertisements, and possibly add them to your own database. <br />
<br />
Just like <a href="http://nixliving.blogspot.com/2010/01/blog-from-your-html-editor-and-python_01.html">pyBloggerU</A>, I've uploaded the files for this Python script to launchpad for others to see and modify at their leisure. Go <a href="http://bazaar.launchpad.net/~matt-dubins/pyjobfinder/trunk/files">here</A> if you'd like to download the program files, and <a href="http://launchpad.net/pyjobfinder">here</A> if you'd like to read more and possibly contribute to the project!<br />
<br />
Once you put the program files in a particular directory, go to your command line, type <font color='green'>python PyJobFinder.py</font>, and then answer the questions that it asks you. Quickly after putting in your search terms, the program tells you the file name of the job results file and then you're free to open it up!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com1tag:blogger.com,1999:blog-6991642647631426552.post-25005169307472740422010-01-08T16:06:00.005-05:002010-01-12T08:30:48.837-05:00View a Windows desktop remotely with Ubuntu and xvnc4viewerToday I needed to give on-the-phone support to a colleague concerning a MATLAB program that I contributed to developing. If you've ever tried to tell someone what to do on their computer without having a similar screen in front of you on the computer, you'll know that it's not easy. To remedy the situation, I looked on the net for a program/protocol to use to view my colleague's desktop remotely. I found out that there is a protocol called VNC (Virtual Network Computing) for which there are client/server applications available on Windows and Ubuntu. <br />
<br />
I got my colleague to install a VNC server for Windows called <a href="http://www.tightvnc.com/download.php">TightVNC</A>, while I installed a VNC viewer for Ubuntu called <a href="http://linuxappfinder.com/package/xvnc4viewer">xvnc4viewer</A>. It was pretty easy for us to get the connection running. She only had to enter in a password for accessing her VNC server, and needed to tell me her public IP address. TightVNC tells you the IP address(es) that your server is broadcasting on when you hover your mouse cursor over the V icon that shows up in your system tray. <br />
<br />
<center><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIiXO58-VidtRPyg-JZj7cx_n14dHbZwmjjQvNmKCfyy_fClCoxvt7BxOBY4QMOY0BYWuVJ-sSyT_5040SAqpe-HIZsYb6P0Wb9yUDuz8NFXqwDXOgKvs1vIEQBLSHX3sWXFzSAM_tfHs/" width='95%' align="center" border="0"></center><br />
<br />
Above I've shown you the <strong>Connect Options</strong> window for <strong>xvnc4viewer</strong> so that you can see what can be changed. However, the only options I changed were <strong>Colour Level</strong> (to Full Colour) and I enabled <strong>Full Screen Mode</strong>. Once she told me her public IP address, I just had to enter it into the textbox in the <strong>VNC Viewer: Connection Details</strong> main window shown above and press okay. Upon connection, the VNC viewer expands as much as it can to accomodate the resolution of the VNC server's screen and then anything they do on their computer can be seen on your computer! It's pretty cool except I'm not sure it allows the person with the viewer to control anything on the server's computer. That was acceptable for my over-the-phone support, as I only needed to see what she was seeing!<br />
<br />
If you want to install <strong>xvnc4viewer</strong> for ubuntu, simply open the terminal and type <font color='green'>sudo apt-get install xvnc4viewer</font>. Easy peazy right? Once you have it installed, to start it up, go to the terminal and type in <font color='green'>xvnc4viewer</font>. That's all!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com3tag:blogger.com,1999:blog-6991642647631426552.post-38067906294116634982010-01-07T22:28:00.005-05:002010-01-12T08:32:00.241-05:00Ubuntu Rescue Remix helped factory reset my Acer Netbook!I've had an Acer Aspire One Netbook for a bit longer than a year now and I finally have no more use for it. It's been a fantastic little computer, serving its purpose in letting me take notes in grad classes when I've needed it. It's incredibly light (2.2 lbs), runs Windows XP, has a big enough hard drive (120 GB), 3 USB ports, digital camera memory readers and a wifi Anyway, it's not my intention to sell my netbook over my blog. I am however intending on selling it to people over craigslist. In order to give it to someone, I needed to restore the netbook to its manufacturer intended state. Conveniently, Acer shipped these things with windows install files on a separate partition. Not so conveniently, their "erecovery" program they make available to download for this purpose doesn't do a thing! I was very frustrated and wanted a way of getting to those install files on the separate partition.<br />
<br />
Along the way I thought of using a Live USB version of linux to somehow get to those files. At first I tried <a href="http://ubuntu-rescue-remix.org/">Ubuntu Rescue Remix</a> version 9.10. The website provides you with an ISO, which you then use in conjunction with USB Startup Disk Creator (accessible by clicking <strong>System > Administration > USB Startup Disk Creator</strong>).<br />
<br />
<center><img align="center" border="0" height="666" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtmhjSx6E1yFLFEJP6iFFKiO9HPVhZgLUdqS2ZYhyphenhyphenuVZh_Z5KNew4A7QLhiGIcoUURXuaR_XqCkNn1UosNfYcDBmZD8PSSA6-fnZ38wnzedanA1FlSSLl4y5dk_uCrqqHfTNKewMAaSjc/" width="95%" /></center><br />
<br />
You press the <strong>Other</strong> button above in order to load up the ISO file that you downloaded. Then you look for your USB stick partition at the bottom (you probably have a pet name you assigned to it) and click <strong>Make Startup Disk</strong>. This organizes your USB stick accordingly and allows you to boot using Ubuntu Rescue Remix. Weirdly, version 9.10 didn't work for me, but 9.04 worked just fine. Be warned, it does boot you into a <em>command line interface</em>, but you don't have to know very much to proceed. All I had to do was: <br />
<ol><li>Press the <strong>Enter</strong> key when the login screen showed up</li>
<li>Type in <span style="color: green;">sudo parted</span> to load the Partition Editor</li>
<li>Type in <span style="color: green;">print all</span> in order to list my partitions</li>
<li>Type in <span style="color: green;">set 1 boot on</span> to make the windows installation partition bootable (I think it was partition 1, you'll probably have to play around to be sure which is the windows installation files partition)</li>
<li>Type in <span style="color: green;">quit</span></li>
<li>Then I shutdown my computer, made sure the USB stick was out, turned it back on and voila, the Acer windows restore utility started running!</li>
</ol>Once it's finished installing, you actually have to boot back into Ubuntu Rescue Remix and make it so that your main windows partition is bootable again. Go through the above list of instructions and you'll have your Acer Aspire One Netbook restored to it's manufacturer's intended state!<br />
<br />
Ubuntu saved Windows, how about that?!!?Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com6tag:blogger.com,1999:blog-6991642647631426552.post-6178202902812179512010-01-04T19:25:00.004-05:002010-01-12T08:33:16.213-05:00Matlab's free cousin OctaveMy educational/work background is in experimental science. Therefore, much of what I've done for work purposes involves processing data, plotting data, and analyzing data. I did most of the data processing and plotting in <a href="http://www.mathworks.com/" name="Matlab">Matlab</a>. Matlab is a fantastic language for scientific computation which is even available for Linux. Of course, the downside to Matlab is that liscences for it cost big bucks outside of academia!<br />
<br />
Recently, I discovered another language for scientific computation called <a href="http://www.gnu.org/software/octave/" name="Octave">Octave</a>. The amazing thing about it is that it is a free-to-download, extensively Matlab-like language! In other words, if you already know Matlab, you barely have to learn anything new in order to use Octave. The functionality is VERY similar, with Octave able to do things like Matrix operations, Signal Processing, Statistics, Scripting and Plotting. I installed Octave in Ubuntu by typing <span style="color: #12d815;"><br />
sudo apt-get install octave</span> into the terminal. Unexpectedly, Octave came packaged in the Ubuntu repository with QtOctave, a complete graphical development interface for working with scientific data. Check out the screenshot below:<br />
<br />
<div align="center"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIKZGjD3brc57lGd1jkQFwT7CDSr2PbZMrZ2VFh7muXZLrTAAYtR7mQeCweJuU3ATqQJZ1VTTc6EKe9vHaccY_AW90UwcuqcIoH7d6nNjbh68SKRCjk6QjUguq2z3XTAXjCckLJgqW6Y/"><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIKZGjD3brc57lGd1jkQFwT7CDSr2PbZMrZ2VFh7muXZLrTAAYtR7mQeCweJuU3ATqQJZ1VTTc6EKe9vHaccY_AW90UwcuqcIoH7d6nNjbh68SKRCjk6QjUguq2z3XTAXjCckLJgqW6Y/" width="95%" /></a><br />
</div><br />
<br />
As you can see, the GUI includes the most important elements found in the Matlab GUI:<br />
<ul><li>The command prompt</li>
<li>A command history</li>
<li>An area to access all the variables/data loaded into memory</li>
<li>A filesystem navigator</li>
<li>Finally, a script editor window (accessible via the fat red pen icon</li>
</ul>I loaded the download speed data that I sampled <a href="http://nixliving.blogspot.com/2009/12/your-download-activity-in-one-file.html" name="last week">last week</a> into Octave and did some modelling to extract the general trend that the download speeds followed. I made a graph of the data and modelling in Octave to see how it looked.<br />
<br />
<div align="center"><img align="middle" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidyQ9i11z1O00jRUKTBXSwgRyA8-j6wyFcsy2aoF3Rzc0uYEvFUqpmzs_atARWBMQxtfVO0FMfrwtswQsCaHIq4swGEBACuiJ834L8AgrnR0V8jhl61K8RiguEg11gJkSQSjiqFqMHWG4/" width="95%" /><br />
</div><br />
<br />
If you've ever done any plotting in Matlab, you'll recognize the same graphics quality in the graph above. Just like Matlab, the default plotting parameters aren't the prettiest, but that's okay. The important thing is that Octave is free, it's sophisticated, and very easy to use for Matlab veterens!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com5tag:blogger.com,1999:blog-6991642647631426552.post-56629220910722170512010-01-03T18:44:00.002-05:002010-01-03T18:45:53.656-05:00Tis a Gift to be SimpleToday I got interested in trying out a few different blogging sites (<a href="http://wordpress.com/">wordpress.com</a> and <a href="http://tumblr.com/">tumblr.com</a>) to see if either one of them provided a better/easier interface to work with than blogger. Going on Wordpress, I saw an interface that was both sophisticated and nice looking. Wordpress seemed to have everything. <br />
<br />
Unfortunately there were a few drawbacks:<br />
<ol><li>Wordpress seems to intentionally set the width of your "Content Column" (the column within which your blog post appears) to be too narrow for my liking. Resultantly, the bigger pictures that I post appear to be cut off :(</li>
<li>After investigating possible solutions to my first problem, I found out that I would need to pay a fee to customize the width (along with other features) of my blog to my liking. I don't like that at all.</li>
<li>Even if I was to live with the narrow width thing, I am surprised that Wordpress doesn't automatically size your pictures according to the width of your content column.</li>
</ol>Oh well, I probably won't be switching to wordpress! As for tumblr, I found their registration to be super easy, but the exact method to customizing your blog using CSS eludes me. I admit I know nothing about CSS, so tumblr may still be an option to investigate further. <br />
<br />
Until then, "tis a gift to be simple". Thanks Blogger!Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com3tag:blogger.com,1999:blog-6991642647631426552.post-32418251970440101052010-01-01T12:56:00.004-05:002010-01-12T08:36:23.169-05:00Blog from your HTML Editor and PythonSo this is a test of the Python script I made to upload a custom made HTML file to my blog. As I mentioned in my last post, Google has provided its own <a href="http://code.google.com/apis/gdata/articles/python_client_lib.html" name="Python Client Library">Python Client Library</a> to the public for connecting to Google's various services. What really confused me at first was the question of where exactly Google stores the pictures you want on your blog when you use the regular Blogger <strong>New Post</strong> interface. I soon discovered that if you're not linking to a picture that's on another website, any picture you put on your Blogger Blog is actually stored under a Picasa Web Album named after your blog and accessible by your Blogger account username and password. Knowing this, I just had to follow a few simple steps for using the <a href="http://code.google.com/apis/gdata/articles/python_client_lib.html" name="Python Client Library">Python Client Library</a> to automatically upload pictures to the user's Picasa Web album (<a href="http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html" name="see here">see here</a>). <br />
<br />
What I figured out is that if you want to put pictures on your blog post, you don't need to know where they'll be uploaded to. Just link to the pictures on your local hard drive and submit your HTML blog post file to my script. My script then: <br />
<ul><li>looks for any local image links </li>
<li>uploads those files to your Picasa Web Album </li>
<li>gets the URLs of your newly uploaded images </li>
<li>Uses those URLs to replace the local path links in your HTML file, and finally</li>
<li>Uploads your newly modified HTML file to Blogger!</li>
</ul><br />
Also, I noticed that Blogger ignores the header/footer html tags found in all web pages like <html>, </html>, <head>, </head>, <body>, and </body> but retains the newline codes that follow them all. Finally, when Blogger processes <br> tags that are followed by a newline code, it creates two new lines. To fix this using my script, I made it so that the inputted HTML file gets sliced from the end of the first <body> tag to just before the beginning of the </body> tag. As well, it gets rid of all <br> tags, leaving only newline codes in their places. At the moment it's a command line script that I haven't yet tested on Windows. If you'd like to take a stab at using it, download it <a href="http://bazaar.launchpad.net/~matt-dubins/pybloggeru/trunk/annotate/head:/pyBloggerU.py">here</a>. To make life easy, download it to the directory where you're saving your HTML blog post file and just call it from the command line by running <span style="color: green;">python pyBloggerU.py</span>. The program will ask you for the following pieces of information:<br />
<ol><li>The email address associated with your Blogger account</li>
<li>Your Blogger account password</li>
<li>Your Blog title (case insensitive), and finally</li>
<li>Your Blog <strong>post title</strong></li>
</ol><br />
If you'd like to help me out, I've registered my project in launchpad and you can submit a branch of my code. Go <a href="https://launchpad.net/pybloggeru" name="Python Blogger Uploader">here</a><br />
if you want to donate your time to help me out :). <br />
<br />
And now finally, it's time for me to test out media uploading:<br />
<br />
<br />
<center><img align="middle" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6UN-yG8Wum_1wzrz8j0uhHfDQ-LeavpU6pxZY0m_oDeloGcr7xzhK7X8QHe5qhIFNCom3cikALVbyV9oVLkSUYkWjGnKqgp1CbBNmtNK5VayDDCwHbMl7bivFeLF2D0jhWS72YFWcfg/" width="95%" /><br />
</center>Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com16tag:blogger.com,1999:blog-6991642647631426552.post-85043621773854069572009-12-30T16:09:00.001-05:002010-01-12T08:37:55.761-05:00Linux Blogging Solution?I don't much like writing to this blog from the <b>New Post </b>interface that blogger provides. It's too small and restricting. So, I've done a lot of googling to find out the best way of writing to a blog from Linux. One option I found was using Google Docs to create a text document (replete with rich text and images) and publish it to blogger. <br />
<br />
I like the format of Google Docs and would certainly continue using it if it weren't for weird formatting incompatibilities between Google Docs and Blogger. In other words, when writing a blog post from Google Docs and submitting it to Blogger, what you see is not exactly what you get. I find that the text spacing and alignment become perverted when you submit a Google Docs text document to Blogger.<br />
<br />
So, that's where the <a href="http://code.google.com/apis/gdata/articles/python_client_lib.html">Google Data Python Library </a> will come in handy! Using this set of Python modules, it's possible to upload photo media to the Picasa Web Album associated with your blog, get the associated URLs, and upload new blog posts containing your newly uploaded photos.<br />
<br />
Using this functionality, I should be able to make a script that will take an HTML file that you create with any old web page editor, replace the links to images on your local hard drive with links to images on your picasa web album, and post your HTML file to Blogger!<br />
<br />
Stay tuned. I'm hoping this ends up being better than Google Docs or Scribefire (I have issues with both platforms).Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com1tag:blogger.com,1999:blog-6991642647631426552.post-42667557557711118602009-12-28T17:43:00.005-05:002010-01-12T08:40:39.001-05:00Your download activity in one file!I started downloading a very big set of files today on bittorrent (using the simple and elegant <a href="http://www.transmissionbt.com/" id="rsyl" target="_blank" title="Transmission Bittorrent Client">Transmission Bittorrent Client</a> that comes with Ubuntu). As I was watching the download speed indicator fluctuate up and down, the data analyst in me started stirring. I thought it would be neat if I could find a program that would output my download speed over time to a dataset that I could then analyze for trends, averages, highs and lows. <br />
<div style="text-align: left;"><br />
</div><div>I inputted the term 'bandwidth' in Synaptic Package Manager to see what kinds of programs were available for this purpose. I found some simple command line programs such as <b>nload</b>, <b>bmon</b>, and <b>iftop</b>. All of them provide text-mode screens that help you monitor your bandwidth, but none of them allow you to output download speed over time to a plain text file. <br />
</div><div><br />
</div><div>After examining the <b>man</b> (manual) pages for each of these programs, I noticed a commonality: <i><span style="background-color: white;"><span style="color: blue;">each of these programs sample bandwidth information from a file named </span></span></i><b><i><span style="background-color: white;"><span style="color: blue;">dev </span></span></i></b><i><span style="background-color: white;"><span style="color: blue;">in the </span></span></i><b><i><span style="background-color: white;"><span style="color: blue;">/proc/net/ </span></span></i></b><i><span style="background-color: white;"><span style="color: blue;">directory on my computer</span></span></i>. Curious for more info, I navigated to that directory and opened up the file. Here's an example of what it looks like:<br />
</div><div><br />
</div><div><div id="y.45" style="text-align: center;"><a href="http://docs.google.com/File?id=dgvrc7fb_25fhd9crfc_b"><img src="http://docs.google.com/File?id=dgvrc7fb_25fhd9crfc_b" width="95%"></a><br />
</div></div><div><br />
</div><div>If you've spent any time messing around with your network connection settings in Ubuntu (or most other operating systems) then you'll recognize most of the row titles in the above image. Now, my computer is only connected to the net through a wireless connection to my Router/ADSL Modem. Therefore, I don't expect any significant data in rows other than the one titled <b>wlan0</b>. <br />
</div><div><br />
</div><div>Next is the neat step: Linux repeatedly updates the <b>dev </b>file with the total number of bytes and packets received since boot-up. All you need to do to find out the download speed in bytes/second is:<br />
</div><div><br />
</div><div><ul><li>Open the file</li>
<li>Copy the numeric value just to the right of <b>wlan0</b>, under the <b>bytes</b> column</li>
<li>Wait a second</li>
<li>Do the same thing with the next value</li>
<li>Subtract the two!</li>
</ul></div><div><br />
</div><div>Of course nobody in their right minds would want to do this manually, but the implementation of the above algorithm is very simple in Python:<br />
</div><div><br />
</div><div><div><span style="color: #990000;">def</span> get_bytes():<br />
dev = <span style="color: #3d85c6;">open</span>(<span style="color: magenta;">'/proc/net/dev','rb'</span>).read()<br />
<span style="color: #9900ff;">import</span> re<br />
pat = re.compile(<span style="color: magenta;">'wlan0:\s*([0-9]+)\s*'</span>)<br />
<span style="color: #990000;">return</span> <span style="color: #3d85c6;">int</span>(pat.search(dev).group(<span style="color: magenta;">1</span>))<br />
</div></div><br />
<div><div><span style="color: #990000;">def</span> get_kbps():<br />
<span style="color: #9900ff;">import</span> time<br />
bytes1 = get_bytes()<br />
time.sleep(<span style="color: magenta;">1</span>)<br />
result = <span style="color: #3d85c6;">round</span>(((get_bytes() - bytes1)/<span style="color: magenta;">1000.0</span>),<span style="color: magenta;">1</span>)<br />
<span style="color: #990000;">return</span> <span style="color: magenta;">'%3.1f'</span> % result<br />
</div></div><br />
<div>The first function above simply opens the <b>dev </b>file and returns the numeric value beside <b>wlan0</b>. The second function uses the first function to get the bytes value two times and calculates Kilobytes/second (it's a smaller number than bytes/second). <br />
</div><div><br />
</div><div>I'm now using these functions to calculate Kilobytes/second every 3 seconds for a total of 4 hours to get my dataset! If you'd like to use these functions just remember that if you're using a wired ethernet connection, change <b>wlan0</b> to <b>eth0 </b>and you will be able get your data.<br />
</div>Inkhornhttp://www.blogger.com/profile/14993876569672491763noreply@blogger.com0