<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alexandru&#039;s E-Desk</title>
	<atom:link href="http://blog.arextech.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.arextech.net</link>
	<description>Somewhat organized stream of technology related stories</description>
	<lastBuildDate>Sun, 19 Feb 2012 02:43:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ClassCastException in android (pre 3.0) when loading Drawable</title>
		<link>http://blog.arextech.net/index.php/2012/02/classcastexception-in-android-pre-3-0-when-loading-drawable/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=classcastexception-in-android-pre-3-0-when-loading-drawable</link>
		<comments>http://blog.arextech.net/index.php/2012/02/classcastexception-in-android-pre-3-0-when-loading-drawable/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 02:43:58 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=103</guid>
		<description><![CDATA[on Android versions before 3.0 there is a bug in the OS which causes the first Drawable in the resources folder to be loaded as a ColorDrawable. <a href="http://blog.arextech.net/index.php/2012/02/classcastexception-in-android-pre-3-0-when-loading-drawable/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was trying to load a Drawable object for use in a project based on Android 2.3.3, but I kept getting this error:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">java.<span style="color: #006633;">lang</span>.<span style="color: #003399;">ClassCastException</span><span style="color: #339933;">:</span> android.<span style="color: #006633;">graphics</span>.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">ColorDrawable</span>
at bv.<span style="color: #006633;">getView</span><span style="color: #009900;">&#40;</span>BackgroundGallery.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>163<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">Gallery</span>.<span style="color: #006633;">makeAndAddView</span><span style="color: #009900;">&#40;</span>Gallery.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>748<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">Gallery</span>.<span style="color: #006633;">fillToGalleryRight</span><span style="color: #009900;">&#40;</span>Gallery.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>700<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">Gallery</span>.<span style="color: #006633;">layout</span><span style="color: #009900;">&#40;</span>Gallery.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>631<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">Gallery</span>.<span style="color: #006633;">onLayout</span><span style="color: #009900;">&#40;</span>Gallery.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>339<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #003399;">View</span>.<span style="color: #006633;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span>.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>7228<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">FrameLayout</span>.<span style="color: #006633;">onLayout</span><span style="color: #009900;">&#40;</span>FrameLayout.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>338<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #003399;">View</span>.<span style="color: #006633;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span>.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>7228<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">LinearLayout</span>.<span style="color: #006633;">setChildFrame</span><span style="color: #009900;">&#40;</span>LinearLayout.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>1254<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">LinearLayout</span>.<span style="color: #006633;">layoutVertical</span><span style="color: #009900;">&#40;</span>LinearLayout.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>1130<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">LinearLayout</span>.<span style="color: #006633;">onLayout</span><span style="color: #009900;">&#40;</span>LinearLayout.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>1047<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #003399;">View</span>.<span style="color: #006633;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span>.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>7228<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">widget</span>.<span style="color: #006633;">FrameLayout</span>.<span style="color: #006633;">onLayout</span><span style="color: #009900;">&#40;</span>FrameLayout.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>338<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #003399;">View</span>.<span style="color: #006633;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span>.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>7228<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #006633;">ViewRoot</span>.<span style="color: #006633;">performTraversals</span><span style="color: #009900;">&#40;</span>ViewRoot.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>1157<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">view</span>.<span style="color: #006633;">ViewRoot</span>.<span style="color: #006633;">handleMessage</span><span style="color: #009900;">&#40;</span>ViewRoot.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>1877<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">os</span>.<span style="color: #006633;">Handler</span>.<span style="color: #006633;">dispatchMessage</span><span style="color: #009900;">&#40;</span>Handler.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>99<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">os</span>.<span style="color: #006633;">Looper</span>.<span style="color: #006633;">loop</span><span style="color: #009900;">&#40;</span>Looper.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>130<span style="color: #009900;">&#41;</span>
at android.<span style="color: #006633;">app</span>.<span style="color: #006633;">ActivityThread</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#40;</span>ActivityThread.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>3687<span style="color: #009900;">&#41;</span>
at java.<span style="color: #006633;">lang</span>.<span style="color: #006633;">reflect</span>.<span style="color: #003399;">Method</span>.<span style="color: #006633;">invokeNative</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Native</span> <span style="color: #003399;">Method</span><span style="color: #009900;">&#41;</span>
at java.<span style="color: #006633;">lang</span>.<span style="color: #006633;">reflect</span>.<span style="color: #003399;">Method</span>.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Method</span>.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>507<span style="color: #009900;">&#41;</span>
at com.<span style="color: #006633;">android</span>.<span style="color: #006633;">internal</span>.<span style="color: #006633;">os</span>.<span style="color: #006633;">ZygoteInit</span>$MethodAndArgsCaller.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span>ZygoteInit.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>842<span style="color: #009900;">&#41;</span>
at com.<span style="color: #006633;">android</span>.<span style="color: #006633;">internal</span>.<span style="color: #006633;">os</span>.<span style="color: #006633;">ZygoteInit</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#40;</span>ZygoteInit.<span style="color: #006633;">java</span><span style="color: #339933;">:</span>600<span style="color: #009900;">&#41;</span>
at dalvik.<span style="color: #006633;">system</span>.<span style="color: #006633;">NativeStart</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Native</span> <span style="color: #003399;">Method</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>I went back, checked the image and everything seemed to be ok. Getting frustrated I started looking online for answers.<br />
Finally I found a bug report with others having the same issue.<br />
It turns out that on Android versions before 3.0 there is a bug in the OS which causes the first Drawable in the resources folder to be loaded as a ColorDrawable.<br />
Obviously this will cause an error if you&#8217;re just trying to load an image.<br />
The solution for me was to create a dummy image named a.png and placing it in res/drawable, making sure to never use it.<br />
After that I was able to use my other images without any issues.<br />
<a href="http://code.google.com/p/android/issues/detail?id=2561">Original bug report</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2012/02/classcastexception-in-android-pre-3-0-when-loading-drawable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter oAuth authorization failed 401 when using callback api</title>
		<link>http://blog.arextech.net/index.php/2012/01/twitter-oauth-authorization-failed-401-when-using-callback-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-oauth-authorization-failed-401-when-using-callback-api</link>
		<comments>http://blog.arextech.net/index.php/2012/01/twitter-oauth-authorization-failed-401-when-using-callback-api/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 00:17:23 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=91</guid>
		<description><![CDATA[Recently I was trying to connect to twitter for a project and the first step was to authenticate using oAuth. Twitter uses the oAuth 1.0a specification and one way to authenticate is for twitter to call a specific callback with &#8230; <a href="http://blog.arextech.net/index.php/2012/01/twitter-oauth-authorization-failed-401-when-using-callback-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I was trying to connect to twitter for a project and the first step was to authenticate using oAuth.<br />
Twitter uses the oAuth 1.0a specification and one way to authenticate is for twitter to call a specific callback with the user&#8217;s token.<br />
You can specify which callback url twitter will call when complete, which I had done, but every time I tried to authenticate, it threw this error:</p>
<pre>Authorization failed (server replied with a 401).
This can happen if the consumer key was not correct or the signatures did not match.</pre>
<p>I checked the consumer key and the signatures and they were ok.<br />
As it turns out, if you want to use the callback mechanism, you have to specify a callback url in the twitter application settings.<br />
To do this go to https://dev.twitter.com and sign in. Under your username click My Applications.<br />
Select the application you&#8217;re using and select the Settings tab.<br />
Then enter any callback you want into the callback url setting.<br />
<a href="http://blog.arextech.net/index.php/2012/01/twitter-oauth-authorization-failed-401-when-using-callback-api/twitter_callback/" rel="attachment wp-att-98"><img src="http://blog.arextech.net/wp-content/uploads/2012/01/twitter_callback-300x261.png" alt="" width="300" height="261" class="alignnone size-medium wp-image-98" /></a><br />
This is a weird quirk, but it was mentioned in the twitter developer forum.<br />
After setting the callback url to something, in my case to <a href="http://blog.arextech.net/callback">http://blog.arextech.net/callback</a> I was able to use the previous calls which didn&#8217;t work, unchanged, and they worked.<br />
Source:<br />
<a href="https://dev.twitter.com/discussions/1250">Twitter developer discussion</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2012%2F01%2Ftwitter-oauth-authorization-failed-401-when-using-callback-api%2F&amp;title=Twitter%20oAuth%20authorization%20failed%20401%20when%20using%20callback%20api" id="wpa2a_2"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2012/01/twitter-oauth-authorization-failed-401-when-using-callback-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.10 as time machine backup for Mac OS X Lion</title>
		<link>http://blog.arextech.net/index.php/2011/12/ubuntu-11-10-time-machine-mac-lion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-11-10-time-machine-mac-lion</link>
		<comments>http://blog.arextech.net/index.php/2011/12/ubuntu-11-10-time-machine-mac-lion/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 03:44:24 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Time Machine]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[avahi]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[netatalk]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=75</guid>
		<description><![CDATA[I wanted to do a network backup of my MacBook running Mac OS X 10.7 codename Lion. Time Machine seemed like the right choice since it's built in and very easy to used. <a href="http://blog.arextech.net/index.php/2011/12/ubuntu-11-10-time-machine-mac-lion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Making backups of laptops is very important since you can lose it, have it stolen or most likely have a hard drive fail on you.<br />
So I wanted to do a network backup of my MacBook running Mac OS X 10.7 codename Lion. Time Machine seemed like the right choice since it&#8217;s built in and very easy to used.<br />
Since I already have an Ubuntu 11.10 codename Oneiric Ocelot I was going to have Time Machine put the backups on it.<br />
First you have to install a couple of prerequisite packages:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Avahi_(software)">avahi-daemon</a> (to advertise on the network that we can accept the Apple Filing Protocol, AFP, protocol which is used by Time Machine for backups)</li>
<li><a href="http://en.wikipedia.org/wiki/Netatalk">netatalk</a> (free, open-source implementation of the AppleTalk suite of protocols)</li>
</ul>
<p>Install netatalk (which is in the Ubuntu repositories):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> netatalk</pre></div></div>

<p>Next we&#8217;ll configure which folders we want to make available over AFP so edit the file /etc/netatak/AppleVolumes.default</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>netatak<span style="color: #000000; font-weight: bold;">/</span>AppleVolumes.default</pre></div></div>

<p>I commented out the home directory share and added the last line to specify which folder to use for the backups, the name of the share and the options:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># By default all users have access to their home directories.
#~/                     <span style="color: #933;">&quot;Home Directory&quot;</span>
/backup_folder         <span style="color: #933;">&quot;TMBackup&quot;</span>       options:tm</pre></div></div>

<p>Next I edited the /etc/netatalk/afpd.conf file since I wasn&#8217;t able to connect to the Time Machine share, I was getting a weird error saying</p>
<pre>
There was a problem connecting to the server "SERVER".
Check the server name or IP address, and then try again.
If you continue to have problems, contact your system administrator.
</pre>
<p>I fixed that by add replacing the last configuration line of /etc/netatalk/afpd.conf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>netatalk<span style="color: #000000; font-weight: bold;">/</span>afpd.conf</pre></div></div>

<p>with the following line, which removes access by the guest user and adds password authentication for local users:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword</pre></div></div>

<p>Once that&#8217;s done, restart the netatalk service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service netatalk restart</pre></div></div>

<p>Install the avahi daemon (if you don&#8217;t already have it):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> avahi-daemon</pre></div></div>

<p>In previous versions of netatalk, we&#8217;d have to provide a configuration file for the AFP service in /etc/avahi/services/afpd.service, but we don&#8217;t need to do that anymore since the newer version of netatalk takes care of advertising itself through avahi.<br />
Restart the avahi daemon, just to make sure it&#8217;s running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service avahi-daemon restart</pre></div></div>

<p>Now on your Mac, if you didn&#8217;t enable network backups to devices other than the time capsule from Apple, run the following command in a Terminal window:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.systempreferences TMShowUnsupportedNetworkVolumes <span style="color: #000000;">1</span></pre></div></div>

<p>You should now be able to go into Finder -&gt; Go -&gt; Connect to Server -&gt; Browse, and see your new time machine share. Select it in Time Machine and start backing up.</p>
<p><strong>Notes</strong><br />
You can restrict which users have access to the time machine afp share by modifying the /etc/netatak/AppleVolumes.default config file and adding the &#8220;allow:&#8221; option with the usernames allowed to access the share:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># By default all users have access to their home directories.
#~/                     <span style="color: #933;">&quot;Home Directory&quot;</span>
/backup_folder         <span style="color: #933;">&quot;TMBackup&quot;</span>     allow:username       options:tm</pre></div></div>

<p>Also make sure the folder selected for the backup folder has proper write permissions for the user(s)/group(s) which will make backups to it.</p>
<p><strong>Sources</strong><br />
<a href="http://kofler.info/blog/165/126/Lion-Time-Machine-Backups-unter-Ubuntu-11-10-2-Update/" title="Michael Koflers Blog">Michael Koflers Blog</a><br />
<a href="http://ubuntuguide.net/ubuntu-10-10-setting-up-mac-os-time-machine-server" title="Ubuntu Guide">Ubuntu Guide</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2011/12/ubuntu-11-10-time-machine-mac-lion/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Problems with proguard and the android compatibility package</title>
		<link>http://blog.arextech.net/index.php/2011/12/problems-with-proguard-and-the-android-compatibility-package/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=problems-with-proguard-and-the-android-compatibility-package</link>
		<comments>http://blog.arextech.net/index.php/2011/12/problems-with-proguard-and-the-android-compatibility-package/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 01:30:52 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[proguard]]></category>
		<category><![CDATA[proguard.cfg]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=66</guid>
		<description><![CDATA[I've been playing with Fragments lately and so I'm using the android support package so I can get Fragments in pre 3.0 version of Android.
However when I build the app proguard complains about being unable to find some classes referenced by the compatibility package.
Another way to fix those warnings is to change the API version you're targeting (if you have that possibility). 
API version 11 is Honeycomb so that should have all the missing classes. <a href="http://blog.arextech.net/index.php/2011/12/problems-with-proguard-and-the-android-compatibility-package/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with Fragments lately and so I&#8217;m using the android support package so I can get Fragments in pre 3.0 version of Android.<br />
However when I build the app proguard complains about being unable to find some classes referenced by the compatibility package.<br />
Here are some of the warnings proguard throws:<br />
<code>[proguard] Warning: android.support.v4.widget.EdgeEffectCompatIcs: can't find referenced class android.widget.EdgeEffect<br />
[proguard] Warning: android.support.v4.widget.EdgeEffectCompatIcs: can't find referenced class android.widget.EdgeEffect<br />
[proguard] Warning: android.support.v4.view.MenuCompatHoneycomb: can't find referenced method 'void setShowAsAction(int)' in class android.view.MenuItem<br />
[proguard] Warning: android.support.v4.view.ViewGroupCompatIcs: can't find referenced method 'boolean onRequestSendAccessibilityEvent (android.view.View,android.view.accessibility.AccessibilityEvent)' in class android.view.ViewGroup<br />
[proguard] Warning: android.support.v4.view.accessibility.AccessibilityManagerCompatIcs$1: can't find referenced class android.view.accessibility.AccessibilityManager$AccessibilityStateChangeListener<br />
[proguard] Note: the configuration refers to the unknown class 'android.widget.EdgeEffect'<br />
[proguard] Note: the configuration refers to the unknown class 'android.view.accessibility.AccessibilityRecord'</code><br />
That looks to me like the support package is trying to use some Honeycomb only classes.<br />
After some research I found that the easiest way to get rid of those warnings is to have proguard not warn about the missing classes.<br />
To do that, I added this line to my proguard.cfg file:</p>
<pre>-dontwarn android.support.v4.**</pre>
<p>If you can narrow it down to only a certain package you can ignore just that more specific package, but I would&#8217;ve had to make 3 new rules for proguard in my case.</p>
<p>Another way to fix those warnings is to change the API version you&#8217;re targeting (if you have that possibility).<br />
API version 11 is Honeycomb so that should have all the missing classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2011/12/problems-with-proguard-and-the-android-compatibility-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to obtain user location on Google TV</title>
		<link>http://blog.arextech.net/index.php/2011/12/how-to-obtain-user-location-on-google-tv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-obtain-user-location-on-google-tv</link>
		<comments>http://blog.arextech.net/index.php/2011/12/how-to-obtain-user-location-on-google-tv/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 03:43:36 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google TV]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google tv]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=53</guid>
		<description><![CDATA[After searching online I finally figured out how to get the user location on the Revue.
When getting the user's last known location from the LocationManager in android you pass in a type of location you want (such as LocationManager.NETWORK_PROVIDER). <a href="http://blog.arextech.net/index.php/2011/12/how-to-obtain-user-location-on-google-tv/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was searching for a way to get a user&#8217;s location on the Logitech Revue but I couldn&#8217;t find anything in the <a title="google documentation for google tv" href="https://developers.google.com/tv/">google documentation for google tv</a>.<br />
I tried getting the location based on the network since google tv doesn&#8217;t have access to a GPS, but that didn&#8217;t work.<br />
After searching online I finally figured out how to get the user location on the Revue.<br />
When getting the user&#8217;s last known location from the LocationManager in android you pass in a type of location you want (such as LocationManager.NETWORK_PROVIDER).<br />
On the google tv there isn&#8217;t currently a defined type so you pass in the string &#8220;static&#8221; to the getLastKnownLocation method.<br />
There are some permissions you need to set in your AndroidManifest.xml so you can access the location:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-feature</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.hardware.location&quot;</span> <span style="color: #000066;">android:required</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.ACCESS_COARSE_LOCATION&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>And the code to actually get the location is:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">LocationManager locationManager <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>LocationManager<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getSystemService</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span>.<span style="color: #006633;">LOCATION_SERVICE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Location loc <span style="color: #339933;">=</span> locationManager.<span style="color: #006633;">getLastKnownLocation</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;static&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a title="Source" href="http://stackoverflow.com/questions/8243237/how-to-get-users-location-from-google-tv">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2011/12/how-to-obtain-user-location-on-google-tv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated: Running a virtual machine in virtualbox 3.1 from the command line</title>
		<link>http://blog.arextech.net/index.php/2010/02/updated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line</link>
		<comments>http://blog.arextech.net/index.php/2010/02/updated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 00:00:15 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[virtualbox 3.1.2]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=46</guid>
		<description><![CDATA[After upgrading to VirtualBox 3.1.2 I noticed some changes in the command line interface when it comes to creating and managing virtual machines. Because of that, I decided to update my previous post. Some terms in this post: host &#8211; &#8230; <a href="http://blog.arextech.net/index.php/2010/02/updated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After upgrading to VirtualBox 3.1.2 I noticed some changes in the command line interface when it comes to creating and managing virtual machines. Because of that, I decided to update my previous <a href="http://blog.arextech.net/index.php/2009/07/running-a-virtual-in-virtualbox-from-cli/">post</a>.</p>
<p>Some terms in this post:<br />
host &#8211; machine on which VirtualBox runs, your &#8220;real&#8221; server<br />
guest &#8211; virtual machine running in VirtualBox, your virtual server</p>
<ol>
<li>Install or Update VirtualBox:
<ul>
<li>Download it from the site: <a title="http://www.virtualbox.org/wiki/Downloads" href="http://www.virtualbox.org/wiki/Downloads">http://www.virtualbox.org/wiki/Downloads</a></li>
<li>For Debian based systems there are detailed instructions on the linux download page: <a title="http://www.virtualbox.org/wiki/Linux_Downloads" href="http://www.virtualbox.org/wiki/Linux_Downloads">http://www.virtualbox.org/wiki/Linux_Downloads</a></li>
<li>For this post I&#8217;m using VirtualBox 3.1.2</li>
</ul>
</li>
<li>Create the virtual machine and register it with VBox. The name of the vm is vbuntu.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage createvm <span style="color: #660033;">--name</span> vbuntu <span style="color: #660033;">--ostyle</span> <span style="color: #ff0000;">&quot;Ubuntu&quot;</span> <span style="color: #660033;">--register</span></pre></div></div>

</li>
<li>Create a SATA controller which we will use to control the disk image.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage storagectl vbuntu <span style="color: #660033;">--name</span> <span style="color: #ff0000;">&quot;SATA Controller&quot;</span> <span style="color: #660033;">--add</span> sata <span style="color: #660033;">--controller</span> IntelAhci</pre></div></div>

</li>
<li>Create and register the virtual disk image, basically the virtual disk from which the vm runs. Give it a filename and a size in MB, here my virtual disk image is name vbuntu.vdi and it has 30,000 MB.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage createhd <span style="color: #660033;">--filename</span> vdesktop.vdi <span style="color: #660033;">--size</span> 30000 <span style="color: #660033;">--variant</span> Standard</pre></div></div>

</li>
<li>Link the vdi to the vm&#8217;s SATA controller we previously created. Connect it to the first port and make it the first device, basically sda1

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage storageattach vbuntu <span style="color: #660033;">--storagectl</span> <span style="color: #ff0000;">&quot;SATA Controller&quot;</span> <span style="color: #660033;">--port</span> 0 <span style="color: #660033;">--device</span> 0 <span style="color: #660033;">--type</span> hdd <span style="color: #660033;">--medium</span> vdesktop.vdi</pre></div></div>

</li>
<li>Create an IDE controller which we will use to control the virtual dvd drive from which we will install the OS.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage storagectl vbuntu <span style="color: #660033;">--name</span> <span style="color: #ff0000;">&quot;IDE&quot;</span> <span style="color: #660033;">--add</span> ide</pre></div></div>

</li>
<li>Register the install disk image of ubuntu server with VBox and mount the install disk on your vm.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage storageattach vbuntu <span style="color: #660033;">--storagectl</span> <span style="color: #ff0000;">&quot;IDE&quot;</span> <span style="color: #660033;">--port</span> 0 <span style="color: #660033;">--device</span> <span style="color: #660033;">--0</span> <span style="color: #660033;">--type</span> dvddrive <span style="color: #660033;">--medium</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>ubuntu-<span style="color: #000000;">9.04</span>-server-amd64.iso</pre></div></div>

</li>
<li>Modify the boot order for the virtual machine so it boots from the install dvd first.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--boot1</span> dvd <span style="color: #660033;">--boot2</span> disk</pre></div></div>

</li>
<li>Modify the default options for the vm. I gave the vm 1GB of ram, turned on ACPI for power control, turned on PAE (ubuntu server requires it, it enabled 32bit hosts to use more than 4GB of ram) and I also turned on Enable VT-x/AMD-V which are the technologies Intel and AMD processors use for hardware virtualization extensions. To use these extensions your host must have a processor supporting them and then enable them from the BIOS.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--memory</span> 1024MB <span style="color: #660033;">--acpi</span> on <span style="color: #660033;">--pae</span> on <span style="color: #660033;">--hwvirtex</span> on</pre></div></div>

</li>
<li>For networking I&#8217;m using bridged networking. First set the vm nic to bridged mode, then bridge it with one of the host&#8217;s nic. Here I bridged it over my host&#8217;s eth1 nic.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--nic1</span> bridged
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--bridgeadapter1</span> eth1</pre></div></div>

</li>
<li>I also changed the port for the remote desktop protocol to 33891 because I&#8217;m running multiple vm&#8217;s, so each vm has its own port.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--vrdpport</span> <span style="color: #000000;">33891</span></pre></div></div>

</li>
<li>Start the vm in the background, so remember to add the ampersand at the end of the command. After that you can RDP into the vm by connecting to the IP of your host system on the above set port. Now you can install the guest OS.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxHeadless <span style="color: #660033;">-startvm</span> vbuntu <span style="color: #000000; font-weight: bold;">&amp;</span>amp;</pre></div></div>

</li>
<li>To shut off the vm use this command.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage controlvm vbuntu poweroff</pre></div></div>

</li>
<li>Once done with the install, you can unregister the install disk and have the vm boot from its own hdd.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage storageattach vbuntu <span style="color: #660033;">--storagectl</span> <span style="color: #ff0000;">&quot;IDE Controller&quot;</span> <span style="color: #660033;">--port</span> 0 <span style="color: #660033;">--device</span> 0 <span style="color: #660033;">--medium</span> none
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--boot1</span> disk <span style="color: #660033;">--boot2</span> none</pre></div></div>

</li>
<li>Optionally here are the steps to get rid of the vm and its disk image if you don&#8217;t need it anymore.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--boot1</span> none
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage unregistervm <span style="color: #660033;">--delete</span> vbuntu
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage unregisterimage disk <span style="color: #ff0000;">&quot;vbuntu.vdi&quot;</span></pre></div></div>

</li>
</ol>
<p>Let me know if you have any suggestions or comments as to the process I just described.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2010%2F02%2Fupdated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line%2F&amp;title=Updated%3A%20Running%20a%20virtual%20machine%20in%20virtualbox%203.1%20from%20the%20command%20line" id="wpa2a_4"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2010/02/updated-running-a-virtual-machine-in-virtualbox-3-1-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check temperature of HDD in a 3ware RAID card</title>
		<link>http://blog.arextech.net/index.php/2009/12/check-temperature-of-hdd-in-a-3ware-raid-card/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-temperature-of-hdd-in-a-3ware-raid-card</link>
		<comments>http://blog.arextech.net/index.php/2009/12/check-temperature-of-hdd-in-a-3ware-raid-card/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 23:43:34 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[3ware]]></category>
		<category><![CDATA[hdd]]></category>
		<category><![CDATA[Raid]]></category>
		<category><![CDATA[SATA]]></category>
		<category><![CDATA[smartctl]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=36</guid>
		<description><![CDATA[Recently I bought a 3ware sata raid card and installed 3 hard disks in it for a raid 5 array (maybe that&#8217;ll be another blog post), but I noticed that hddtemp didn&#8217;t read the temperature correctly anymore. I figured this &#8230; <a href="http://blog.arextech.net/index.php/2009/12/check-temperature-of-hdd-in-a-3ware-raid-card/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I bought a 3ware sata raid card and installed 3 hard disks in it for a raid 5 array (maybe that&#8217;ll be another blog post), but I noticed that hddtemp didn&#8217;t read the temperature correctly anymore.<br />
I figured this had something to do with hddtemp having to read through the raid card to get the temperature, so this is how I got temperature readings for my hard disks in the 3ware raid card.<br />
This is done on ubuntu, but smartctl works on most linux distros so you can use the same instructions on other distros, apart from installing smartctl.<br />
The smartctl script on ubuntu is found in the smartmontools package, so install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> smartmontools</pre></div></div>

<p>Once that is installed, you can try the help command to make sure it got installed correctly:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ smartctl <span style="color: #660033;">-h</span></pre></div></div>

<p>If that works correctly, now we&#8217;re ready to read some temperatures.<br />
Depending on the series of the 3ware card you have, the care is accessed through either /dev/twa or /dev/twe<br />
Now, to read the temperature of the hdd in slot 1, the command is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> smartctl <span style="color: #660033;">-H</span> <span style="color: #660033;">-d</span> 3ware,<span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>twa0</pre></div></div>

<p>Note that after the comma in 3ware,0 comes the number of the hdd slot you&#8217;re trying to read, going from 0 up. For example, for the hdd in the second slot, it would be 3ware,1<br />
Also, I had my 3ware raid card in /dev/twa0, which might not be the case for your setup.<br />
You might also want to look through the smartctl tool&#8217;s manual page because it&#8217;s quite a powerful tool for monitoring hdd performance and kicking off SMART tests on the hdds.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2009%2F12%2Fcheck-temperature-of-hdd-in-a-3ware-raid-card%2F&amp;title=Check%20temperature%20of%20HDD%20in%20a%203ware%20RAID%20card" id="wpa2a_6"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2009/12/check-temperature-of-hdd-in-a-3ware-raid-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox 3.1 new feature: Snapshots</title>
		<link>http://blog.arextech.net/index.php/2009/12/virtualbox-3-1-new-feature-snapshots/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtualbox-3-1-new-feature-snapshots</link>
		<comments>http://blog.arextech.net/index.php/2009/12/virtualbox-3-1-new-feature-snapshots/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 03:16:19 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[new feature]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=32</guid>
		<description><![CDATA[A new feature in VirtualBox 3.1 is the ability to take a snapshot of a VM. Each snapshot saves the state of the VM and you&#8217;re able to go back to it, just like version control. This means that if &#8230; <a href="http://blog.arextech.net/index.php/2009/12/virtualbox-3-1-new-feature-snapshots/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A new feature in VirtualBox 3.1 is the ability to take a snapshot of a VM.<br />
Each snapshot saves the state of the VM and you&#8217;re able to go back to it, just like version control.<br />
This means that if you go back to a snapshot, you will lose all the changes you made after the snapshot.<br />
Snapshots can be taken while the VM is running, so you can take a snapshot before installing a new program to play around with.<br />
If something goes wrong with the installation, just start the snapshot and you&#8217;re back in the game.<br />
A snapshot does not create a separate VM, so you&#8217;re still using the original VM, just modifying what&#8217;s on it.<br />
Remember that if you go back to a snapshot, all the changes you made since taking the snapshot will be lost, so before going back, take another snapshot of the current state.<br />
Now for the practice part.</p>
<p>The scenario is this: you have a fresh install of ubuntu on a VM called vbuntu.<br />
You want to install something on it, but want to create a snapshot in case something goes wrong.</p>
<p>Look at the previous posts to see how to create the initial VM.<br />
Once that is done, this is how you create a snapshot of the original VM called vbuntu, and call the snapshot initial_install</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ VBoxManage snapshot vbuntu take initial_install</pre></div></div>

<p>Then you do your install. If something goes wrong, you want to go back to the initial_install snapshot, here&#8217;s how to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ VBoxManage snapshot vbuntu restore initial_install</pre></div></div>

<p>If your install goes well and want to create another snapshot before you install another program, you should take another snapshot, like above.</p>
<p>For more information about VirtualBox 3.1 snapshots check out the <a href="http://www.virtualbox.org/manual/UserManual.html#snapshots">VirtualBox site</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2009%2F12%2Fvirtualbox-3-1-new-feature-snapshots%2F&amp;title=VirtualBox%203.1%20new%20feature%3A%20Snapshots" id="wpa2a_8"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2009/12/virtualbox-3-1-new-feature-snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems with ubuntu when upgrading to karmic koala: mysqld and dns resolution</title>
		<link>http://blog.arextech.net/index.php/2009/11/problems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=problems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution</link>
		<comments>http://blog.arextech.net/index.php/2009/11/problems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 03:43:19 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[karmic koala]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nameserver]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=21</guid>
		<description><![CDATA[After upgrading to Ubuntu 9.10, Karmic Koala, I noticed I had a couple of annoying problems. First of all I was unable to connect to any outside site, so I tried to ping yahoo.com but I had an error say &#8230; <a href="http://blog.arextech.net/index.php/2009/11/problems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After upgrading to Ubuntu 9.10, Karmic Koala, I noticed I had a couple of annoying problems.<br />
First of all I was unable to connect to any outside site, so I tried to ping yahoo.com but I had an error say that the domain name could not be resolved. I tried pinging the IP address for yahoo.com (got that from using another computer to look it up) and that worked.<br />
What this means is that the ubuntu machine can&#8217;t resolve domain names to their IP address, which it usually does through nameservers.<br />
Apparently the upgrade process erased my nameserver configuration.<br />
On ubuntu the nameserver configuration can be found in<br />
<strong>/<font>etc</font>/resolv.conf</strong><br />
In that file, set your nameservers like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">nameserver 192.168.1.1
nameserver 10.0.0.1</pre></div></div>

<p>Those just examples, but the 192.168.1.1 IP address in my case was my router&#8217;s IP address since it acts as a relay for the ISP&#8217;s nameservers, the next one is just an example IP. Now try to bring your ethernet interface up, or just reboot your box.</p>
<p>Another annoying problem is that the mysql server would not start on the ubuntu machine. I checked in the dmesg error log and found this weird looking error:</p>
<blockquote><p>[10360.109659] type=1503 audit(1256893798.480:502): operation=&#8221;open&#8221; pid=23026 parent=23025 profile=&#8221;/usr/sbin/mysqld&#8221; requested_mask=&#8221;r::&#8221; denied_mask=&#8221;r::&#8221; fsuid=0 ouid=0 name=&#8221;/sys/devices/system/cpu/&#8221;</p></blockquote>
<p>After a couple Google searches I found some other people had the same problem and it stemmed from an option in the mysql configuration where it disabled berkley db support.<br />
I went in the mysql configuration file, in ubuntu <strong>/<font>etc</font>/mysql/my.cnf</strong> and commented out the skip-bdb, just put a # in front of the option:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#skip-bdb</span></pre></div></div>

<p>That should do it, now restart mysql and it should work, if it doesn&#8217;t try to reboot and see if that does it.<br />
<strong>user@host:~$ sudo /<font>etc</font>/init.d/mysqld restart</strong><br />
That&#8217;s all for now, let me know if you had any other problems when upgrading.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2009%2F11%2Fproblems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution%2F&amp;title=Problems%20with%20ubuntu%20when%20upgrading%20to%20karmic%20koala%3A%20mysqld%20and%20dns%20resolution" id="wpa2a_10"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2009/11/problems-with-ubuntu-when-upgrading-to-karmic-koala-mysqld-and-dns-resolution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running a virtual machine in virtualbox 3.0 from the command line</title>
		<link>http://blog.arextech.net/index.php/2009/07/running-a-virtual-in-virtualbox-from-cli/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=running-a-virtual-in-virtualbox-from-cli</link>
		<comments>http://blog.arextech.net/index.php/2009/07/running-a-virtual-in-virtualbox-from-cli/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 03:41:54 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://blog.arextech.net/?p=9</guid>
		<description><![CDATA[VirtualBox has a great user interface but sometimes it&#8217;s just not necessary, especially if you want to create/start/stop virtual machines remotely or if you are just running a server without a windowing system. Luckily VBox allows you to do everything &#8230; <a href="http://blog.arextech.net/index.php/2009/07/running-a-virtual-in-virtualbox-from-cli/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>VirtualBox has a great user interface but sometimes it&#8217;s just not necessary, especially if you want to create/start/stop virtual machines remotely or if you are just running a server without a windowing system.<br />
Luckily VBox allows you to do everything from the command line interface (cli) that you can do from the user interface and it also allows you to remote desktop connect to the virtual machine.<br />
In this post I&#8217;ll show you how to install VirtualBox on an ubuntu linux server, then set up and run a virtual machine from the cli.</p>
<p>Some terms in this post:<br />
host &#8211; machine on which VirtualBox runs, your &#8220;real&#8221; server<br />
guest &#8211; virtual machine running in VirtualBox, your virtual server</p>
<ol>
<li>Install VirtualBox:
<ul>
<li>Download it from the site: <a title="http://www.virtualbox.org/wiki/Downloads" href="http://www.virtualbox.org/wiki/Downloads">http://www.virtualbox.org/wiki/Downloads</a></li>
<li>For Debian based systems there are detailed instructions on the linux download page: <a title="http://www.virtualbox.org/wiki/Linux_Downloads" href="http://www.virtualbox.org/wiki/Linux_Downloads">http://www.virtualbox.org/wiki/Linux_Downloads</a></li>
<li>For this post I&#8217;m using VirtualBox 3.0</li>
</ul>
</li>
<li>Create the virtual machine and register it with VBox. The name of the vm is vbuntu.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage createvm <span style="color: #660033;">-name</span> vbuntu <span style="color: #660033;">-register</span></pre></div></div>

</li>
<li>Change the boot adapter to the virtual dvd drive so we can boot the OS install disk.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--boot1</span> dvd</pre></div></div>

</li>
<li>Create and register the virtual disk image, basically the virtual disk from which the vm runs. Give it a filename and a size in MB, here my virtual disk image is name vbuntu.vdi and it has 30,000 MB.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage createvdi <span style="color: #660033;">-filename</span> <span style="color: #ff0000;">&quot;vbuntu.vdi&quot;</span> <span style="color: #660033;">-size</span> 30000 <span style="color: #660033;">-register</span></pre></div></div>

</li>
<li>Link the vdi to the vm, here hda is the hdd off which the vm boots.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">-hda</span> vbuntu.vdi</pre></div></div>

</li>
<li>Register the install disk image of ubuntu server with VBox. Then mount the install disk on your vm.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage registerimage dvd <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>ubuntu-9.04-server-amd64.iso
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">-dvd</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>ubuntu-<span style="color: #000000;">9.04</span>-server-amd64.iso</pre></div></div>

</li>
<li>Modify the default options for the vm. I gave the vm 1GB of ram, turned on ACPI for power control, turned on PAE (ubuntu server requires it, it enabled 32bit hosts to use more than 4GB of ram) and I also turned on Enable VT-x/AMD-V which are the technologies Intel and AMD processors use for hardware virtualization extensions. To use these extensions your host must have a processor supporting them and then enable them from the BIOS.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--memory</span> 1024MB <span style="color: #660033;">--acpi</span> on <span style="color: #660033;">--pae</span> on <span style="color: #660033;">--hwvirtex</span> on</pre></div></div>

</li>
<li>For networking I&#8217;m using bridged networking. First set the vm nic to bridged mode, then bridge it with one of the host&#8217;s nic. Here I bridged it over my host&#8217;s eth1 nic.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--nic1</span> bridged
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--bridgeadapter1</span> eth1</pre></div></div>

</li>
<li>I also changed the port for the remote desktop protocol to 33891 because I&#8217;m running multiple vm&#8217;s, so each vm has its own port.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--vrdpport</span> <span style="color: #000000;">33891</span></pre></div></div>

</li>
<li>Start the vm in the background, so remember to add the ampersand at the end of the command. After that you can RDP into the vm by connecting to the IP of your host system on the above set port. Now you can install the guest OS.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxHeadless <span style="color: #660033;">-startvm</span> vbuntu <span style="color: #000000; font-weight: bold;">&amp;</span>amp;</pre></div></div>

</li>
<li>To shut off the vm use this command.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage controlvm vbuntu poweroff</pre></div></div>

</li>
<li>Once done with the install, you can unregister the install disk and have the vm boot from its own hdd.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">-dvd</span> none
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage unregisterimage dvd <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>ubuntu-9.04-server-amd64.iso
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">-boot1</span> hda</pre></div></div>

</li>
<li>Optionally here are the steps to get rid of the vm and its disk image if you don&#8217;t need it anymore.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage modifyvm vbuntu <span style="color: #660033;">--hda</span> none
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage unregistervm <span style="color: #660033;">--delete</span> vbuntu
user<span style="color: #000000; font-weight: bold;">@</span>host:~$ VBoxManage unregisterimage disk <span style="color: #ff0000;">&quot;vbuntu.vdi&quot;</span></pre></div></div>

</li>
</ol>
<p>Let me know if you have any suggestions or comments as to the process I just described.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.arextech.net%2Findex.php%2F2009%2F07%2Frunning-a-virtual-in-virtualbox-from-cli%2F&amp;title=Running%20a%20virtual%20machine%20in%20virtualbox%203.0%20from%20the%20command%20line" id="wpa2a_12"><img src="http://blog.arextech.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.arextech.net/index.php/2009/07/running-a-virtual-in-virtualbox-from-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

