<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>A n00b’s adventure in the wonderful realm of OpenBSD.</description><title>ZeroBSD</title><generator>Tumblr (3.0; @zerobsd)</generator><link>http://zerobsd.tumblr.com/</link><item><title>Simple password generator</title><description>&lt;p&gt;While reevaluating my security practices, I came up with the conclusion that my password system is a mess. For obvious reasons, I won&amp;#8217;t talk about it much, but I realized that having a handy password generator will be a good idea. While searching a few minutes for hints and solutions, I came up with two methods that works out-of-the box on a OpenBSD machine, without needing any extra package to be installed than the default base system.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the first one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;dd if=/dev/urandom count=200 bs=1&amp;#160;2&amp;gt;/dev/null|tr &amp;#8220;\n&amp;#8221; &amp;#8221; &amp;#8220;|sed &amp;#8216;s/[^a-zA-Z0-9]//g&amp;#8217;|cut -c-16&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;#8217;s a little cryptic for a newbie (due to &lt;em&gt;sed&lt;/em&gt;), but what you have to remember is that it generates passwords with a length of 16 characters and modifying the last argument will modify your password length. It&amp;#8217;s based on &lt;em&gt;/dev/urandom&lt;/em&gt; device, so it should be safe enough.&lt;/p&gt;
&lt;p&gt;The second method uses OpenSSL:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;openssl rand -base64&amp;#160;16&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Careful, sometimes the last two characters would always be &amp;#8220;==&amp;#8221;. if you use this command, but you can get rid of this by adjusting the length of it.&lt;/p&gt;
&lt;p&gt;Now, you can use any of this commands to have a pretty secure password. But to increase the randomness of it, I use a bash script that generates a two strings, one with each method, and I&amp;#8217;ve placed a special character between them (it can be &amp;#8220;@&amp;#8221;, &amp;#8220;#&amp;#8221;, &amp;#8220;$&amp;#8221;, &amp;#8220;%&amp;#8221;, anything you like). &lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s my script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;part1=`openssl rand -base64&amp;#160;6`&lt;br/&gt;part2=`dd if=/dev/urandom count=200 bs=1&amp;#160;2&amp;gt;/dev/null|tr &amp;#8220;\n&amp;#8221; &amp;#8221; &amp;#8220;|sed &amp;#8216;s/[^a-zA-Z0-9]//g&amp;#8217;|cut -c-9`&lt;br/&gt;echo $part1%$part2&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can easily tweak the length of the each two strings and the special character between them. The example from above gives you a 16 (6+1+9) characters password, with the &amp;#8220;%&amp;#8221; characters between the two strings.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/48601361353</link><guid>http://zerobsd.tumblr.com/post/48601361353</guid><pubDate>Mon, 22 Apr 2013 11:35:00 +0300</pubDate></item><item><title>The value of good documentation</title><description>&lt;p&gt;One of the strengths of OpenBSD is its documentation. I&amp;#8217;m really glad that developers really takes it seriously, since a good manual page can save you a lot of time and troubles. Here&amp;#8217;s an example: I was trying to sort out a text file and remove duplicates. The file was above 200&amp;#160;MB.  My first approach was the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;cat list.txt | sort | uniq &amp;gt; list_m.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But after a few seconds, I received the following error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sort: /var/tmp/sort.G2bEcvsPlX: Too many open files&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let&amp;#8217;s break is down:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ sort -o list_s.txt list.txt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same error. So it&amp;#8217;s related to &lt;em&gt;sort&lt;/em&gt;, not to &lt;em&gt;cat&lt;/em&gt; or &lt;em&gt;uniq&lt;/em&gt;. First impluse: search if other had the same error. No relevant answers in the first minutes. Should I ask this on a forum? Maybe on the mailing list? That was my second impulse. But wait, let&amp;#8217;s read the manual for sort. Tried with the following arguments:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;$ sort -o list_s.txt list.txt&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same error.&lt;/p&gt;
&lt;p&gt;Ok, let&amp;#8217;s keep reading. The last paragraph reads:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;BUGS&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;span&gt;To sort files larger than 60Mb, use sort -H; &lt;br/&gt;files larger than 704Mb must &lt;/span&gt;&lt;span&gt;be sorted in smaller pieces, then merged.&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;There I have it! Good documentation doesn&amp;#8217;t just provide a quick fix for a problem but in the same time reduces &lt;/span&gt;pollution and cacophony on forums and mailing lists. And it feels good finding out the answer all by yourself.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/46238204860</link><guid>http://zerobsd.tumblr.com/post/46238204860</guid><pubDate>Mon, 25 Mar 2013 09:53:00 +0200</pubDate></item><item><title>Setting your dpi</title><description>&lt;p&gt;For a pleasant desktop experience, it&amp;#8217;s generally a good idea to have your X server run with 96 dpi (dots per inch). Other values might work as well, but I found this to be the perfect choice for my machine. Usually, the system would set this dpi value correctly, but if it doesn&amp;#8217;t or if you want to make sure it will not miss, look at your &lt;em&gt;/etc/X11/xdm/Xservers&lt;/em&gt; file and find the line that looks something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;:0 local /usr/X11R6/bin/X :0 vt05&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Modify it, to look like this (basically just insert the &amp;#8216;-dpi 96&amp;#8217; switch, as shown):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;:0 local /usr/X11R6/bin/X -dpi 96 :0 vt05&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Restart your X server. Now you&amp;#8217;ll surely have a desktop manager with 96 dpi resolution. Nice, isn&amp;#8217;t it?&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/45821554608</link><guid>http://zerobsd.tumblr.com/post/45821554608</guid><pubDate>Wed, 20 Mar 2013 08:40:00 +0200</pubDate><category>X</category><category>dpi</category><category>desktop</category></item><item><title>Permalinks and .htaccess</title><description>&lt;p&gt;If you host a Wordpress blog, like I do, you may want to enable those pretty permalinks. &lt;a href="http://codex.wordpress.org/Using_Permalinks"&gt;Wordpress documentation&lt;/a&gt; will tell you what kin of &lt;em&gt;.htaccess&lt;/em&gt; file you need in your base folder (meaning the same fodler where your&lt;em&gt; index.php&lt;/em&gt; is located for your Wordpress webiste). That&amp;#8217;s helpful, but you still need to do a few tricks to have it running on OpneBSD, if you don&amp;#8217;t want to end up seeing &lt;em&gt;404&lt;/em&gt; Errors all the time.&lt;/p&gt;
&lt;p&gt;First of all, check if &lt;em&gt;mod_rewrite&lt;/em&gt; is enabled for your &lt;em&gt;httpd&lt;/em&gt;, by making sure that you have uncommented the following line from your &lt;em&gt;/var/www/config/httpd.conf&lt;/em&gt; file:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;LoadModule rewrite_module       /usr/lib/apache/modules/mod_rewrite.so&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now you need to tell httpd to let you use .htaccess files on your webiste folder. You can do this by searching for this block:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;AllowOverride None&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;and change it to &lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;AllowOverride All&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Make sure you are within &lt;em&gt;&amp;lt;Directory &amp;#8220;/var/www/htdocs&amp;#8221;&amp;gt;&lt;/em&gt; directive when you do this.&lt;/p&gt;
&lt;p&gt;Now restart (or reload) your httpd. Change your permalinks settings from Wordpress and see the results.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/41271184336</link><guid>http://zerobsd.tumblr.com/post/41271184336</guid><pubDate>Wed, 23 Jan 2013 13:22:20 +0200</pubDate><category>server</category><category>permalinks</category><category>.htaccess</category><category>allowoverride</category></item><item><title>Enabling softupdates</title><description>&lt;p&gt;This may be quite trivial and it can be found also in the &lt;a href="http://www.openbsd.org/faq/faq14.html#SoftUpdates"&gt;FAQ&lt;/a&gt; with a simple Google search, but I&amp;#8217;ve somehow missed it until now. Enabling &lt;em&gt;softupdates&lt;/em&gt; can really boost your desktop performance. It&amp;#8217;s not something I can measure and prove it, but the general feeling is that Xfce feels faster and this time it&amp;#8217;s usable and not that laggy. There&amp;#8217;s room for speed improvements still, especially in the video card department, but I&amp;#8217;m happy with how the things are for the time being.&lt;/p&gt;
&lt;p&gt;Enabling softupdates is very simple, just edit &lt;em&gt;/etc/fstab&lt;/em&gt;, by adding the softdep keyword, as in the following example:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;fec2653dbd41594a.a / ffs rw,softdep 1&amp;#160;1&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is an example from an &lt;em&gt;/etc/fstab&lt;/em&gt; file with UUID, but it&amp;#8217;s trivial for the other, older type:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;/dev/sda0a / /ffs rw,softdep 1&amp;#160;1&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Next time you reboot, you&amp;#8217;ll enjoy the performance improvements it brings.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/34504717982</link><guid>http://zerobsd.tumblr.com/post/34504717982</guid><pubDate>Sun, 28 Oct 2012 21:15:00 +0200</pubDate><category>softupdates</category><category>desktop</category></item><item><title>Empty tar.bz2 file (follow-up)</title><description>&lt;p&gt;Remember &lt;a href="http://zerobsd.tumblr.com/post/21427506946/the-great-mistery-of-the-empty-tar-bz2-file"&gt;this problem&lt;/a&gt; I had? Well, thanks to Andrei Mureșan, it&amp;#8217;s fixed now. Apparently, cron has no idea of environmental variables when running the backup script, so I had to add the following line at the begining of my script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Works like a charm now. For future reference, he&amp;#8217;s the full, corrected and working backup script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.&lt;br/&gt;NOWD=$(date +”%F”)&lt;br/&gt;NOWT=$(date +”%T”)&lt;br/&gt;/usr/local/bin/mysqldump -u root -password \&lt;br/&gt;dbname &amp;gt; /root/databases/db.sql&lt;br/&gt;/bin/tar cvfj /home/john/backup/backup-$NOWD-$NOWT.tar.bz2 \&lt;br/&gt;/var/log /var/www /etc /root/databases&lt;br/&gt;/bin/rm /root/databases/db.sql&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://zerobsd.tumblr.com/post/30859439518</link><guid>http://zerobsd.tumblr.com/post/30859439518</guid><pubDate>Tue, 04 Sep 2012 10:54:41 +0300</pubDate><category>server</category><category>backup</category><category>script</category></item><item><title>Smart IP filter with pf</title><description>&lt;p&gt;Not long ago &lt;a href="http://zerobsd.tumblr.com/post/21375503505/more-fun-with-pf-blocking-unwanted-guests"&gt;I&amp;#8217;ve talked&lt;/a&gt; about two ways of making a good IP filter with &lt;em&gt;pf&lt;/em&gt;. The first methods involved a &lt;em&gt;pf&lt;/em&gt; table created after failed &lt;em&gt;ssh&lt;/em&gt; attempts, but the table was not persistent after reboot, and the second method had a static text file from where &lt;em&gt;pf&lt;/em&gt; could load unwanted IP for filtering. Let&amp;#8217;s merge the two methods.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s say that we already have a text file, manually created, with a selection of unwanted IPs, called &lt;em&gt;/etc/pf.blocked.ip.conf&lt;/em&gt; and you also want to filter the ones that keep knowcking on your &lt;em&gt;ssh&lt;/em&gt; door. You&amp;#8217;ll have to have this in your &lt;em&gt;/etc/pf.conf&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# static text file&lt;br/&gt;table &amp;lt;blockedips&amp;gt; persist file “/etc/pf.blocked.ip.conf”&lt;br/&gt;block in on bnx0 from &amp;lt;blockedips&amp;gt; to any&lt;/p&gt;
&lt;p&gt;# not persistent pf table&lt;br/&gt;table &amp;lt;bruteforce&amp;gt; persist&lt;br/&gt;block quick from &amp;lt;bruteforce&amp;gt;&lt;br/&gt;pass inet proto tcp from any to any port \&lt;br/&gt;ssh flags S/SA keep state (max-src-conn 5, \&lt;br/&gt;max-src-conn-rate 5/30, overload &amp;lt;bruteforce&amp;gt; flush global)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now we would like to dump the &lt;em&gt;bruteforce&lt;/em&gt; table into the &lt;em&gt;/etc/blocked.ip.conf&lt;/em&gt; file, to have a record of our unwated IPs. A simple dump command is this one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -t bruteforce -T show&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but this creates unwanted spaces that must be eliminated. We&amp;#8217;ll use &lt;em&gt;sed&lt;/em&gt; for this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -t bruteforce -T show | sed &amp;#8216;s/ //g&amp;#8217; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now the space is gone and we have a properly formatted list of blacklisted IPs. We cannot dumped it right into &lt;em&gt;/etc/blocked.ip.conf&lt;/em&gt;, because there might be the same IPs on different lines and we don&amp;#8217;t want to have a bloated file loaded by &lt;em&gt;pf&lt;/em&gt;. Let&amp;#8217;s crate a temporary file with both the content of the bruteforce table and &lt;em&gt;/etc/blocked.ip.conf:&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -t bruteforce -T show | sed &amp;#8216;s/ //g&amp;#8217;&amp;#160;&amp;#187; /tmp/ip.conf&lt;br/&gt;# cat /etc/blocked.ip.conf&amp;#160;&amp;#187; /tmp/ip.conf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Not we have to eliminate the IPs that are found more than one time in that list. We can do this with &lt;em&gt;uniq&lt;/em&gt;, but for this, our list have to be ordered with &lt;em&gt;sort&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sort /tmp/ip.conf | uniq&amp;#160;&amp;#187; /tmp/ip.final.conf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The file /tmp/ip.final.conf contains now a list with unique blacklisted IP form both out manual &lt;em&gt;/etc/blocked.ip.conf&lt;/em&gt; and from what the system catched automatically. If an IP was found on both lists, at the end it will be present in our filter only once. So, after moving along some files and cleaning, we can have a nice procedure for pf IP filtering.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;rm /etc/blocked.ip.conf&lt;br/&gt;cp /tmp/ip.final.conf /etc/blocked.ip.conf&lt;br/&gt;rm /tmp/ip.conf&lt;br/&gt;rm /tmp/ip.final.conf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We can make a shell script out of these commands and have &lt;em&gt;cron&lt;/em&gt; run it once a day for a manual and automatic, persistent &lt;em&gt;pf&lt;/em&gt; IP filter.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/26203519045</link><guid>http://zerobsd.tumblr.com/post/26203519045</guid><pubDate>Sat, 30 Jun 2012 13:14:05 +0300</pubDate><category>pf</category><category>uniq</category><category>sort</category><category>sed</category><category>server</category></item><item><title>Powering down your OpenBSD</title><description>&lt;p&gt;After running &lt;em&gt;halt&lt;/em&gt; command, the system shuts down nicely, but one thing bugged ever since I&amp;#8217;ve first played with OpenBSD: the system did not powered down without pressing the power button. I can live with that, but it&amp;#8217;s rather frustrating and I thought that&amp;#8217;s probably because OpenBSD doesn&amp;#8217;t love my motherboard, though every modern operating systems knows how to power down my system without having me pressing the button (since my hardware is not the most recent one, it has around six years already).&lt;/p&gt;
&lt;p&gt;After a quick online search, the solution for my problem revealed itself: it wasn&amp;#8217;t a driver problem, it was just a script,&lt;em&gt; /etc/rc.shutdown&lt;/em&gt; with a lonely line in it that reads:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;powerdown=NO   # set to YES for powerdown&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, I obviously modified that into:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;powerdown=YES   # set to YES for powerdown&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and voilà, my system now is powering down nicely.&lt;/p&gt;
&lt;p&gt;And if you want to be able to restart or halt your system as normal user, without &lt;em&gt;sudo&lt;/em&gt;, just add your user to &lt;em&gt;operator&lt;/em&gt; group:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ sudo user mod -G operator john&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://zerobsd.tumblr.com/post/26201378534</link><guid>http://zerobsd.tumblr.com/post/26201378534</guid><pubDate>Sat, 30 Jun 2012 11:40:00 +0300</pubDate><category>halt</category><category>reboot</category><category>shutdown</category><category>operator</category></item><item><title>Making things pretty</title><description>&lt;p&gt;As part of my OpenBSD workstation project, making things pretty is a vital task. I can&amp;#8217;t work in an ugly environment, so things have to be simple, functional and more important, coherent.&lt;/p&gt;
&lt;p&gt;One of the first things I do on a fresh OpenBSD system intended for desktop use is to install &lt;em&gt;msttcorefonts&lt;/em&gt; pack. Probably due to license reasons, you can only install this from ports, so if you don&amp;#8217;t have ports yet, just follow the &lt;a href="http://www.openbsd.org/faq/faq15.html#Ports"&gt;FAQ&lt;/a&gt; and do this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ cd /tmp&lt;br/&gt;$ ftp &lt;a href="ftp://ftp.openbsd.org/pub/OpenBSD/5.1/ports.tar.gz"&gt;ftp://ftp.openbsd.org/pub/OpenBSD/5.1/ports.tar.gz&lt;/a&gt; &lt;br/&gt;$ cd /usr &lt;br/&gt;$ sudo tar xzf /tmp/ports.tar.gz&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now that we have the ports installed, do this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# cd /usr/ports/fonts/msttcorefonts &lt;br/&gt;# make install&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;#8217;s all on the &lt;a href="http://www.openbsd.org/faq/truetype.html"&gt;FAQ&lt;/a&gt;, just pointing it out.&lt;/p&gt;
&lt;p&gt;Now, for one reason or another, you may need some GTK3 application. I use Xfce and I&amp;#8217;m actually pretty satisfied with it, but I also need &lt;em&gt;gedit&lt;/em&gt; for reasons mentioned in another post. While &lt;em&gt;gedit&lt;/em&gt; is a GTK3, if you don&amp;#8217;t choose the right theme, it may fallback to an ugly GTK variant which looks weird. So while your daily GTK2 theme look nice (Firefox, gFTP, XChat), the gedit will be different. There&amp;#8217;s nothing I hate most than inconsistency. You need to find themes with support for both GTK2 and GTK3 versions to have theme consistency. A good starting point is &lt;a href="http://gnome-look.org"&gt;gnome-looks.com&lt;/a&gt; website, from where you can download them and put them in your ~/.themes folder. If you don&amp;#8217;t have it, create it and copy theme&amp;#8217;s folders, after you&amp;#8217;ve extracted them from the archive. The form the Xfce menu, Setting, Appearance and you can have a look on your new themes.&lt;/p&gt;
&lt;p&gt;These packages might be useful, before starting theme hunt:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pkg_add -vi gtk-engines2&lt;br/&gt;# pkg_add -vi gtk2-murrine-engine&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#8217;ve settled for Clearwaita from the &lt;a href="http://gnome-look.org/content/show.php?content=145210"&gt;Clearlooks-Phenix&lt;/a&gt; package, it looks simple, clean and fresh on both GTK2 and GTK3 applications (I love the old Clearlooks for GTK2 back in the days).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Credit for this posts goes to Igneous, from Freenode&amp;#8217;s #openbsd.&lt;/em&gt;&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/26143605984</link><guid>http://zerobsd.tumblr.com/post/26143605984</guid><pubDate>Fri, 29 Jun 2012 18:10:28 +0300</pubDate><category>gtk2</category><category>gtk3</category><category>theme</category><category>clearlooks</category><category>fonts</category></item><item><title>LaTeX in BSD</title><description>&lt;p&gt;I was surprised to see that a TeX Live meta-package is missing for FreeBSD, but there is one for OpenBSD. And it also installs nicely as a dependency for &lt;em&gt;gedit-latex&lt;/em&gt;, a plugin for &lt;em&gt;gedit&lt;/em&gt; that is probably the best LaTeX editor I could find in GTK.&lt;/p&gt;
&lt;p&gt;The magic of &lt;em&gt;gedit-latex&lt;/em&gt; plugin is that it adds cite-autocompletion and it&amp;#8217;s beyond me why this feature is not available in every other LaTeX editor, considering what an excruciating pain dealing with biography is and how much a simple feature like this can help. I think there is only one more editor with cite-autocompletion, namely TexStudio, but it won&amp;#8217;t compile on OpenBSD nor FreeBSD and it&amp;#8217;s Qt4 and too bloated for my taste. Also, &lt;em&gt;gedit&lt;/em&gt; is a nice, clean, simple design application that integrates well in my Xfce&amp;#8217;s GTK medium.&lt;/p&gt;
&lt;p&gt;FreeBSD 9 has binaries of Gnome 2 while OpenBSD 5.1 got Gnome 3 already. Hence, the ugliness of &lt;em&gt;gedit&lt;/em&gt; in OpenBSD, but some theme tweaking I guess could make it better, that&amp;#8217;s the only annoyance of my current setup. &lt;em&gt;gedit 2&lt;/em&gt; looked way better in FreeBSD&amp;#8217;s Xfce with GTK2 themes, but I&amp;#8217;ll dig for some beauty tips in the following days. The gedit 3 is the way to go anyway, no reason to look back.&lt;/p&gt;
&lt;p&gt;Although installing TeX Live from official ports in FreeBSD is not possible, there is an &lt;a href="http://code.google.com/p/freebsd-texlive/"&gt;alternate solution&lt;/a&gt; but I find it convoluted and I prefer the OpenBSD way: installing it from packages. Just type:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkg_add -vi gedit-latex&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and the rest will follow automatically, the system will fetch and install &lt;em&gt;texlive_texmf-minimal&lt;/em&gt; package with all the necessary dependencies and you&amp;#8217;ll have a nice TeX environment on your OpenBSD 5.1 machine. Sweet. It took me a while to find out about this, as I thought there are no binary packages for TeX Live (don&amp;#8217;t ask why I didn&amp;#8217;t just look into the ports directory), so I compile it from ports not a few day ago.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;gedit-latex&lt;/em&gt; package &lt;em&gt;texlive_texmf-minimal&lt;/em&gt; and this could be enough for some tasks, but trying to compile my .tex files spilled out a lot of errors concerning special characters like &lt;em&gt;ăîșțâ&lt;/em&gt;, so I knew that I needed &lt;em&gt;ut8x&lt;/em&gt; and &lt;em&gt;ucs&lt;/em&gt; package, which wasn&amp;#8217;t in the installed Tex Live distribution. To fix this, we can install the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkg_add -vi texlive_texmf-full&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now we&amp;#8217;ll have &lt;em&gt;utf8x&lt;/em&gt;, &lt;em&gt;ucs&lt;/em&gt; (I know it&amp;#8217;s not recommended to use &lt;em&gt;ucs&lt;/em&gt;, but it&amp;#8217;s the only way to type spcial characters directly in editor and not having to wrapt my fingers for LaTeX codes in each and every word) and &lt;em&gt;mchem&lt;/em&gt; package for easily typing chemical symbols.&lt;/p&gt;
&lt;p&gt;There are others editors besides &lt;em&gt;gedit-latex&lt;/em&gt; that have syntax highlighting for LaTex, but they are either ugly, bloated, Qt4 and old (kile, texmaker, texmakerx) or just ugly (gummi). None of them, with the exception of TeXStudio, a newer one that won&amp;#8217;t compile on BSD just yet, won&amp;#8217;t have cite-autocompletion which for me is a must. So I guess I&amp;#8217;ll stick with &lt;em&gt;gedit-latex&lt;/em&gt; for a while, it seems to work just fine for my needs, although it uses to crash a lot.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/26135118799</link><guid>http://zerobsd.tumblr.com/post/26135118799</guid><pubDate>Fri, 29 Jun 2012 13:42:00 +0300</pubDate><category>LaTeX</category><category>FreeBSD</category><category>gedit</category><category>gedit-latex</category><category>gtk</category></item><item><title>/usr disk space problem</title><description>&lt;p&gt;I use the proposed auto-layout of my OpenBSD disk that is suggested during install. The problem is that, while &lt;em&gt;/home&lt;/em&gt; partition is generous enough, &lt;em&gt;/usr&lt;/em&gt; might be to small for some operations. For example, on a 20&amp;#160;GB hard-disk drive, the OpenBSD installer thinks that 2&amp;#160;GB is enough for &lt;em&gt;/usr&lt;/em&gt;. Well, probably it is for some stuff, but when trying to compile TexLive from ports I&amp;#8217;ve noticed that those 2&amp;#160;GB gets filled up near the end, making impossible to complete install the needed packages. The probem can be overcome simply and the process is described in OpenBSD FAQ, section &lt;a href="http://www.openbsd.org/faq/faq15.html#Ports"&gt;15.3.3&lt;/a&gt;. All we have to do to ease the stress on the &lt;em&gt;/usr&lt;/em&gt; partition is to move the package handling operations to a partition with plenty of space, say &lt;em&gt;/home&lt;/em&gt;. So edit your &lt;em&gt;/etc/mk.conf&lt;/em&gt; like I did (if the file doesn&amp;#8217;t exist, create it and add the following lines):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;WRKOBJDIR=/home/john/ports/obj/ports&lt;br/&gt; DISTDIR=/home/john/ports/distfiles&lt;br/&gt; PACKAGE_REPOSITORY=/home/john/ports/packages&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Don&amp;#8217;t worry if you don&amp;#8217;t have the &lt;em&gt;/home/&amp;lt;user&amp;gt;/ports&lt;/em&gt; directory, the scripts will create it for you.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it, now TexLive compiled and installed gently. The process took a few hours on my Intel Core2 Duo E6300.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/25844017561</link><guid>http://zerobsd.tumblr.com/post/25844017561</guid><pubDate>Mon, 25 Jun 2012 12:13:00 +0300</pubDate><category>/usr</category><category>space</category><category>ports</category><category>compilling</category></item><item><title>Installing Xfce 4.8 on OpenBSD 5.0</title><description>&lt;p&gt;After playing with FreeBSD for a few days, I&amp;#8217;m back on my OpenBSD. First time I tried installing Xfce I gave up, due to some mouse problems and window manager issues. Now I&amp;#8217;m back on track for installing this simple desktop environment, ready to fix all the problems.&lt;/p&gt;
&lt;p&gt;The mouse problem arise probably due to the fact that my moue is a PS2 mouse, but it connect to my PC trough a PS2-to-USB adapter. I needed that so that my OS X could run on my system, since Apple&amp;#8217;s operating system doesn&amp;#8217;t had drivers for PS2 mouses. In OpenBSD, everytime I exited Xorg, my mouse would disconnect and stayed that way. Frustrating. So I removed the adapter and plugged my mouse in it&amp;#8217;s intended location. Problem solved.&lt;/p&gt;
&lt;p&gt;So let&amp;#8217;s get on installing Xfce. I&amp;#8217;ve used &lt;a href="http://www.gabsoftware.com/tips/tutorial-installing-xfce-on-openbsd-4-8/"&gt;this website&lt;/a&gt; as a guide, but with some modifications (some packages couldn&amp;#8217;t be found and some of them have different name now). If you already have a clean OpenBSD installed, just run this commands to have your Xfce desktop ready (there is no meta-package for Xfce, so we have to manually install everything):&lt;/p&gt;
&lt;div class="container"&gt;
&lt;blockquote&gt;
&lt;div class="line number1 index0 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-session&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number1 index0 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi gtk-xfce-engine&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number3 index2 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfdesktop&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number4 index3 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-appfinder&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number5 index4 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-battery&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number6 index5 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-clipman&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number7 index6 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-dict&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number8 index7 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-diskperf&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number9 index8 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-fsguard&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number10 index9 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-genmon&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number11 index10 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-mailwatch&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number12 index11 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-modemlights&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number13 index12 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-mount&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number14 index13 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-mpc&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number15 index14 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-netload&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number16 index15 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-notes&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number17 index16 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-notifyd&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number18 index17 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-places&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number19 index18 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-quicklauncher&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number20 index19 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-screenshooter&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number21 index20 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-smartbookmark&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number22 index21 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-systemload&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number23 index22 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-taskmanager&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number24 index23 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-time-out&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number25 index24 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-verve&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number26 index25 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-wavelan&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number27 index26 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-weather&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number28 index27 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-wmdock&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number29 index28 alt2"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-xkb&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce-utils&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-terminal&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi mousepad&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi orage&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfce4-mixer&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfwm4&lt;/code&gt;&lt;br/&gt;&lt;code class="bash comments"&gt;# pkg_add -vi xfwm4-themes&lt;/code&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;My initial problem with window bars missing was caused by failing to install &lt;code class="bash comments"&gt;&lt;em&gt;xfwm4&lt;/em&gt;&lt;/code&gt;. Now it works, beautifully.&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;Don&amp;#8217;t forget to modify your &lt;em&gt;.initrc&lt;/em&gt; file accordingly (and comment any other lines, if necessary):&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;
&lt;blockquote&gt;
&lt;div class="line number4 index3 alt1"&gt;&lt;code class="bash plain"&gt;$ &lt;/code&gt;&lt;code class="bash functions"&gt;echo&lt;/code&gt; &lt;code class="bash string"&gt;'exec startxfce4'&lt;/code&gt; &lt;code class="bash plain"&gt;&amp;gt; .xinitrc&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number5 index4 alt2"&gt;&lt;code class="bash plain"&gt;$ &lt;/code&gt;&lt;code class="bash functions"&gt;chmod&lt;/code&gt; &lt;code class="bash plain"&gt;+x .xinitrc&lt;/code&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;I haven&amp;#8217;t installed a login manager yet, but this operation should be trivial and I&amp;#8217;ll let it as an exercise for the reader :)&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;/div&gt;
&lt;div class="line number30 index29 alt1"&gt;&lt;strong&gt;Update:&lt;/strong&gt; Same procedure works for OpenBSD 5.1 as well.&lt;/div&gt;</description><link>http://zerobsd.tumblr.com/post/21926672751</link><guid>http://zerobsd.tumblr.com/post/21926672751</guid><pubDate>Fri, 27 Apr 2012 22:56:00 +0300</pubDate><category>desktop</category><category>xfce</category></item><item><title>FreeBSD on my desktop</title><description>&lt;p&gt;Since I haven&amp;#8217;t tried FreeBSD in a long, long time (years), I gave it a shot these days and I must say I was surprised. After almost a day of using it, it didn&amp;#8217;t feel different than any other modern Linux distribution. It even have a graphical update manager that didn&amp;#8217;t work! Jokes aside, FreeBSD had made some huge progress in desktop usability and if we consider the server tools and its awesome &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html"&gt;documentation&lt;/a&gt;, it&amp;#8217;s an interesting operating system. &lt;/p&gt;
&lt;p&gt;Installing GNOME was so easy that I really have nothing to add. There&amp;#8217;s no tips and trick, just follow the &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11-wm.html"&gt;manual&lt;/a&gt; and you&amp;#8217;ll have GNOME installed in like half an hour. If you want to have an enjoyable experience as a desktop, you have to read and apply these tips from the &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-fonts.html"&gt;handbook&lt;/a&gt; and&amp;#8230; there you have it, a fully usable FreeBSD desktop. With Flash, NVIDIA driver and Java support just a few &lt;em&gt;pkg_add&lt;/em&gt; command away.&lt;/p&gt;
&lt;p&gt;FreeBSD is so simple to install that offers really no challenge so if I made a blog about me using it, I&amp;#8217;m afraid there wouldn&amp;#8217;t be much to write about. On the server side, FreeBSD brings a few tools on the table that really worth taking a look at: ZFS, jails and virtualization. Not bad FreeBSD, not bad.&lt;/p&gt;
&lt;p&gt;I was also tempted to install Solaris 11, but after a quick IRC chat I found out that Oracle doesn&amp;#8217;t supply free security updates. That&amp;#8217;s not funny. Open source implementation of Solaris and its features are spread between different projects (SmartOS, ProjectIndiana, etc) so until they stabilize and deliver an usable product, I think FreeBSD have it all: really good server tools, best desktop experience, without being owned by a ruthless corporation.&lt;/p&gt;
&lt;p&gt;So back to our OpenBSD, after a wonderful trip trough FreeBSD realm. It&amp;#8217;s nice to know there is an operating system like this and it continues to evolve. I will probably fail to make OpenBSD my desktop operating system, but I&amp;#8217;m pretty sure I could get used to FreeBSD as quickly as I could with any other Linux distribution.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21720385935</link><guid>http://zerobsd.tumblr.com/post/21720385935</guid><pubDate>Tue, 24 Apr 2012 19:49:42 +0300</pubDate><category>FreeBSD</category></item><item><title>My .vimrc</title><description>&lt;p&gt;I learned to love &lt;em&gt;vim&lt;/em&gt;. In the first days of my *NIX adventures, I was using &lt;em&gt;nano&lt;/em&gt;, since it reminded me of Norton Commander&amp;#8217;s editor, but I soon realized that &lt;em&gt;vim&lt;/em&gt; was more elegant and it seems I was more quicker using it then nano or, God forbids, &lt;em&gt;Emacs&lt;/em&gt; (who uses an operating system to write a text file, anyway?). When in X, I prefer other, more fancy, editors, but when stuck to command line, &lt;em&gt;vim&lt;/em&gt; is a great tool and usually the first package I install (if it&amp;#8217;s not installed already).&lt;/p&gt;
&lt;p&gt;While vanilla &lt;em&gt;vim&lt;/em&gt; is quite usable after you get used to it, having some options turned on just makes it more friendly. So here&amp;#8217;s my &lt;em&gt;.vimrc&lt;/em&gt; file:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set ai&lt;br/&gt;set background=dark&lt;br/&gt;set showtabline=3&lt;br/&gt;set smartindent&lt;br/&gt;set smarttab&lt;br/&gt;set backspace=indent,eol,start&lt;br/&gt;set ruler&lt;br/&gt;syntax on&lt;br/&gt;command WQ wq&lt;br/&gt;command Wq wq&lt;br/&gt;command W w&lt;br/&gt;command Q q&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While I saw some very complex &lt;em&gt;.vimrc&lt;/em&gt; settings, I like not to deviate to much from default options, but, in the same time, still using vim without frustration.&lt;/p&gt;
&lt;p&gt;When in GNOME, I use &lt;em&gt;gnome-terminal&lt;/em&gt; with a white background and the above setup doesn&amp;#8217;t look very nice for most files, due to syntax color, so I modify the second line like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set background=light&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s all about vim for now.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21635375577</link><guid>http://zerobsd.tumblr.com/post/21635375577</guid><pubDate>Mon, 23 Apr 2012 09:21:00 +0300</pubDate><category>dekstop</category><category>server</category><category>vim</category></item><item><title>GNOME on OpenBSD</title><description>&lt;p&gt;Once we&amp;#8217;ve got &lt;a href="http://zerobsd.tumblr.com/post/21487087692/desktop-project-getting-started"&gt;X configured and running&lt;/a&gt; on our OpenBSD 5.0/amd64, getting GNOME 2.32 it&amp;#8217;s not that hard. I just had to fetch and install a few packages.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pkg_add -vi gnome-session&lt;br/&gt;# pkg_add -vi metacity&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here, you will have to chose GTK2 variant of metacity, to avoid  conflicts later on. Let&amp;#8217;s continue our GNOME installation.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pkg_add -vi gnome-panel&lt;br/&gt;# pkg_add -vi nautilus&lt;br/&gt;# pkg_add -vi gnome-terminal&lt;br/&gt;# pkg_add -vi gnome-control-center&lt;br/&gt;# pkg_add -vi gnome-menus&lt;br/&gt;# pkg_add -vi gnome-settings-daemon&lt;br/&gt;# pkg_add -vi gnome-themes&lt;br/&gt;# pkg_add -vi gnome-themes-extras&lt;br/&gt;# pkg_add -vi gnome-utils&lt;br/&gt;# pkg_add -vi gnome-applets2&lt;br/&gt;# pkg_add -vi gnome-system-monitor&lt;br/&gt;# pkg_add -vi gnome-nettool&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A restart is recommended. After that, if .xinitrc file doesn&amp;#8217;t exist in your home directory, create it and add the following line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;exec gnome-session&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s it, now we have GNOME installed and it should look like &lt;a href="http://cl.ly/033r0P2o3h2d202t1e34"&gt;this&lt;/a&gt;, after running:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;startx&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you look careful enough, you&amp;#8217;ll see a few apps already installed. Before getting the snapshot, I&amp;#8217;ve installed &lt;em&gt;xmms&lt;/em&gt;, &lt;em&gt;audacity&lt;/em&gt;, &lt;em&gt;firefox&lt;/em&gt;, &lt;em&gt;thunderbird&lt;/em&gt;, &lt;em&gt;pidgin&lt;/em&gt;, &lt;em&gt;vlc&lt;/em&gt;, &lt;em&gt;mplayer&lt;/em&gt; and &lt;em&gt;gFTP&lt;/em&gt;. The good news is that Libre Office installed and it&amp;#8217;s running fine without any Java dependencies, that&amp;#8217;s just great. Using GNOME&amp;#8217;s keyboard layout tool, I was able to use localized keyboard layouts with special characters, like ăâșțî.&lt;/p&gt;
&lt;p&gt;GNOME looks nice and polished, but I don&amp;#8217;t have hardware acceleration and you can tell that by dragging a window on the screen. Its not that fast and almost annoying to have a video card and not being able to fully use it. &lt;/p&gt;
&lt;p&gt;I also found out about mozilla-dicts-XX packages, with spell check dictionaries for various languages, accessible form Firefox and Thunderbird (and hopefully SeaMonkey too, but I didn&amp;#8217;t check that). &lt;a href="http://openports.se/textproc/mozilla-dicts"&gt;Identify&lt;/a&gt; your language and just type:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pkg_add -vi mozilla-dicts-XX&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;replacing XX with your country code.&lt;/p&gt;
&lt;p&gt;Now, if we want to login directly into GNOME, we should install gdm (GNOME Display Manager). There&amp;#8217;s no trick here, just:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pkg_add -vi gdm&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After that, make sure yu add the following in &lt;em&gt;/etc/rc.local:&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if [ -x /usr/local/sbin/gdm ]; then&lt;br/&gt;echo -n &amp;#8217; gdm&amp;#8217;; (sleep 5; /usr/local/sbin/gdm) &amp;amp;&lt;br/&gt;fi&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s it. Restart and you should be taken directly into gdm and from there to GNOME.&lt;/p&gt;
&lt;p&gt;YouTube works in Firefox, using HTML5, since no Flash is available on OpenBSD, but it&amp;#8217;s rather slow, almost unusable.&lt;/p&gt;
&lt;p&gt;Another disappointment was to find out that OpenBSD does not mount HFS+ disks, leaving my entire 1TB storage HDD inaccessible on my shiny new operating system. ZFS would be nice, but since there is some hope with read-only NTFS, the situation is not catastrophic.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not very enthusiastic about GNOME performance. I&amp;#8217;d expected the system to be quicker and also, video performance on Firefox is really bad. I&amp;#8217;ve also played with &lt;em&gt;cwm&lt;/em&gt;, but about this, in a future post.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21505214506</link><guid>http://zerobsd.tumblr.com/post/21505214506</guid><pubDate>Sat, 21 Apr 2012 19:46:00 +0300</pubDate><category>gnome</category><category>desktop</category><category>Xorg</category><category>gdm</category></item><item><title>Desktop project: getting started</title><description>&lt;p&gt;OpenBSD was installed on the following hardware: Asus P5B-E motherboard with Intel Core2 Duo E6300 CPU at 1.86&amp;#160;GHz with 4&amp;#160;GB RAM and on a WD 75&amp;#160;GB hard disk drive. NVIDIA 8600&amp;#160;GT video card was present on the system, but this will not affect our installation to much.&lt;/p&gt;
&lt;p&gt;Installing was performed using the default options, giving the whole 75&amp;#160;GB disk to OpenBSD and installing all sets from the CD. Since I have a dedicated disk for this test, I won&amp;#8217;t fiddle with dual boot just yet. The installation was fast, took only a few minutes, as expected.&lt;/p&gt;
&lt;p&gt;Since I haven&amp;#8217;t created an user during install, this was the first thing I did after booting into my clean OpenBSD system. I&amp;#8217;ve also added him to the wheel group,&lt;/p&gt;
&lt;p&gt;Next, pkg_add config, so that we can move on. Used vi to edit .profile, by adding the following lines:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;export PKG_PATH=http://ftp5.eu.openbsd.org/ftp/pub/OpenBSD/5.0/ \&lt;br/&gt;packages/`machine -a`/&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Save, log out and log in again to avoid running the above mentioned command in the shell, then checked fore new packages by running:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkg_add -u&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;MOving on installing basic tools:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkg_add -vi vim&lt;br/&gt;pkg_add -vi mc&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The -v switch is for verbose and -i for interactive selection, if needed.&lt;/p&gt;
&lt;p&gt;There are a few things we should check before starting X. You should check if &lt;em&gt;machdep.allowaperture&lt;/em&gt; is correctly set for your platfrom. Its value should be 2 in case of i386 or amd64. My OpenBSD 5.0 had this value already correclty set up in &lt;em&gt;/etc/sysctl.conf&lt;/em&gt;, so I woulnd&amp;#8217;t have to modify a thing. Also, I had to set &lt;em&gt;wsmoused_flags=&amp;#8221;&amp;#8220;&lt;/em&gt; in &lt;em&gt;/etc/rc.conf.local &lt;/em&gt;before I could use the mouse in X.&lt;/p&gt;
&lt;p&gt;If any problems arise with X, just use another terminal to issue&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkill Xorg&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;that will bring down any non responsive Xorg setup, in case CTRL-ALT-Backspace fails to work.&lt;/p&gt;
&lt;p&gt;Create .&lt;em&gt;xinitrc&lt;/em&gt; file in your home folder, add just &lt;em&gt;cvm&lt;/em&gt; on its first line, then you can manually start the X server and &lt;em&gt;cwm&lt;/em&gt; window manager by typing:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;startx&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;CTRL-ALT-Enter in cwm will spawn a new terminal window. You can read more about cwm in the &lt;a href="http://www.openbsd.org/cgi-bin/man.cgi?query=cwm&amp;amp;sektion=1"&gt;manual&lt;/a&gt;. To be able to post this message, I had to install a web browser:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;pkg_add -vi seamonkey&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;#8217;s not the latest release, but it&amp;#8217;s all I need for now.&lt;/p&gt;
&lt;p&gt;So we&amp;#8217;ve installed OpenBSD on a new system and managed to get X up and running. That&amp;#8217;s the first step towards a functional desktop for daily use. I haven&amp;#8217;t figured out yet how to take a screenshot, so you&amp;#8217;ll have to take my word on this. Our saga will continue next time, when we&amp;#8217;ll probably play and configure with others window managers, since the current setup is not very pretty.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21487087692</link><guid>http://zerobsd.tumblr.com/post/21487087692</guid><pubDate>Sat, 21 Apr 2012 11:47:00 +0300</pubDate><category>X</category><category>Xorg</category><category>OpenBSD</category><category>install</category><category>pkg_add</category><category>cwm</category></item><item><title>The great mistery of the empty tar.bz2 file</title><description>&lt;p&gt;Nihil sine backup, and what better way to do backup than a script placed in &lt;em&gt;crontab&lt;/em&gt;? The script is a simple one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;NOWD=$(date +&amp;#8221;%F&amp;#8221;)&lt;br/&gt;NOWT=$(date +&amp;#8221;%T&amp;#8221;)&lt;br/&gt;/usr/local/bin/mysqldump -u root -password \&lt;br/&gt;dbname &amp;gt; /root/databases/db.sql&lt;br/&gt;/bin/tar cvfj /home/john/backup/backup-$NOWD-$NOWT.tar.bz2 \&lt;br/&gt;/var/log /var/www /etc /root/databases&lt;br/&gt;/bin/rm /root/databases/db.sql&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It dumps MySQL database in a folder than group a few folders in an archive with a proper name based on the date and time of its creation and finally cleans up. Nothing fancy, just your basic backup script. Running it by hand will start &lt;em&gt;tar.bz2&lt;/em&gt;-ing the files and then carefully place the archive where it should. Nothing extraordinary here, just a script doing its job.&lt;/p&gt;
&lt;p&gt;The problems appears when I place the script in &lt;em&gt;crontab&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;50&amp;#160;3 * * 3 /bin/sh /root/backup.sh&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As expected, the script starts running when it should, but fails when it reaches the first file on the first folder that it needs to process. The resulted &lt;em&gt;tar.bz2&lt;/em&gt; file is in its right place, but it&amp;#8217;s empty, with a size of 0&amp;#160;KB. Yes, the script is executable, like I said, running it by hand gives the expected behavior and results. I suspect some sort of permissions issue, but I couldn&amp;#8217;t find a way to solve this yet. Until then, manual backup will do the job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Problem fixed. See &lt;a href="http://zerobsd.tumblr.com/post/30859439518/empty-tar-bz2-file-follow-up"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21427506946</link><guid>http://zerobsd.tumblr.com/post/21427506946</guid><pubDate>Fri, 20 Apr 2012 10:33:00 +0300</pubDate><category>backup</category><category>cron</category><category>server</category><category>crontab</category></item><item><title>Desktop project: evaluating requirements</title><description>&lt;p&gt;The plan is to install OpenBSD at home, on my desktop and use it for exclusively for at least a week, to evaluate it&amp;#8217;s usability for daily routine and how fit am I to use it like this. It will be an act of &lt;span class="short_text" id="result_box"&gt;&lt;span class="hps"&gt;&lt;/span&gt;&lt;span class="hps"&gt;asceticism giving away the polished look of Mac OS X, but maybe I will end up &lt;/span&gt;&lt;/span&gt;enlightened &lt;span class="short_text" id="result_box"&gt;&lt;span class="hps"&gt;after this experience :)&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Before starting this thing, I need to evaluate my daily needs. Off course, first thing that came to mind is having X up and running. This would be fairly easy to achieve. The problem would be choosing the right desktop environment / window manager. Although I&amp;#8217;m curious about simplistic tilled window managers, like &lt;em&gt;cwm&lt;/em&gt;, it will probable get a while to adjust, so for starters I think I&amp;#8217;ll try to install &lt;em&gt;GNOME&lt;/em&gt;, since &lt;em&gt;KDE4&lt;/em&gt; is really not something I would enjoy, but who knows, maybe I&amp;#8217;ll be on the mood for something new. And also a simple and pretty desktop (graphical login) manager, SLiM is a perfect candidate for this.&lt;/p&gt;
&lt;p&gt;Basically, I think I would need the following to cover my daily needs:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;web browser (with spell-check, &lt;em&gt;Firefox, SeaMonkey&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;office suite (&lt;em&gt;OpenOffice&lt;/em&gt;, &lt;em&gt;LibreOffice&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;basic image processing (with resize and various format support)&lt;/li&gt;
&lt;li&gt;instant messaging (&lt;em&gt;pidgin&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;IRC client (&lt;em&gt;pidgin&lt;/em&gt;, &lt;em&gt;X-Chat&lt;/em&gt;, &lt;em&gt;Konversation&lt;/em&gt; in case of &lt;em&gt;KDE&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Bittorent client (in terminal or in X)&lt;/li&gt;
&lt;li&gt;SFTP client (&lt;em&gt;gFTP&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;video player with various codecs (&lt;em&gt;VLC&lt;/em&gt;, &lt;em&gt;mplayer&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;audio player with MP3 and all (&lt;em&gt;xmms&lt;/em&gt;, &lt;em&gt;audacious&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;possibility to mount HFS+/NTFS drive (read-only for the time being)&lt;/li&gt;
&lt;li&gt;Dropbox beyond web interface (I think I&amp;#8217;ll have to work hard for this one)&lt;/li&gt;
&lt;li&gt;some games (&lt;em&gt;OpenTTD&lt;/em&gt; and &lt;em&gt;Minecraft&lt;/em&gt; will satisfy me, though I&amp;#8217;ll need Java)&lt;/li&gt;
&lt;li&gt;localized keyboard layout&lt;/li&gt;
&lt;li&gt;&lt;em&gt;optionally&lt;/em&gt;: email client (&lt;em&gt;Thunderbird&lt;/em&gt;, SeaMonkey, &lt;em&gt;Sylpheed&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Everything up there seems do-able in OpenBSD, so when time permits, I&amp;#8217;ll start the project and keep you updated about my progress.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21376701966</link><guid>http://zerobsd.tumblr.com/post/21376701966</guid><pubDate>Thu, 19 Apr 2012 14:38:00 +0300</pubDate><category>desktop</category><category>X11</category></item><item><title>More fun with PF: blocking unwanted guests</title><description>&lt;p&gt;Every once in a while, I check my &lt;em&gt;/var/logs/auth&lt;/em&gt; to see people knocking on my port 22 door. While I do have a strong password for my user and &amp;#8220;PermitRootLogin no&amp;#8221; on my &lt;em&gt;/etc/ssh/sshd_config&lt;/em&gt;, I&amp;#8217;m still not very comfortable with people wanted to get in. Once again, PF came to rescue, delivering an elegant solution. Actually, two.&lt;/p&gt;
&lt;p&gt;First, I tried the manual method. Looking in &lt;em&gt;/var/logs/auth &lt;/em&gt;and putting the incriminated IPs into a text files. Them I would tell pf to look into that file and block all access for those IPs, like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;table &amp;lt;blockedips&amp;gt; persist file &amp;#8220;/etc/pf.blocked.ip.conf&amp;#8221;&lt;br/&gt;block in on bnx0 from &amp;lt;blockedips&amp;gt; to any&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The first line defines a table with values in the specified file, then pf will block all connection from the matching IP (bnx0 being my network interface). Simple, but requires some daily maintenance. My next thought was: could I make this process automatic? It appears that I do, and this will be the second method of keeping your lawn clean.&lt;/p&gt;
&lt;p&gt;The second solution was found &lt;a href="http://www.128bitstudios.com/2010/06/13/stopping-ssh-brute-force-attacks-with-pf-on-freebsd/"&gt;on the web&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;table &amp;lt;bruteforce&amp;gt; persist&lt;br/&gt;block quick from &amp;lt;bruteforce&amp;gt;&lt;br/&gt;pass inet proto tcp from any to any port \&lt;br/&gt;ssh flags S/SA keep state (max-src-conn 5, \&lt;br/&gt;max-src-conn-rate 5/30, overload &amp;lt;bruteforce&amp;gt; flush global)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We create another table and block all the IPs from it. Then we populate the table with IPs from users that try connecting to the server and fails to often. If they connect with more then 5 clients to the SSH server and try reconnect 5 times within 30 secs they get added to the table.&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t forget to reload pf rules by running, as &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -f /etc/pf.conf&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you want to check the content of any table, just run the following, as &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -t bruteforce -T show&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To remove an IP from the table, run:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;# pfctl -t bruteforce -T delete &amp;lt;IP&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think the second option is the most elegant way to keep unwanted guests away. Although I&amp;#8217;m pretty sure that the content of the &lt;em&gt;bruteforce&lt;/em&gt; table will empty on reboot, but that&amp;#8217;s ok since it will be repopulated next time someone fails to properly login.&lt;/p&gt;</description><link>http://zerobsd.tumblr.com/post/21375503505</link><guid>http://zerobsd.tumblr.com/post/21375503505</guid><pubDate>Thu, 19 Apr 2012 13:34:00 +0300</pubDate><category>pf</category><category>server</category><category>ssh</category><category>openssh</category></item><item><title>Fun with PF: blocking ports</title><description>&lt;p&gt;Firsts things first: we have to close our unused ports. We surely need port 22 open for &lt;em&gt;ssh&lt;/em&gt; connection and 80 for Apache. I would also use &lt;em&gt;ntpd&lt;/em&gt;, so 123 will remain open. After a few Internet readings, port 53 should remain open, due to its use by &lt;em&gt;bind&lt;/em&gt; for zone transfers and such.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve learned that PF is a great OpenBSD tool, but it sure does require &lt;a href="http://www.openbsd.org/faq/pf/index.html"&gt;some reading&lt;/a&gt; before using it and it&amp;#8217;s on my to-do list. The following example was found &lt;a href="http://www.pc-freak.net/blog/how-to-block-ip-address-with-pf-on-freebsd-netbsd-and-openbsd/"&gt;on the web&lt;/a&gt; and I adapted it to my needs. As I see it, we define a table in the first two rows, with information about TCP and UDP ports that we want open. After that, we block all connections, but create exceptions for the above mentioned ports. It works for me.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;tcp_pass = &amp;#8220;{ 53&amp;#160;80&amp;#160;22&amp;#160;123 }&amp;#8221;&lt;br/&gt;udp_pass = &amp;#8220;{ 53 }&amp;#8221;&lt;br/&gt;block all&lt;br/&gt;pass out proto tcp to any port $tcp_pass keep state&lt;br/&gt;pass out proto udp to any port $udp_pass keep state&lt;br/&gt;pass in proto tcp to port 22 keep state&lt;br/&gt;pass in proto tcp to port 80 keep state&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://zerobsd.tumblr.com/post/21369478909</link><guid>http://zerobsd.tumblr.com/post/21369478909</guid><pubDate>Thu, 19 Apr 2012 08:21:00 +0300</pubDate><category>block ip</category><category>pf</category><category>ports</category><category>server</category></item></channel></rss>
