<?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>grelbar &#187; Howto&#8217;s</title>
	<atom:link href="http://grelbar.net/archives/category/howtos/feed" rel="self" type="application/rss+xml" />
	<link>http://grelbar.net</link>
	<description>just another hacker&#039;s blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 07:28:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Voiding Warranties..again</title>
		<link>http://grelbar.net/archives/660</link>
		<comments>http://grelbar.net/archives/660#comments</comments>
		<pubDate>Thu, 17 Nov 2011 07:49:50 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=660</guid>
		<description><![CDATA[- Disclaimer - I won't be responsible for anything you do to your phone, voiding waranties, setting small cats on fire, or causing your local subway system to stop working -Disclaimer- I recently got the HTC Desire Z. Slightly older, but it has the qwerty slider, which i wanted. Anyway, the HTC Sense UI default [...]]]></description>
			<content:encoded><![CDATA[<p><em>- Disclaimer - I won't be responsible for anything you do to your phone, voiding waranties, setting small cats on fire, or causing your local subway system to stop working -Disclaimer-</em></p>
<p>I recently got the HTC Desire Z. Slightly older, but it has the qwerty slider, which i wanted. Anyway, the HTC Sense UI default "shell" put on top of Android is great. By far better than the Samsung uh.. Touch Wiz thing. Smoother, and smarter. But i won't get into that. What comes with Sense UI on this phone (and i'll bet a lot of other HTC phones), is a bunch of applications. Applications that i didn't need. So obivously i tried to remove some of those applications. Turns out, to remove apps like Facebook or Twitter (that i <strong>do not</strong> want on my phone), you have to have root. I didn't find any smart way of getting rid of the apps without root, because it requires modification or removal of files that are in directories that are not world or group-writable.</p>
<p>So, after some internal debate between me and myself, i decided to root the phone. I quickly realized that the operation would not be as easy as on the Samsung, which has a fairly established and easy-to-use toolset for doing both rooting and rom management. Samsungs can also be exploited on pretty much any version of the OS.</p>
<p>However, on the HTC, i found that i had to first downgrade the firmware, so that i could use an exploit to gain root. And to make matters worse, this didn't work on it's own. I had to turn my microSD card into a "goldcard", then do the downgrade, then the exploit to gain root, and then flash the new firmware on top. In this case, i ended up with Cyanogen Mod 7.1. again, since i had good experiences with it.</p>
<p>So, let's go through the process that i had to go through. Reading a bunch of forums, i quickly got the picture that your mileage will vary. First of all, let's start with what i had. I had the HTC Desire Z (known as the HTC Vision G2, i think, in the US). I had the latest firmware, which in this case meant uh.. Android 2.3.4 (or 2.3.5), called the HTC Sense version 2.1. Anyway, the latest version available through the HTC OTA update. The phone was bought October of this year.</p>
<p>I started out with the Cyanogen Mod instructions for downgrading the phone to an exploitable firmware version on <a href="http://wiki.cyanogenmod.com/wiki/HTC_Desire_Z:_Firmware_Downgrade_%28Gingerbread%29">this page</a>. Or actually, i started out by installing the android sdk, but on arch linux it was as easy as installing android-sdk from the AUR. I use <a href="https://wiki.archlinux.org/index.php/Yaourt">yaourt </a>as a frontend, so i did a yaourt android-sdk. On a 64-bit system, i had to enable the <a href="https://wiki.archlinux.org/index.php/Arch64_FAQ#Can_I_run_32-bit_apps_inside_Arch64.3F">multilibs repository</a>, to get the necessary lib32 libraries.</p>
<p>I ran through the steps of  pushing fre3vo and misc_version on the phone, which went fine. I then did the chmods and the debug, which then got me a root shell on the phone temporarily. The next step has me setting the version for a misc_version, and then pushing the actual downgrade onto the phone. All good so far. Next step is to reboot the phone bootloader using adb (the android debugger). This also worked.... until i got a dreadful message. "CID incorrect! Upgrade fail!". CID? Wtf? Okay. Step back for a moment and google this fucker.</p>
<p>Turns out certain phones need some finetuning to be able to downgrade, due to either..carrier lockin, or some branding put on the phone, or perhaps an unknown reason (maybe hardware or software revisions?). I found <a href="http://forum.cyanogenmod.com/topic/21681-cid-incorrect-update-fail/">this thread</a> on the Cyanogenmod forums, which helped me onwards. The thread describes my exact issue, though with a slightly different downgrade firmware than mine. In any case, i decided to give it a try. The process involves the creation of a "goldcard", which is then used as a place to store the downgrade firmware. The goldcard is simply a microSD card, with the first few bytes overwritten with some new data.</p>
<p>The steps were basically:</p>
<ul>
<li>Download the goldcard helper application from the Android market. The phone was still bootable and fully operational, as no downgrade had taken place, so i was able to download and install this.</li>
<li>Using the goldcard helper, get the reverse CID for your MMC2 card. That's your microSD card. MMC0 is your internal memory and can't be used for this, as far as i've read.</li>
<li>Taking the reverse CID for your microSD card from the program, input it into the goldcard page (a link is also in the application).</li>
<li>The site generates an image, which you will download</li>
<li>Download also a hex-editor, such as <a href="http://download.cnet.com/HxD-Hex-Editor/3000-2352_4-10891068.html">HxD</a></li>
<li>Take your microSD card out of your phone and put it into a memory card reader (i also read you can use your phone as the reader, but i used a Kingston reader instead), and open up the card from the <a href="http://theunlockr.com/2010/03/10/how-to-create-a-goldcard/">HxD editor using</a> the extra tab, then the open disk menu and under <strong>physical disk</strong> selected the removable disk which was the microSD card. <strong>Make sure that read-only is not checked when opening the microSD card. </strong></li>
<li>Open up another tab by opening from the extra tab "open disk image", and load the .img file that you got from the goldcard site. <strong>Also uncheck the read-only checkbox here. </strong>Use the default 512 byte sector size. You should now have two tabs open.<strong><br />
</strong></li>
<li>From the goldcard.img tab, do a select all, then copy. Go to the microSD tab, and select offsets 00000000 to 00000170 and from the edit menu do a "paste write". This will paste the content of the goldcard.img, to the first offsets of the microSD card.</li>
<li>From the file menu, save what you've done. Accept / ignore all warnings.</li>
<li>Ok, now you have a gold card.</li>
</ul>
<p>Proceed by copying over the downgrade image to the newly created goldcard. Continue with the CyanogenMod instructions.Following the instructions for the downgrade, you can safely redo all the steps to make sure. Once you are ready, reboot the bootloader again. You should now have great success, in the words of Borat. Navigate with the volume up and down keys, and select using the power or the navigation-touchpad thing-button. Select bootloader, then select fastboot. Confirm that you want to go ahead if necessary.</p>
<p>This will take a moment. You'll then be downgraded to an earlier version of the firmware, which has a known exploit, allowing us to root the phone. The phone will (i think) reboot on it's own, and give you an older looking Sense UI.</p>
<p>Continue with the rooting instructions <a href="http://wiki.cyanogenmod.com/wiki/HTC_Desire_Z:_Rooting">here</a>. Basically you are downloading and pushing onto the phone a bunch of packages that are needed. Then, you're running the actual exploit which should find a register in the memory, which we will use to sneak in (i think this is a correct analysis of what goes on, though i'm no programmer). Remember to match those md5 sums listed in the instructions before going on.</p>
<p>After this you have a rooted phone, hopefully with clockwork recovery mod installed. You can now keep using the Sense UI thing (i'm not sure that it'll OTA upgrade anymore?), or install Cyanogenmod, using <a href="http://wiki.cyanogenmod.com/wiki/HTC_Vision:_CyanogenMod">these instructions</a>. For some reason, i either failed some part, or something failed, but i didn't have clockwork recovery mod installed after this process. No sign of CWM anywhere. So, i headed on to the market, and downloaded the thing from there. I was now ready to install Cyanogen, which went without incident.</p>
<p>Note, that if you can't get into recovery mode using the restart into recovery (from the normal shutdown menu, after installing CWM), shut down the phone, and use Power, volume down and the navigation thing pressed all together.</p>
<p>Ok, so now i have Cyanogenmod 7.1.0 on my HTC Desire Z, with Android 2.3.7 on the bottom. Nice! Quadrant scores (yes yes, synthetic benchmarks..) went from 900 to about 1900 compared to the latest Sense UI. Phone feels snappy.</p>
<p>One thing to note was that market <a href="http://forum.cyanogenmod.com/topic/32805-android-market-crashes/">kept crashing</a>! I was getting worried for a moment, but then i remembered the internet, found that thread, and fixed the problem. After downgrading, rooting and installing Cyanogen, i had the phone set to a language called English HD. I selected English US, and my problem was gone. So note this.</p>
<p>Winamp keeps crashing now, but it did that on the Sense UI side, so i doubt it has anything to do with Cyanogen. Version 1.2.6 is the latest as i'm writing this, and there is no later version available. The default media player, though, is pretty usable in any case, so i'm just using that for now.</p>
<p>Now, if i could just install this Cyanogen Nightly build... <img src='http://grelbar.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/660/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Friday Ubuntu Tip</title>
		<link>http://grelbar.net/archives/621</link>
		<comments>http://grelbar.net/archives/621#comments</comments>
		<pubDate>Fri, 22 Jul 2011 09:12:59 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=621</guid>
		<description><![CDATA[I was trying to customize Ubuntu just a bit, in regards to the "special folders", that is, ~/Public, ~/Videos etc. These are special, in that they are recreated and/or renamed every time you log in, back to their defaults. Where are these defaults you ask? So did i, and the answer is pretty simple, and [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to customize Ubuntu just a bit, in regards to the "special folders", that is, ~/Public, ~/Videos etc. These are special, in that they are recreated and/or renamed every time you log in, back to their defaults. Where are these defaults you ask? So did i, and the answer is pretty simple, and easy to fix.</p>
<p>The main reason, not that anyone gives two shits, is that i wanted the directories to be lowercase only, because i hate hitting shift all the time to refer to the directories. Also, i don't like directories that i can't rename, remove or do whatever i like to. Kills the linux ethos in my humble opinion. Anyways, to the fix:</p>
<p><strong>To rename the folders: </strong></p>
<p>Edit a file in your home directory called .config/user-dirs.dirs. Syntax should be obvious.</p>
<p><strong>To remove one or more folders and stop them from being recreated:</strong></p>
<p>Edit a file called /etc/xdg/user-dirs.conf. Change the enabled=True, to enabled=False</p>
<p>Any renames or removes of the directories will keep after this.</p>
<p>Note that you have to atleast log out and then back in for the settings to be applied.</p>
<p>Thanks for this tip goes to http://superuser.com</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/621/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saving Google Video and other assorted gimmicks</title>
		<link>http://grelbar.net/archives/545</link>
		<comments>http://grelbar.net/archives/545#comments</comments>
		<pubDate>Wed, 20 Apr 2011 19:44:30 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=545</guid>
		<description><![CDATA[Google Video is shutting down as of the end of this month. Video's will be available for download for some time after that, but then it gets the big shift+delete over at the Goog. The Archive Team sprung into action once again to save this potential treasure trove of digital information that would bite the [...]]]></description>
			<content:encoded><![CDATA[<p>Google Video is <a href="http://www.deaddyingdamned.com/assets/Google_Video_Shutdown_Email.html" target="_blank">shutting down</a> as of the end of this month. Video's will be available for download for some time after that, but then it gets the big shift+delete over at the Goog. The Archive Team sprung into action once again to save this potential treasure trove of digital information that would bite the binary bullet if not saved in time. Currently, there is an effort to save all the material at Google Video before they pull the plug. I decided to join in on the fun, since i have a metric shitload of bandwidth and storage to the point of sheer irrelevance. The amount of material is estimated to be between 100 and 200 TB (or more if some sources are to be believed) There are some guestimates, but i'm not sure we can accurately say yet.</p>
<p>To help out, first read this page: <a href="http://archiveteam.org/index.php?title=Google_Video" target="_blank">http://archiveteam.org/index.php?title=Google_Video</a>, and then decide how to help out. You can use almost any operating system imaginable, and there are people working on improved instructions and scripts all the time. Personally i've used both ubuntu and windows to do some downloading.</p>
<p>You can:</p>
<ul>
<li>Help index videos (if you have lower bandwidth and/or storage</li>
<li>Help download videos and later upload them to archive.org</li>
<li>Help people out on IRC (#googlegargle #archiveteam and #boincgoogle on the EFNET network)</li>
<li>Help improve or test scripts and methods</li>
</ul>
<p>It has been awesome watching the community at work. Within a matter of hours, multiple people were downloading videos, and we have hundreds of gigabytes down already. People were working day and night (thanks to timezones)  developing scripts and helping people out. Jason Scott of <a href="http://textfiles.com/" target="_blank">textfiles.com</a> fame is also an active with Archive Team, and is on IRC helping out as well and organizing things on different levels. There are people buying time and storage from the Amazon cloud to help with the effort. The dedication and friendliness of the people is simply amazing. People just show up and help with the effort without any personal gain. On the contrary, people are willing to offer their own personal time, storage and bandwidth for such an altruistic cause. Sure, most of those videos are probably irrelevant, but then, who can say what is going to be interesting to see in 10, 20, 30 years? Local news from Malaysia? "Real life Mortal Combat" ? Who knows. That's kind of the point behind all this. Saving stuff that would otherwise be lost forever.</p>
<p>The Archive Team have so far dished out like 140TB of storage, with more promised as we start filling that up.</p>
<p>So anyway, if you feel like this is something you could get into, go read the page and see how you can help out. Personally i'm downloading videos and putting them on my fileserver that has a (mostly) empty 1TB drive. And what the hell else would i use my 200/10 Mbit bandwidth for if not this? Sheesh.</p>
<p>--</p>
<p>In other more generic news, we think we may have found an apartment. A three room place, not far from here. It should be fully renovated, and the rent is cheaper than in our current (too large) apartment. We're going to go look at it tomorrow, but it's already reserved for us, if we choose to take it. I have a good feeling about this.</p>
<p>I'm still trying to get rid of the aquarium, and i'm also in the process of selling my 2003 Nissan Primera stationwagon. I need to clean it out a bit first, and get it checked out so it's street-legal.</p>
<p>Work is busy as ever, and i am very thankful to all Christians who have kindly provided us with the four-day weekend this week. And all this because of the death of an imaginary jewish carpenter zombie. Imagine that.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/545/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTPC Ubuntu 10.10 Upgrade</title>
		<link>http://grelbar.net/archives/525</link>
		<comments>http://grelbar.net/archives/525#comments</comments>
		<pubDate>Thu, 24 Mar 2011 07:11:37 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=525</guid>
		<description><![CDATA[&#160; Yesterday i started upgrading the HTPC to Ubuntu 10.10. I was having some problems with audio (no doubt related to pulseaudio....) and i had a bunch of updates waiting to be installed that i didn't dare install. I have this nagging feeling that every time i do an apt-get upgrade, something breaks in XBMC. [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Yesterday i started upgrading the HTPC to Ubuntu 10.10. I was having some problems with audio (no doubt related to pulseaudio....) and i had a bunch of updates waiting to be installed that i didn't dare install. I have this nagging feeling that every time i do an apt-get upgrade, something breaks in XBMC. Might just be a feeling. Might not. Anyway. I started with a clean install of 10.10, installing propietary codecs and updates from the web during the install. After the installation, i tried to remove pulseaudio. I did an apt-get remove --purge pulseaudio, which still left some libraries like libpulse0 and others. I tried removing them by hand, but that resulted in some dependency-errors. Further trying to remove that resulted in me not having a stable gnome desktop to log into. It started GDM, but after that i just got returned to the login window. I did an apt-get install ubuntu-desktop, and a reboot, which fixed the problem. Then again apt-get remove pulseaudio, and left it at that.</p>
<p>After that i added a few PPA's to keep my Nvidia and ALSA-drivers current. Alsa works better with XBMC, handling both Dolby Digital, DTS, as well as MP3 and other stereo audio. The latest Nvidia drivers have not always been problem-free, but i decided to give them a try. The PPA's i added were from <a href="http://xbmcmediacenter.com/alsa-drivers-linux-always-updated/" target="_blank">this</a>, and <a href="http://xbmcmediacenter.com/linux-nvidia-drivers-always-updated/" target="_blank">this</a> site, and the complete commands were:</p>
<blockquote>
<pre>/ some dependencies first /
sudo apt-get install dkms python-software-properties

sudo reboot 

/ after the reboot install the nvidia drivers /

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings

/installing the audio drivers/

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-$(uname -r)

sudo add-apt-repository ppa:ricotz/unstable
sudo apt-get update
sudo apt-get install linux-sound-base alsa-base alsa-utils</pre>
</blockquote>
<p>After this, i rebooted, and ran sudo alsamixer. This starts a console-based mixer-application, that you can use to un-mute required outputs. Sometimes tihs is needed to get audio out at all, if you're using for instance HDMI (i haven't tried this), or say some analog output.</p>
<p>Then i added the XBMC ppa, which allows me to install the latest version.</p>
<blockquote>
<pre>/ some dependencies /
sudo apt-get install python-software-properties pkg-config
sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
/ and the actual xbmc packages /
sudo apt-get install xbmc xbmc-standalone</pre>
</blockquote>
<p>Finally, starting XBMC produced an error that i didn't have the required packages for hardware acceleration installed. I downloaded the libvdpau package, which cleared the problem.</p>
<p>XBMC seemed really well configured at this point already, because sound worked out of the box (thank you and goodbye pulse, and thank you alsa). Also, video acceleration was configured correctly out of the box. This is a stark difference to some of the old old versions of XBMC i had once installed.</p>
<p>I tried some playback already, but not in the living room with the amplifier and TV, so that's up for later today. The current setup i have is:</p>
<ul>
<li>Samsung 40B535 40" LCD television</li>
<li>Harman/Kardon AVR-235 amplifier</li>
<li>HTPC
<ul>
<li>Silverstone HTPC-case, incl. 120W power supply (model Lascala SST-LC19S-R) - Current price <strong>173€</strong></li>
<li>ASUS AT3N7A-I motherboard with an Intel Atom processor (dual core 1,6 GHz), Nvidia ION chipset/graphics - Current price <strong>155€</strong></li>
<li>2GB DDR2 memory - Current price <strong>28€</strong></li>
<li>1 TB Western Digital Green hard drive - Current price <strong>58€</strong></li>
<li><strong>Totally 414€ with current prices</strong></li>
</ul>
</li>
<li>Connectivity
<ul>
<li>HTPC -&gt; TV with HDMI</li>
<li>HTPC -&gt; Amplifier with SPDIF (optical cable)</li>
<li>Wireless Logitech mouse with the Universal Nano Receiver (model M215, red)</li>
<li>Wireless Logitech keyboard (an older Logitech Comfort)</li>
<li>Network: 1Gbit through an HP Procurve 1400-series switch</li>
</ul>
</li>
</ul>
<p>Things to note here. The price of the entire thing hasn't gone down much in a year or so, which is pretty curious. You can get better ION motherboards now, so that's probably something i'd change. Maybe with WLAN or more i/o ports? Perhaps. The case i am pleased with, though it could be entirely passive. The ION/Atom combo, plus the mechanical hard drive create a lot of heat,  and i think that this set couldn't run without the CPU fan.</p>
<p>I would also switch to a bigger HD, since the amount of media has exploded. A 2TB drive is like 10 bucks more, or so. 3TB drives have just been released, though they are still rather expensive.</p>
<p>A remote control would be nice, but i've yet to spend any time researching that. I'm pretty good with just the mouse so far. I don't need that far of an integration to the living room. It's still a computer to me, and not an appliance.</p>
<p>The final afterthought goes toward a Blu-ray drive. The case fits a slim Blu-ray drive. The price of such a device is like 100-200€ depending on the model (i'm not sure they all fit?). I've read many positive reports that say Blu-Rays work just fine with Ubuntu + XBMC, but i have no first-hand experience. I may go this route, or i may just stick with the PS3, which seems like a great player.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/525/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Lab is growing&#8230;</title>
		<link>http://grelbar.net/archives/478</link>
		<comments>http://grelbar.net/archives/478#comments</comments>
		<pubDate>Tue, 23 Nov 2010 13:57:00 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=478</guid>
		<description><![CDATA[Okay so i'm having two people move in with me, since the wife took off and left me with a 100 m^2 appartment which is costing me..well quite a few euros. It's not that i can't afford it, but i can't afford it comfortably. Comfort is the key issue here. Having someone, or in this [...]]]></description>
			<content:encoded><![CDATA[<p>Okay so i'm having two people move in with me, since the wife took off and left me with a 100 m^2 appartment which is costing me..well quite a few euros. It's not that i can't afford it, but i can't afford it <em>comfortably. </em>Comfort is the key issue here. Having someone, or in this case, two someones, to split the rent with, will help me greatly, and i can perhaps afford to buy some technology and other things that make me happy. Being a materialistic asshole to begin with.</p>
<p>Currently, i'm running all my equipment off a 160x80cm IKEA Galant desk, with the T-legs. This is going to be extended by another 120x80 piece, making the total desk space 280x80. On this desk i'm gonna fit three workstations (one for each occupant of this new, curious household), and under the desks will be some of my servers and other testing gear.</p>
<p>My shelf that previously housed a number of small boxes containing various spare components have now been moved away; giving way to more and more books. Like actual literature.</p>
<p>Also what is going on is i'm gonna be updating Dorsia to OpenBSD 4.8, possibly even today. I hope the pf configurations haven't changed that much since 4.7, though i wouldn't mind learning the new syntax properly. The hardware is also changing to a different box. Currently it's a mishmash of older parts in some generic case. What i have in mind is an old HP workstation, that i have slightly pimped out. Nothing spectacular. Also, DynDNS stopped offering  the .homeunix.org domain for the free users, and since i'm a cheap bastard, i'm gonna keep doing the free service since that's basically all i need. The new domain will have to be something else.</p>
<p>And to add insult to injury, i'm rigging up a server at work, since that's something i could use as a proper virtualization platform. I'm thinking of running a debian based linux, with virtualbox.  I  might change my mind, but i really like virtualbox; it does everything i need and it's free.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/478/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pyrit 0.3.0 with ATI graphics cards</title>
		<link>http://grelbar.net/archives/462</link>
		<comments>http://grelbar.net/archives/462#comments</comments>
		<pubDate>Tue, 05 Oct 2010 20:08:28 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>
		<category><![CDATA[ati]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[opencl]]></category>
		<category><![CDATA[pmk]]></category>
		<category><![CDATA[pyrit]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=462</guid>
		<description><![CDATA[Inspired by this post on the Pauldotcom website, i decided to reinstall Pyrit on my machine, and see how it has evolved. Pyrit is a program that allows you to use your graphics card (and cpu) to perform calculations relating to cracking WPA pairwise masterkeys. GPUs are considerably faster than CPU's at such calculations. I [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by <a href="http://pauldotcom.com/2010/10/your-password-cracking-system.html" target="_blank">this post on the Pauldotcom website</a>, i decided to reinstall Pyrit on my machine, and see how it has evolved. Pyrit is a program that allows you to use your graphics card (and cpu) to perform calculations relating to cracking WPA pairwise masterkeys. GPUs are considerably faster than CPU's at such calculations. I don't even pretend to understand all the math involved, since i sucked at math. But still, it's fun to put your hardware to new and exciting uses.</p>
<p><strong>Starting out</strong></p>
<p>The components and software involved should be mentioned, and your mileage may and <strong>will</strong> vary. Pyrit can be a real bitch to set up, and there are loads of dependencies and modifications that need to be done.</p>
<p>So what i have under the hood is:</p>
<ul>
<li>ATI Radeon HD4850 with 512MB memory</li>
<li>Gigabyte MA-GA790X motherboard with two PCI-Express slots for graphics cards</li>
<li>6 GB DDR2 memory</li>
<li>Western Digital Raptor hard drive for the OS and relevant files</li>
<li>Ubuntu 10.10 RC, 32-bit</li>
</ul>
<p>I installed the fglrx drivers using the Additional Drivers tool that is under System -&gt; Administration -&gt; Additional Drivers. These drivers are required to run any of this fancy GPU stuff.</p>
<p>Start off by installing some packages that are good to have around in any case:</p>
<ul>
<li>make</li>
<li>build-essential</li>
<li>python-dev</li>
<li>libssl-dev</li>
<li>zlib1g-dev</li>
<li>libstdc++5</li>
<li>libpcap0.8-dev (thanks to corby for this additional dependency)</li>
</ul>
<p>That <em>should</em> be enough to get everything installed, but do comment if something is missing.</p>
<p><strong>What you need to download</strong></p>
<p>You need various packages from different sites to get everything you need, as these packages are not in the standard ubuntu repositories. If you know of a repository that provides these, do tell. But i think ATI/AMD want to keep stuff behind their EULAs.</p>
<ul>
<li><a href="http://code.google.com/p/pyrit/downloads/list" target="_blank">Pyrit 0.3.0 - The Pyrit program</a></li>
<li><a href="http://code.google.com/p/pyrit/downloads/list" target="_blank">Cpyrit-OpenCL - The OpenCL packages for Pyrit</a></li>
<li><a href="http://developer.amd.com/gpu/ATIStreamSDK/Pages/default.aspx" target="_blank">ATI Stream 2.2 SDK</a></li>
<li><a href="http://developer.amd.com/gpu/ATIStreamSDK/Pages/default.aspx" target="_blank">ATI Stream license package</a></li>
</ul>
<p>Just get the packages for now, and move on to the next chapter to install them.</p>
<p><strong>Installing it all</strong></p>
<p>Start by installing the ATI SDK. Take the package you downloaded and unzip/untar it somewhere, i used my home folder for the example. Next, we'll set a few environment variables (replace username with your username, and/or the location with whereever you put the files):</p>
<blockquote><p>export ATISTREAMSDKROOT=/home/username/ati-stream-sdk-v2.2-lnx32<br />
export ATISTREAMSDKSAMPLESROOT=/home/username/ati-stream-sdk-v2.2-lnx32/samples<br />
export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86:$LD_LIBRARY_PATH</p></blockquote>
<p>Also, let's create a directory and some symlinks:</p>
<blockquote><p>sudo mkdir -p /usr/lib/OpenCL/vendors<br />
sudo ln -sf /home/username/ati-stream-sdk-v2.2-lnx32/lib/x86/libatiocl32.so /usr/lib/OpenCL/vendors/libatiocl32.so</p></blockquote>
<p>Okay, now we should be ready to install the OpenCL license file, so as root, move that file over to your root directory, and run <em>tar xfz </em>icd_registration.tgz</p>
<p>Basically that places a file inside /etc/opencl and does some magic to make the whole thing work... no idea why this step is needed, but ATIs word is law here.</p>
<p>We should now be able to make the Stream SDK, so go to the folder you unzipped the SDK, and as root, run make. Wait for a while, and then go to samples/opencl/bin/x86/ and run ./HelloCL. This should produce a message indicating success. This means your SDK is properly installed and working. Problems here indicate an error with the symlinks or environment variables.</p>
<p><strong>Building and Installing Pyrit 0.3.0</strong></p>
<p>Unzip/tar whatever the pyrit and the opencl packages to a location of your choosing. Start with the actual pyrit package. Head on into the folder, and run the following:</p>
<blockquote><p>python setup.py build<br />
sudo python setup.py install</p></blockquote>
<p>After that finishes, go to the cpyrit directory and using your favorite editor, open up setup.py and find the following location, adding the bold section:</p>
<blockquote>
<pre>for path in ('/usr/local/opencl/OpenCL/common/inc', \
           '/opt/opencl/OpenCL/common/inc', \
           '<strong>/home/username/</strong><strong>ati-stream-sdk-v2.2-lnx32</strong><strong>/include', \</strong>
           '/usr/local/opencl/include'):</pre>
</blockquote>
<p>This is because otherwise, you'll end up with errors the refer to some libraries that are only in that location, so you need to tell it where to find them. After your are done editing, doublecheck the path, and save the file. Then you'll want to build and install the cpyrit stuff, by running the exact same commands as with the actual pyrit package.</p>
<p>When you're done you can try:</p>
<blockquote><p>pyrit list_cores</p>
<p>0r</p>
<p>pyrit benchmark</p></blockquote>
<p>You should see something like this for the list_cores:</p>
<p><a href="http://grelbar.net/wp-content/uploads/2010/10/pyrit.png"><img class="aligncenter size-medium wp-image-463" title="pyrit" src="http://grelbar.net/wp-content/uploads/2010/10/pyrit-300x119.png" alt="Pyrit list_cores output" width="300" height="119" /></a></p>
<p>So now you can see your GPU (or GPUs) and your regular CPU cores ( minus one core, used to handle the data to and from the GPU). With new versions of Pyrit, there's also the Network-Clients entries. I haven't looked into that yet, but maybe i will in a later post. You should be able to hook up multiple hosts. Or something.</p>
<p>After this you could run a <em>pyrit benchmark</em> to see just how well it performs. Mine got around 16000 PMK/s, and around 350 per core of my Phenom II X4 3ghz.</p>
<p>You should also add the environment variables to your .bashrc or equivalent so they get loaded every time you boot.</p>
<p>Installation is a bitch, and i worked for a few hours to get all this running. If you get weird results; reboot, check all the steps and try again. You can always build pyrit and cpyrit again if things go batshit.</p>
<p>I'll try to answer any questions, so post them in the comments section.</p>
<p><strong>sources:</strong></p>
<p>For this article, i used the following sources. Biggest source by far was http://beta.ivancover.com/wiki/index.php/Pyrit_setup, which has basically all of these steps and a bit more, but i updated and added where i thought it would add clarity, or if something changed with Ubuntu 10.10.</p>
<p>Other good sources are:</p>
<ul>
<li>http://developer.amd.com/gpu/ATIStreamSDK/assets/ATI_Stream_SDK_Getting_Started_Guide_v2.2.pdf</li>
<li>http://developer.amd.com/gpu/ATIStreamSDK/assets/ATI_Stream_SDK_Installation_Notes.pdf</li>
<li>http://code.google.com/p/pyrit/wiki/Installation</li>
<li>http://code.google.com/p/pyrit/</li>
</ul>
<p>So thanks to all these sources. I would have gotten nowhere without them.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/462/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Samsung Galaxy S, pt. 3, My Favorite Applications</title>
		<link>http://grelbar.net/archives/458</link>
		<comments>http://grelbar.net/archives/458#comments</comments>
		<pubDate>Sat, 28 Aug 2010 06:07:01 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=458</guid>
		<description><![CDATA[Ok, so you have your phone rooted, updated and lag-fixed. You want some apps? Here are my picks: Android Terminal Emulator (Well, it's a terminal emulator) Quadrant (For benchmarking and cock-measuring contests) IMDB (Because i love my movies) Spotify (Great if you have the.. Unlimited? Premium? Whatever it's called nowadays account) XBMC remote (Control your [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so you have your phone rooted, updated and lag-fixed. You want some apps? Here are my picks:</p>
<ul>
<li>Android Terminal Emulator (Well, it's a terminal emulator)</li>
<li>Quadrant (For benchmarking and cock-measuring contests)</li>
<li>IMDB (Because i love my movies)</li>
<li>Spotify (Great if you have the.. Unlimited? Premium? Whatever it's called nowadays account)</li>
<li>XBMC remote (Control your XBMC media center on your phone!)</li>
<li>FMI Helsinki Testbed (great weather app for the Southern Finland area)</li>
<li>Market Access (allows me to pay for applications. Paid apps are not available in Finland officially)</li>
<li>Advanced Task Killer (kills apps left open in the background)</li>
<li>Facebook / Twitter / Other Web 2.0 Socialwhoring apps</li>
<li>Astro File Manager (Look at your filesystems. More functionality than the built in "My Files")</li>
<li>Barcode Scanner (handles all kinds of barcodes and can do searches online)</li>
<li>Instant Heart Rate (This one was fun, measures heart rate using camera)</li>
<li>Droidopas (Helsinki area public transport guide, by my good friend Anteuz)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/458/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Samsung Galaxy S, pt.2 &#8211; Firmware Update &amp; Lagfix</title>
		<link>http://grelbar.net/archives/454</link>
		<comments>http://grelbar.net/archives/454#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:54:58 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=454</guid>
		<description><![CDATA[Short disclaimer: Flashing your phone may be illegal, immoral and may cause damage to your phone and/or soul. I take no responsibility for any actions you may or may not take. Proceed with caution, and remember, i don't care if you brick your phone; even though that should be pretty hard to do! So time [...]]]></description>
			<content:encoded><![CDATA[<p><em>Short disclaimer: Flashing your phone may be illegal, immoral and may cause damage to your phone and/or soul. I take no responsibility for any actions you may or may not take. Proceed with caution, and remember, i don't care if you brick your phone; even though that should be pretty hard to do!</em></p>
<p>So time for part two.</p>
<p>As of August 2010, The Samsung Galaxy S (European Model) ships with Android 2.1, also known as Eclaire. While it's a pretty stable version of Android, where everything works sort of, it's not very fast or optimized. 2.2 or Froyo, will bring out the heat, and make this into the fastest device on the market.</p>
<p>Want to acchieve this speed boost right now? Thought so. You can do it, with Android 2.1, by doing a few simple hacks:  Upgrade to a later build (unofficial), and install the One-Click Lagfix. I'll try to explain both:</p>
<p>- The newer build of 2.1 (currently JM6 is the name assigned to the latest firmware) will improve some functionality, mostly not related to speed, but for instance GPS functionality. The builds are unofficial and come from..various sources. I won't link to them here, as i'm unsure of their legality, but i can say that they work just fine. Paranoid users might want to skip this, as this would be the perfect slot to slide in malware or other nasties to peoples phones.</p>
<p>- The lagfix adresses one of the more serious issues with 2.1, namely performance. The Galaxy S phone uses an RFS filesystem on the internal flash memory, which is far from perfect or optimized for such a platform. The problem is visible as general sluggishnes, for instance while flipping from page to page, or doing things in quick succession. The lagfix creates an ext2 filesystem within a file inside the internal memory, and places system files there, which is clearly visible as a highly increased performance. No more sluggishness anywhere. Synthetic benchmarks, such as Quadrant show an increase of over 1000 points. But subjective usage improvements are, of course, most important. The lagfix used to be much more complicated (while not impossible) but is now available as an application in the Android Market, and offers "One-click" installing.</p>
<h2>Firmware Update</h2>
<p>Updating the firmware is not an easy process for JoeBob69, but for someone who has played with gadgets and computers for a while, it's no trouble at all. The things you need to start updating your firmware are:</p>
<ol>
<li>An installation of Microsoft Windows (i have <strong>not</strong> tried this through wine, but it might work</li>
<li>Samsung Kies, or just the driver for the phone. When you connect your phone with the provided  MicroUSB cable, Windows should detect the phone. This isn't specifically needed for this phase, but you will need it for the lagfix.</li>
<li>Odin 1.0. This is the actual firmware flashing program.</li>
<li>The correct .pit file, which for the Galaxy S with 2.1 Android is the s1_odin_20100512.pit. Again, i won't link to it, you can find it through google</li>
<li>The firmware you want to install. The fastest one right now seems to be the 2.1 build JM5. The 2.2 builds are as of this time not yet good choices, and usually slow. Firmware packages need to contain three files (two in some cases, but i won't go in on that issue here): CSC, Phone and Modem. They can be of different versions internally, for instance, my phone now has a JM6 Phone firmware, a JM1 modem and a JM3 CSC package.</li>
</ol>
<p>Start out by setting your phone in download mode.</p>
<ol>
<li>Make any necessary backups. Your contacts, SMS messages and Emails will not survive. Stuff under /sdcard on the phone will most likely survive (pictures, media, etc.), but take precautions here. Smart people sync their stuff elsewhere, like Google. They already have everything they need about you, so don't worry.</li>
<li>Shut down the phone, and if you like, remove the sim card and any microSD card you might have inserted.</li>
<li>Press down the Home key and the Volume Down button, then the power button.</li>
<li>Phone should start to a black and yellow "Download" mode, with the classic Android mascot</li>
<li>Start up Odin on your PC, but DO NOT hook up your phone yet.</li>
<li>In Odin, select your pit file, and on the left side, check all three boxes (Re-partition, Auto-Reboot and F. Reset Time)</li>
<li>At this point, hook up your phone, and wait for Odin to detect it. The status box should read "Device added!" or similar.</li>
<li>Hit Start on the right side. Wait for the phone to reboot, and Odin reports PASS with green background.</li>
<li>Remove the battery and disconnect the phone. Boot it up to Download-mode again, but don't hook it up to your PC yet.</li>
<li>Restart Odin, and this time don't add the .pit file. Instead add the three firmware packages under Phone, Modem and CSC. They should be individual .tar packages. Don't try to open them.</li>
<li>Remove the checkmark from Re-partition, on the left, but leave the other two.</li>
<li>Connect your phone and wait for it to be picked up by Odin.</li>
<li>Hit Start, and wait for it to go to PASS, again.</li>
</ol>
<p>Depending on the firmware you may have downloaded, you may get a funky language on your first boot. You can fix it with the following "Blind-Guide":</p>
<ol>
<li>In the Home-screen, hit the left function key to get the menu up.</li>
<li>Select Settings, which is the Gear-icon, in the bottom right corner of the menu.</li>
<li>Select Locale and text, the icon is a grey box, with the capital letter A inside.</li>
<li>Hit Select Local. This is the top item in the menu.</li>
<li>You should now find your locale from the list.</li>
</ol>
<p>You may also need to restore your backups, and your APN settings for mobile broadband and MMS. Follow operator directives for these, as they will probably be lost during the firmware update. Android 2.2 will fix this, allowing you to do updates Over the Air, without losing your stuff.</p>
<h2>Lagfix</h2>
<p>The lagfix, which is a <strong>must</strong> for any Samsung Galaxy S owner, has now been made very simple. Open up market, and search for Samsung Galaxy S. You should see the One Click Lagfix. Download and install. Start it up, and install ext2 tools, and then the lagfix. On-screen instructions are pretty self explanatory. You can also do some kind of rooting here, but i haven't tried the functions. Reboot when asked or just let it do its thing.</p>
<p>What happens is, you'll get an ext2 file system on a part of your internal memory (you can also use a fast microSD card, which, i'm told, improves performance even more), and stuff will be run from that. This is much faster, and i am sure you'll notice the difference.</p>
<h2>Can i break something?</h2>
<p>Well, it's unlikely. You can use Odin in every scenario i've read about to restore a working firmware on your phone. I have read of a few isolated cases where things went awry, but were still fixable through some hacks.</p>
<p>Everything described here should be pretty safe, but again, i'm not liable if you brick your phone. Proceed with caution and don't forget common sense.</p>
<h2>Benchmarking</h2>
<p>A standard 2.1 off the shelf Galaxy S should get about 900 points in Quadrant ( a benchmark application you can find in the Market). After the firmware upgrade and lagfix, i'm getting around 2100 points. This is of course synthetic stuff, measuring CPU, I/O and Graphics performance. Quadrant Pro will show you more details about how the points are distributed and calculated. It seems to be very I/O focused, as the filesystem fix brings an improvement of over 1000 points.</p>
<p>On the other hand, you'll be so pleased with your smooth flowing UI that you won't really care.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/454/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung Galaxy S, pt.1 &#8211; Rooting</title>
		<link>http://grelbar.net/archives/449</link>
		<comments>http://grelbar.net/archives/449#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:36:33 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=449</guid>
		<description><![CDATA[So, i became a Droid of the Galactic Empire, and left the Cult of Steve; dumping my iPhone 3GS to some other poor sod at the office. A few weeks ago, i went out and got the Samsung Galaxy S; their current flagship model. The specs of the phone are as follows: 1,0 GHz "Hummingbird" [...]]]></description>
			<content:encoded><![CDATA[<p>So, i became a Droid of the Galactic Empire, and left the Cult of Steve; dumping my iPhone 3GS to some other poor sod at the office. A few weeks ago, i went out and got the Samsung Galaxy S; their current flagship model.</p>
<p>The specs of the phone are as follows:</p>
<ul>
<li>1,0 GHz "Hummingbird" processor (Arm Cortex A8 base)</li>
<li>2,0GB ROM</li>
<li>6,0GB Flash</li>
<li>512MB RAM</li>
<li>microSDHC slot (up to 32GB)</li>
<li>4,0" Super-Amoled screen 480x800 resolution</li>
<li>All the standards in the way of wireless, 802.11n, BT, A-GPS, HSUPA (7,2Mbit/s mobile broadband)</li>
<li>MicroUSB out, with support for TV-out</li>
</ul>
<p>Basically it has a lot more oomph than the computer i had 10 years ago, in terms of almost everything, storage, cpu, telecom, etc. Anyway. It's a nice phone, and so far i've noticed very few things to complain about. My intention is not a review per se, there are tons of those which speak for themselves. I'm gonna try to write simple-as-possible instructions for doing things like firmware upgrades, lag-fixes and other nifty tricks, as well as listing handy applications from the Android Market.</p>
<h2>rooting</h2>
<p>rooting of the phone has been made fairly simple. it consists of three distinct steps:</p>
<ol>
<li>Copy update.zip (as is, do not extract) to the /sdcard folder on your phone</li>
<li>Boot phone into recovery mode</li>
<li>Apply update.zip and wait for phone to reboot</li>
</ol>
<p>Steps are performed as follows.</p>
<p><strong>1. </strong>Go to the Homescreen and press the menu button (left of the home key), -&gt; Settings -&gt; About Phone -&gt; Usb Settings -&gt; Mass storage<br />
<strong>2. </strong>Hook up USB cable and install any drivers that might be prompted, or not. Your internal memory (/sdcard) should be mounted<br />
<strong>3. </strong>Copy update.zip to the root of that folder<br />
<strong>4. </strong>Disconnect USB cable, and shut down phone<br />
<strong>5. </strong>Boot phone so that you first press the volume up key on the side of the phone, and the home button, and keep holding them down, while pressing the power button. Phone will boot into recovery mode. Release all buttons as soon as you see text scrolling by. This will come after the Samsung logo.<br />
<strong>6. </strong>Using the volume up and down keys, select the menuitem called "Apply update.zip", and press the Home key to confirm. Rooting will commence, and phone will reboot after it's done.<br />
<strong>7. </strong>You will have two new menu entries in your phone under the Applications menu: "Superuser permission" and "BusyBox Installer".<br />
<strong>8. </strong>Open up the BusyBox Installer and upgrade to the latest version, or do it through the Android Market.</p>
<p>You now have a rooted phone, which can access any part of the phone filesystem, and allows you to use su to gain superuser permissions to do whatever you want. Get a terminal app from the Market, or do whatever you please. You can't really break it, since you can always use Odin to reflash the phone, should something go pear-shaped. I'll cover this in my next post.</p>
<p><em><strong>Edit:</strong></em> Small corrections in terminology, download mode -&gt; recovery mode. Thanks Anteuz.</p>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/449/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A word about Solaris Zones (including a cheat sheet)</title>
		<link>http://grelbar.net/archives/417</link>
		<comments>http://grelbar.net/archives/417#comments</comments>
		<pubDate>Wed, 19 May 2010 20:39:35 +0000</pubDate>
		<dc:creator>grelbar</dc:creator>
				<category><![CDATA[Howto's]]></category>

		<guid isPermaLink="false">http://grelbar.net/?p=417</guid>
		<description><![CDATA[I thought i'd do a short write up on my experience with Solaris 10 Zones. So here goes. Solaris Zones, or Containers, are a type of virtual machine, created on top of a Solaris 10 host operating system. That's right, it needs a host operating system, so it's not something like ESX that installs on [...]]]></description>
			<content:encoded><![CDATA[<p>I thought i'd do a short write up on my experience with Solaris 10 Zones. So here goes.</p>
<p>Solaris Zones, or Containers, are a type of virtual machine, created on top of a Solaris 10 host operating system. That's right, it needs a host operating system, so it's not something like ESX that installs on bare metal with VM's on top of that. Zones are one of the two types of virtual machines that you can do with Solaris; the second being Logical Domains. The difference between the two is that LDOMs can only be installed on pure SPARC hardware, and can utilize the hardware in a different way (such as the built in crypto chip of the new T1 and T2 chips). The specifics are out there, so i won't get into that here.</p>
<p>Of the two, i like Zones because of their ease of setup. Both are easy, don't get me wrong, but zones just feel right.</p>
<p>The basic steps for setting up a zone are as follows:</p>
<ul>
<li>Install a machine with Solaris 10</li>
<li>See that you have enough disk space locally, or map appropriate network disks</li>
<li>Get network settings down before you start (your hostname and ip, gateway and dns etc.)</li>
<li>Create Zone, configure it, boot it, and configure some more</li>
<li>Install any additional software</li>
</ul>
<p>So let's get started with the "cheat sheet", "shorthand", "whatever you want to call it":</p>
<p><strong>Choosing Zone Type</strong></p>
<p>You've got your Solaris 10 installed on a machine, right? It's time to choose what kind of  zone to set up. There are two basic types. A <strong>Whole-Root </strong>Zone, or a <strong>Sparse-Root</strong> zone. The main differences are, that a Whole-Root zone does not share any of the directories of the Global Zone. This means that you can configure the system fully, like any physical machine with Solaris 10 on it. If you want to be running a lot of services that rely on stuff happening in /usr/local or you need to configure host specific files that can't be shared with other systems, or just want the system isolated for other reasons, go with the Whole-Root zone. It'll take up more space (around 3-4 gigs for a fully configured Solaris 10 system, plus anything you install on top).</p>
<p>A Sparse-Root zone has stuff shared with the Host OS, meaning if you change something on the Host, the change is immideately reflected in the sparse-root zones. This can be handy if you are running a system that needs constant changes, or are short on diskspace. But it's not good, if you need to have the zone work on it's own, with it's own configuration. It's all shared, or well most of it.</p>
<p><strong>Installation</strong></p>
<p>So back to your host OS! Make sure it's patched up and so on. Install any applications that you might think you need on every Zone you plan to install. This would be stuff like..favorite editors, wget, sudo.. whatever you fancy. Don't make it anything massive like postfix or so, because it probably won't translate too well into your Zone, and will require extensive reconfiguration anyway.</p>
<p>Start out by deciding on a zone name, and initializing it:</p>
<blockquote><p>zonecfg -z myzone</p></blockquote>
<p>Zonecfg is used whenever you want to play around with the settings of a zone, or do something fundamental with a zone, like delete it.  The -z switch is followed by a zone name, and is used almost always, when you want to specify which zone you are fiddling with.</p>
<p>After running this command, you'll be thrown into a new prompt, the zonecfg prompt. It'll look something like: zonecfg:myzone&gt;. Here, you can run commands that set the specifications of the zone, such as devices passed through from the host OS (also known as the Global Zone), filesystems you want to mount, network configuration and much more. I'll go through the most important here.</p>
<p>Next, we'll tell it to create a base configuration. For a whole-root zone, use</p>
<blockquote><p>create -b</p></blockquote>
<p>For a sparse-root zone, use:</p>
<blockquote><p>create</p></blockquote>
<p>This creates a baseline configuration, which you can look at with the <strong>view</strong> command. The main difference is, with the create command it'll make sure the correct directories are inherited, and create -b makes sure nothing is inherited.</p>
<p>After this, we'll add the zone path. This is where the operating system of the Zone will reside. Make sure you have space, so you don't run out later. If you want redundancy, make sure you have all that sorted out at this point. If you notice something is missing or not right, you can always quit from zonecfg, and return to it using the same commands as above.</p>
<blockquote><p>set zonepath=/zones/myzone</p></blockquote>
<p>This places the myzone zone under the /zones directory in your host OS.This step is performed in both whole and sparse-root installations.</p>
<p>Next, we choose whether we want the zone to boot when the host OS does. This is usually a good idea, unless you have special requirements that i don't know of. If the server goes down, and your friendly neighborhood sysadmin boots it, the zones will come up if the host does. This is good, and saves your solaris guys from doing a bunch of manual work.</p>
<blockquote><p>set autoboot=true</p></blockquote>
<p>Then we add a network interface, since you probably want the zone to talk to other hosts, and not just sit there.</p>
<blockquote><p>add net</p></blockquote>
<p>This gets you into the network configuration. prompt will say something like zonecfg:myzone:net. While in here, any commands you enter are directed toward the network configuration. Let's add an address, a network card type, and a default route.</p>
<blockquote><p>set address=192.168.1.2</p>
<p>set physical=bge0</p>
<p>set defrouter=192.168.1.1</p>
<p>end</p></blockquote>
<p>Self-explanatory, but make sure your physical card type matches that of your host system. In solaris, interface names are according to manufacturer, so use ifconfig -a to check it out in the host os if you are unsure. Zone network adapters are made as virtual interfaces under your host interface. The first zone in my example will get an interface of bge0:1 and so forth. Defrouter is not mandatory, but you can specify a default route here if you so choose.End netconfig with the end command. You are now back in the main level of zonecfg</p>
<p>After this, you may want to add an extra filesystem. It's easy:</p>
<blockquote><p>add fs</p>
<p>set dir=/applications</p>
<p>set special=/some/network/share/on/the/host</p>
<p>set type=lofs</p>
<p>end</p></blockquote>
<p>Okay, so first we enter the filesystem config with add fs. Then, we set the directory under which the mount is visible <strong>inside the zone<em>.</em></strong> This can be confusing due to the next command, set special. This command is where to point on the host operating system. Why it's called special eludes me. There's nothing special about it.The last command sets the type as local filesystem. Others are available, look them up using help inside zonecfg if necessary.Once again end to exit back to the main menu.</p>
<p>We should now be good to go. If you want to pass anything else through to the zone form the host, you can do so. For instance, adding a device is as simple as:</p>
<blockquote><p>add device</p>
<p>set match=/dev/device/*</p>
<p>end</p></blockquote>
<p>This would give you access to anything under /dev/device/ on the host machine. You can get freaky with wildcards here.</p>
<p>We can now use the view command to look at what we've done. After that's done, it's time to nut up and shut up:</p>
<blockquote><p>verify</p>
<p>commit</p>
<p>exit</p></blockquote>
<p>Verify that settings are sane, commit them (save them), and exit. We now have a zone that is in a configured state. You can view the states of your zones using:</p>
<blockquote><p>zoneadm list -civ</p></blockquote>
<p>Very useful command, but for now, we want to install the system. This means copying the OS  and packages over to your zone. Whether you did create, or create -b significantly affects the amount of stuff to be moved over, but it shouldn't take more than 10 minutes on any modern system.</p>
<blockquote><p>zoneadm -z myzone install</p></blockquote>
<p>And then for some waiting..... after you are done, you can do a listing again, and see that the status has changed from configured to installed. Now all that's left is to give the system a swift boot, and an identity.</p>
<blockquote><p>zoneadm -z myzone boot</p></blockquote>
<p>This boot's the zone. Notice that it takes like 2 seconds to do so, which is neat compared to many other solutions. After this, we have a system without the final configuration and identity. Do this by issuing</p>
<blockquote><p>zlogin -C myzone</p></blockquote>
<p>Capital C for console, since that's all we have over in the zone right now. It'll ask you a bunch of questions, and want the answers immediately! Nothing you can't handle if you made it so far. Mostly about hostnames, DNS, languages, timezones and such.When you are done, it'll save and reboot, and then get you back in a console login prompt, where you can type in your root login and password that you just set.</p>
<p>Shazam. Your zone is up and running. Configure SSH as you see fit, and access your system that way from now on. Create some users to avoid using root, etc. etc. This isn't a best practices post so i'll skip that shit now. Pretty simple, and once you have it routined, it'll take you 15 minutes to set up a new zone that is ready to use. Not bad, eh?</p>
<p><strong>Cheat Sheet</strong></p>
<p>Oh yeah and the cheet sheet, quick reference for zones:</p>
<blockquote><p>zonecfg -z zonename</p>
<p>create (for sparse root) <strong>or</strong> create -b (for whole-root)</p>
<p>set zonepath=/zone/path/on/host</p>
<p>set autoboot=true</p>
<p>add net</p>
<p>set address=nnn.nnn.nnn.nnn</p>
<p>set physical=bge0/hme0 whatever you have</p>
<p>end</p>
<p>verify</p>
<p>commit</p>
<p>exit</p>
<p>zoneadm -z zonename install</p>
<p>zoneadm -z zonename boot</p>
<p>zlogin -C zonename</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://grelbar.net/archives/417/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

