Forkify 0.0.1 Ruby gem released, threadify with processes
I’m happy to announce the release of another tiny Ruby gem, Forkify.
Forkify is basically Ara Howard’s Threadify (minus a few features), but instead of using threads, it uses fork to create multiple processes to perform the operations on an Enumerable type. It was born out of the desire to have the forkoff gem work on Ruby 1.9.1 (which it isn’t currently).
You can get Forkify using RubyGems:
sudo gem install forkify
Using it is super-simple also:
require 'forkify'
require 'pp' # optional, just for this example
r = [1, 2, 3].forkify { |n| n*2 }
pp r
=> [2, 4, 6]
Another example demonstrating the time-saving feature of using forks:
[3:hinmanm@Xanadu:~]% time ruby -r forkify -e "5.times.forkify { |n| sleep(1) }"
ruby -r forkify -e "5.times.forkify { |n| sleep(1) }" 0.02s user 0.03s system 5% cpu 1.030 total
You can specify the maximum number of processes to spawn with an argument to forkify, the default is 5:
[1, 2, 3, 4, 5, 6].forkify(3) { |n| n**2 } # This will spawn 3 processes at a time to process the 6 items
Here you can see sleeping for 5 seconds 5 times only takes slightly longer than 1 second (instead of over 5 if you hadn’t forkified it)
Forkify is available as a gem via rubygems, or you can check out the code here: http://github.com/dakrone/forkify/. It’s still beta-quality, so please let me know if you run into any issues with it.
P.S. 100th post, woo!
Nesting traps in Ruby with a quick monkeypatch
If you end up messing with traps a lot in Ruby, you’ll find that they don’t unbind when leaving function context, so you’re either stuck ‘ensuring’ that the trap is replaced by the old trap, or just dealing with it.
Well, here’s a quick monkeypatch for adding a method that will do all the ensuring/retrapping for you when you leave a function.
Here’s the code (click for github’s colorized version):
While the syntax for calling it (t.trapr_wrap "SIGINT", Proc.new { ... }, :foo) isn’t exactly clean, if you’re calling a lot of functions and only want a trap to be active inside, it beats having to repeat undoing your trap every time.
Update: I changed the code for better readability and because I was doing it a silly way. Now it takes actual arguments instead of just ‘*args’.
Building a Java dev environment with Eclim and Vim on OSX
As anyone who has done Java development will tell you, doing it without a java-specific IDE can suck. So, enter Eclipse and Netbeans, probably the 2 biggest java IDEs out there (among many).
But I don’t want to use Eclipse or Netbeans. I want to use Vim.
Enter Eclim, which is a way to use Eclipse’s wide array of features in Vim. Check out the site, it gives a better idea of how it’s used than I can. Unfortunately, only binaries for Linux and Windows are available, so we’re going to have to do this the hard way on OSX. Let’s get started.
The first thing we’ll need is Eclipse. I’m using Eclipse 3.4.3, which I downloaded, uncompressed and moved to /Applications/Eclipse (so the full path is /Applications/Eclipse/Eclipse.app, this is important for later).
Next, let’s grab Eclim from the sourceforge site, the tar.gz file (not the .exe or the .sh). I’m using Eclim 1.4.7. Untar and wait a second, we’ll need to grab something before we can build Eclim.
Eclim requires Ant 1.7.1 in order to build (OSX ships with Ant 1.7.0 instead), so download the Ant 1.7.1 binary for OSX from Apache’s sites, untar, but don’t worry about installing it.
Lastly, grab the latest Vim 7.2 tarball from vim.org. Unfortunately, Apple decided not to compile the system vim with ’sign’ support, so we’ll have to roll our own version of vim.
Now, let’s begin:
First, we’ll need a folder for the vim plugins, which needs to be created manually or Eclim will complain:
[~]% mkdir ~/.vim/eclim
Next, compile the Eclim files from the eclim directory using the ant 1.7.1 binary. In this example I’m only compiling the ant and jdt plugins for Eclim, because the CDT and PDT plugins require other Eclipse libraries, and I only use Eclipse for Java development anyway. Be sure to change your eclipse.home setting if you didn’t put it in the same place as me:
[~/code/eclim_1.4.7]% ../apache-ant-1.7.1/bin/ant -Declipse.home=/Applications/Eclipse/ -Dplugins=ant,jdt
The Ant command will build and install the files at the same time, so afterwards you shouldn’t have to manually install any Vim or Eclim files.
Next, we need to recompile Vim with sign support, here’s how I compiled my version, make sure to keep the –enable-gui=no and –without-x options, or else vim will start X11 every time you run in:
[~/code/vim72]% ./configure --enable-gui=no --without-x --with-features=huge --prefix=/usr/local
[~/code/vim72]% make
[~/code/vim72]% sudo make install
Switch out the system vim for the one we just created:
[~/code/vim72]% sudo mv /usr/bin/vim /usr/bin/vim.mac.old
We’ll need some way to start the Eclim daemon that was installed, and eclimd doesn’t care for symlinks, so I created an alias in my .zshrc (or .bashrc if you use bash):
alias eclimd='/Applications/Eclipse/eclimd'
Next, we need to fix the /Applications/Eclipse/eclimd shell script, because Apple’s readlink command does NOT support the -f option, so change this line:
RESOLVED=`readlink -f "$0"`
To this:
RESOLVED=`readlink "$0"`
Now, after all that, start up eclimd:
[~]% eclimd
You should see something like this (screenshot):
Alrighty, now we can start Vim, give these two commands a try to see if eclimd communication can be established:
(Will output the Eclipse and Eclim version if everything is working)ingEclim
:EclimValidate(You should get: “Result: OK, required settings are valid.”)
Hopefully you were able to get a connection. If not, leave a comment and I’ll try to help you out
Okay, so it’s set up, congratulations! Now what can you do with it, well I suggest checking out Eclim’s Java page to see what you can do, but the features I end up using the most are validation, completion and correction. Validation will validate the Java file every time you save it, marking the lines where errors in compilation occur. See the following screenshot (notice the red “>>” markers):
Completion (through Ctrl+x-Ctrl+u) gives you the awesome completion that Eclipse has, like so:
Correction allows you to go to a line with an error marker, and have Eclipse suggestion a fix, just like it would in the IDE, to apply the fix, put the cursor on the red line and hit Enter:
Now go read all the documentation to see the neat things you can do
I usually end up doing the actual project management (adding files, adding external jars to the classpath, generating ant build.xml files and other gui-type stuff) from Eclipse still, but for the actual coding, I’m all about Vim.
Oh yea, one other thing I should mention, so Vim settings for your .vimrc that are really helpful for this:
If you use Supertab (tab-completion with tab instead of Ctrl+x-Ctrl+u):
" Supertab settings
" supertab + eclim == java win
let g:SuperTabDefaultCompletionTypeDiscovery = [
\ "&completefunc:<c-x><c-u>",
\ "&omnifunc:<c-x><c-o>",
\ ]
let g:SuperTabLongestHighlight = 1
And some Eclim .vimrc settings that I use:
" Eclim settings
" ,i imports whatever is needed for current line
nnoremap <silent> <LocalLeader>i :JavaImport<cr>
" ,d opens javadoc for statement in browser
nnoremap <silent> <LocalLeader>d :JavaDocSearch -x declarations<cr>
" ,<enter> searches context for statement
nnoremap <silent> <LocalLeader><cr> :JavaSearchContext<cr>
" ,jv validates current java file
nnoremap <silent> <LocalLeader>jv :Validate<cr>
" ,jc shows corrections for the current line of java
nnoremap <silent> <LocalLeader>jc :JavaCorrect<cr>
" 'open' on OSX will open the url in the default browser without issue
let g:EclimBrowser='open'
Enjoy!
Why don’t Christian writers license their work with Creative Commons?
Alright, non-technical, semi-religious post. If all you care about is technical stuff, skip reading this.
So I’ve had this nagging feeling every time I read a Christian book (other than the Bible), something that the author intended to inspire, impart knowledge, hold accountability and so forth, of why would the author want me to pay to hear this? I don’t understand why a Christian author, intentionally writing a book meant for a Christian audience, licenses his/her work in such a way that the book will only reach people who spend an amount set by the publisher and/or author, instead of a broader audience.
Now, let me set something straight. I haven’t written a book, I don’t know the entire negotiation process that goes on between the publisher and author. What kind of deals are brokered? I don’t know. Is there a secret ritual or rite of passage that occurs before given the go-ahead to write a book? I don’t know.
So where does that leave me? Empty speculation and argumentation about something I don’t fully understand the entire workings of. Welcome to the internet.
Let’s pretend you’re an author.
You have an awesome idea, inspiration touched you and you feel compelled to share that inspiration with the world. So, what better way than a book right? I mean, people still read nowadays right?
So you write, you write during your free time about something you’re passionate about, and (assuming you’re writing a Christian book, which is what this post is about) you want to share it with as many Christians as possible. So you sign on with a publisher to distribute, print and market the book. Let’s say your book ends up costing $14.95, which seems in line with where book prices for this sort of book are.
Now comes the hard decision. Will you as the author sacrifice your original intent to spread the word of your book to as many people as possible by having a barrier to (readership) entry of $14.95?
Because that’s what I feel like Christian authors are doing. Maybe they aren’t aware there is an alternative?
Take, for example, Shane Claiborne’s book: The Irresistible Revolution. This is a book that, while it has its faults, I think would be beneficial for all Christians to read, so why the cost of $10.19 (on Amazon) for something that should be a work of service to the Christian community? Shane has a very anti-consumerist message in a lot of his books, so why even charge for the book at all? (I understand charging for a hard copy of the book because of printing fees, etc, but why not just post it free online as a PDF?) I know that Shane is not a professional, full-time author, so the money is not going to support him. Is the money going to charity? Great! There is still a win-win situation for both parties: licensing the book under Creative Commons.
There a few different licenses to choose from. Shane could go with Attribution Non-Commercial No Derivatives for the license, which would mean he would be attributed as author of the work, someone else could not sell it and no derivatives could be made of it. However, it could be freely distributed and copied, which is exactly the point of writing a Christian book to me.
This doesn’t preclude making money (if so desired, for charity or supporting the author) from the book. Creative Commons allows for dual-licensing a work, so Shane could enter into a revenue generating license (i.e., with Zondervan, the current publisher of Irresistible Revolution), while preserving the disseminating power of a CC license. This of course assumes Zondervan would be up for that idea, I hope they would.
It’s not like it hasn’t been done. Look at authors like Cory Doctorow, whose novels are both published by Tor and released with CC license on his website, to encourage sharing of his works. Take “Someone Comes to Town, Someone Leaves Town” for example, I purchased a copy at Barnes & Nobles (for ~$10 I think), but the entire book is also available to anyone who wants to download it from Doctorow’s site.
The point is, writing a book meant to be widespread can be assisted by licensing under Creative Commons. And, since one of the points of being a Christian author is to reach a large Christian audience with your message, I have to ask, why don’t more Christian authors release their books under CC licenses and then dual-license with another license? Did we focus on the wrong goal of writing a book for Christian audiences (by a Christian), that is, making money?
Shouldn’t we be focusing on the message and not the monetary gain?
Labview_rails and development motivation
Alright, my wife has been trying to convince me that I should share the one-off I wrote for our internal lab management, so today I finally got around to fixing the last *major* bug in the system, and putting it up on github.
Yep, that’s right, you too can have a quasi-specialized lab management Ruby on Rails application to manage all the machines in your lab!
What I do hope that this does is inspire me to become a better Rails developer. I’ve been using Ruby for over a year now, I an extremely confident in my Ruby skills, and I’ve made many things I consider useful for myself and maybe for other people. Labview was my first real Rails project, and by first “real” project, I mean first one that I use every day, other people in my office use, and I feel halfway confident releasing it for people to see.
On the other hand, the testing is lacking, documentation is poor and some of the authentication systems are kind of hacked together. I’m labeling this one a “learning experience” and moving on. I probably won’t commit any more to Labview (but that doesn’t mean I wouldn’t be open if someone wanted to fork it on Github…) simply because right now it works well enough.
Oh yea, and I can’t thank my wife Delilah enough for the better visual design. You should have seen Labview back when it was hacked together in PHP. It was a pastelle assault on the eyes.
Anywho, Labview is a really simple project, and a great start for someone interested in getting into Rails. I’ve learned a lot from developing it, and a lot of the knowledge has immediately been applied in some other projects I’m working on. Perhaps the next Rails app I work on will conform for test-driven-development? I’m looking forward to other projects I have ideas for in the future
I’m also excited about taking a look at Sinatra, since Atmos did a talk on it last night at the Ruby meetup. Specifically, I’m interested to see if I can build a ssh-tunneling server using only Sinatra and Ruby over HTTP…
From Newsbeuter to Instapaper with the Ruby RicePaper library
I love Instapaper, a truly elegant solution without any needless over-architecting. I use it every day, for queuing up articles to read during a lull in the workflow around here.
However, I’ve had an extra step in my article reading, see I read my RSS feeds in Newsbeuter, so I normally have to open the feed in Newsbeuter, open it in the browser, use the bookmarklet to add it to instapaper, then close the tab (until I want to read the article later). Well no more!
Enough introduction, I haven’t posted nearly enough on here lately, so I wanted to share a little library I’m working on called RicePaper. It’s a simple Ruby library/cli tool for submitting URLs to Instapaper. I’ve started a github project for it, go check it out or download the file directly. RicePaper requires the HTTParty gem (which you can install using “sudo gem install httparty” on a system with Ruby installed) Ricepaper works extremely easily from the command line, like so:
% ./ricepaper.rb -u user@mydomain.com -p mypassword -t "The IWishI site" "http://iwishi.org"
The -t “<title>” option is optional, Instapaper will attempt to find a title for the article without it. You can also use ricepaper from any Ruby code (if you’re a Ruby scripter) as a library by using this little code:
require 'ricepaper'
rp = RicePaper.new(user@email.com, password)
rp.add("http://www.asdf.com", "The ASDF site")
rp.add("http://www.google.com")
It’s extremely simple to use.
Anyway, back to what I was originally going to use it for, bookmarking a URL directly from Newsbeuter, for that, we’ll need a “glue” script, like this (I named mine ricepaper.sh):
#!/bin/bash
# Change these to be your instapaper credentials
USERNAME=email@domain.com
PASSWORD=yourpassword
# Where the ricepaper executable is located
RICEPAPER=ricepaper
# If the title is non-empty, set it
if [ ${#2} -gt 0 ]; then
$RICEPAPER -u $USERNAME -p $PASSWORD -t "$2" "$1" > /dev/null &
else
$RICEPAPER -u $USERNAME -p $PASSWORD "$1" > /dev/null &
fi
# Exit correctly, either way
exit 0
Watch out for the quotes in the script above, sometimes wordpress makes them “special” quotes, which confuses the bash interpreter.
Replace the username and password to your Instapaper credentials and put the correct location to the ricepaper ruby executable, then save the script, chmod +x it and put it in your path somewhere.
Only one step left, which is to add this line to your ~/.newsbeuter/config file:
bookmark-cmd ricepaper.sh
What happens now, is when you bookmark an article in Newsbeuter, it will call ricepaper.sh with the URL and Title of the article, so whatever you put the Title of the bookmark to be, that’s the title that will show up on Instapaper. Voila!

Feel free to email if you have any questions about using the script(s). Hope you enjoy!
Installing HyperEstraier Ruby bindings with Ruby 1.9.1 (RC1)
Lately I’ve been doing a lot of coding around an awesome database called Hyper Estraier, which allows me to create large inverted-index databases to search over very quickly.
I have also been playing around with the new Ruby RC release for version 1.9.1. In an effort to get some current code running, I found that hyperestraier doesn’t compile the native ruby bindings using 1.9.1 correctly. You’ll see this error when attempting to compile:
~/hyperestraier-1.4.13/rubynative$ make
( cd src && if ! [ -f Makefile ] ; then /usr/local/bin/ruby extconf.rb ; fi )
checking for estraier.h... yes
checking for main() in -lestraier... yes
creating Makefile
( cd src && make )
make[1]: Entering directory `/home/hinmanm/hyperestraier-1.4.13/rubynative/src'
gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_ESTRAIER_H -D_FILE_OFFSET_BITS=64 -fPIC -I. -I.. -I../.. -I/usr/include/estraier -I/usr/include/qdbm -Wall -O2 -g -Wall -Wno-parentheses -O3 -fomit-frame-pointer -fforce-addr -o estraier.o -c estraier.c
estraier.c: In function ‘doc_make_snippet’:
estraier.c:354: error: ‘struct RArray’ has no member named ‘len’
estraier.c: In function ‘db_search_meta’:
estraier.c:767: error: ‘struct RArray’ has no member named ‘len’
estraier.c: In function ‘objtocblist’:
estraier.c:1192: error: ‘struct RArray’ has no member named ‘len’
estraier.c:1195: error: ‘struct RString’ has no member named ‘ptr’
estraier.c:1195: error: ‘struct RString’ has no member named ‘len’
estraier.c: In function ‘objtocbmap’:
estraier.c:1221: error: ‘struct RArray’ has no member named ‘len’
estraier.c:1227: error: ‘struct RString’ has no member named ‘ptr’
estraier.c:1227: error: ‘struct RString’ has no member named ‘len’
estraier.c:1228: error: ‘struct RString’ has no member named ‘ptr’
estraier.c:1228: error: ‘struct RString’ has no member named ‘len’
make[1]: *** [estraier.o] Error 1
make[1]: Leaving directory `/home/hinmanm/hyperestraier-1.4.13/rubynative/src'
make: *** [all] Error 2
This error comes from a not-so-great practice of using RSTRING(foo)->len and RARRAY(bar)->ptr in the code, which was removed in Ruby 1.9.1. The correct way to fix this is to make these changes:
RSTRING(foo)->lenandRSTRING(foo)->ptr
becomes:
RSTRING_LEN(foo)andRSTRING_PTR(foo)
RARRAY(bar)->lenandRARRAY(bar)->ptr
becomes:
RARRAY_LEN(bar)andRARRAY_PTR(bar)
For HyperEstraier, this is a pretty quick fix, there’s a link to the patch at the bottom of this post, after downloading, simply do:
[4:hinmanm@dagger:~]% cd hyperestraier-1.4.13/rubynative/src
[4:hinmanm@dagger:~/hyperestraier-1.4.13/rubynative/src]% patch < ~/hyperestraier-ruby191.patch
patching file estraier.c
[4:hinmanm@dagger:~/hyperestraier-1.4.13/rubynative/src]% cd ../
[4:hinmanm@dagger:~/hyperestraier-1.4.13/rubynative]% ./configure && make && sudo make install
And Hyper Estraier should be installed and ready to use in ruby 1.9.1 RC1! Enjoy!
Download the patch: [hyperestraier-ruby191.patch]
De-googling
This has been a post I’ve wanted to do for a while. I’ve finally started the slow transition away from Google’s tools.
Let me start off by saying I have nothing against Google at all. I find their tools incredibly useful and I think they’re an awesome company. I think so far they’ve done a pretty good job of following their “Don’t be evil” motto, I can imagine it’s quite difficult for a company that size. Anyway, suffice it to say that in the interest of privacy, I’ve decided to move as much as I can away from Google’s tools. I find it marginally creepy that a site can see example what I send in email, read in RSS feeds, put in my calendar, take notes on, etc. So what am I moving all this stuff to? Well, let’s take a look at each tool in turn: (Keep in mind that I am a console user who likes lightweight applications, and I like almost everything I use to have vi keybindings, hence the focus on console applications)
Gmail is pretty awesome, and I do really enjoy the amount of space of Google is kind enough to lend us. However, I’m not a fan of anyone reading my email. I have moved all my email over to my hosting solution (the company that is hosting writequit.org). It’s going to take me a long time to go through all the accounts I have and update my email address, but I don’t think it’ll be too difficult. While I’m talking about email, I’d like to plug an awesome email client that I’ve been using, Sup. Sup is similar to Mutt, written in Ruby and has a gmail-esque feel to it (tags, archiving, fast search, not having the nightmare of contact management like Mutt). Here’s a screenshot (from Sup’s site, not my mail)
Search
I haven’t used Google search for quite a while, I have all my browsers set up to search through Scroogle over SSL (through a handy Firefox search plugin), part of this is privacy at coffeeshops (and at work), and part of it is because Scroogle’s results page is much cleaner and offers much easier links for Vimperator than Google’s. I encourage anyone who doesn’t want their search strings to be statistically correlated to check it out.
RSS
I’ve tried a lot of native client RSS readers over the last year, and I still didn’t find one that could compare to gReader until I finally stumbled onto Newsbeuter from a link in one of Zed Shaw’s rants. I have to say that after only a few hours, I was hooked. Newsbeuter’s claim to fame is being the “Mutt of RSS readers”, and it certainly is (it was much closer once I mapped j to ‘down’ and k to ‘up’ in the configuration). I have 200+ feeds, and I have to say I’ve actually spent less time reading feeds using Newsbeuter than I have using google-reader (which is a good thing), mostly because it’s easy to mark things read without actually reading the article, I don’t have to wait for images to load, etc. If you’re a fan of console applications, give Newsbeuter a try! Here’s a screenshot of what Newsbeuter looks like (again, from Newsbeuter’s site, not my setup):
Calendar
I shy away (far-far-far-far away) from using Outlook’s calendar in the office. Yes, I know this irritates the heck out of people because they never receive a little email stating that I’ve pledged an hour of my life to them, but I’m okay with that. Usually, I would receive an invitation, enter it into gCal and use that to track meetings and other requests (it works for me, I tend not to have a ridiculous amount of meetings anyway). Well, rather than Google’s knowing exactly where I am at all times, I’ve switched over to using Remind. Remind allows me to use a simple scripting language to set up reminders, send me reminders before meetings and so forth. Here’s an example of a simple reminder:
REM 17 Dec +2 AT 11:30 +15 DURATION 2:00 MSG Holiday pot-luck for work %b %
(On the 17th of December at 11:30-1:30 there’s a pot-luck, remind me +2 days before the potluck and also +15 minutes before it)
I use Wyrd (weird) as a really nice console gui for remind, which lets me see what I’m doing that day. Here are a couple of screenshots, one of remind and one of wyrd:
Notes
Well, this is an easy one, I tend to have plaintext notes, so if I want to store them, a flatfile works great, or a wiki for more complex note taking (I mostly only note things like what compilation flags I used for what, so flatfile it is for me!). Previously I was using Google notebook, so this is an easy switch.
Caveats
All this switching is not without caveats. Let me go over some of the difficulties of switching some of these things:
- Google Code and Google Groups both *require* you be signed in, and use your gmail address for posting information, seeing as how I use both of these a lot, I have no choice but to keep my gmail address and forward email to my new address. At least, until OS projects move away from these products (don’t see that happening for quite a while).
- Google’s Gmail spam filtering is awesome, I haven’t had spam in my inbox for over a year, I think I’ll be brushing up on my spamassassin configuration knowledge quite a bit now.
- Gtalk is gone, yes, I did use gtalk occasionally over the last year, however it’s blocked at work anyway, so I won’t miss it much, I tend to use AIM, Yahoo or IRC anyway.
- A web interface for everything. Yes, I do use more than one computer, so I need a way to sync my email, RSS, etc. I tend towards SSHing into my home computer and using screen helps. I can deal with the minor inconvienience
- Calendar sharing, I share calendars with my wife and another friend of mine. Rest assured I’ll find a way to share my calendar, perhaps a cronjob for rem2html?
- I’m sure there are other inconviences I’ve yet to encounter, but I’ll deal with them as well as I can.
Closing thoughts
Was I able to completely de-google my life? No. Do I hate Google? Not at all. Do I hate people you use Google’s products? Of course not! What I do hope sharing this has done is given you an idea of just what kind of information you’re sharing with <insert web company> when you use their tools. I was unable to completely separate myself (google groups and google code) from Google, but I was able to make a significant amount of headway in reduction of statisticaly marketing research. I encourage anyone interested in privacy to maybe look into switching to some different tools. Of course my tools might not be the same tools you pick, but at least I’ve given some alternatives
Good luck!
EDIT (1 minute later): I should also note that I use NoScript, and block javascript from google-analytics, I feel this helps a lot when trying not to become a statistic
Switching from MacBook Pro to an ASUS EeePC
Well, the display on my Macbook Pro finally decided to die on me, for no apparent reason (I was just sitting in bed, listening to some music when it died). So, I decided that rather than pay for a repair, I’d continue to use the MacBook as a desktop with an external display, and get a tiny netbook for day-to-day use (because I need a laptop to carry, go to coffeeshops with and generally use).
I ended up going with the EeePC (The 1000H model), because I could get the entire laptop for only a little more than repairing the screen of my MacBook (and a brand new Mac is terribly expensive). I’ve been playing with my new netbook for about a week now, and I thought I’d share some of my experiences.
The EeePC came with Windows XP preinstalled, so I promptly partitioned it down to 25g for Windows, 40g for Music and the rest (~90g) for Ubuntu-eee. I decided to go with Ubuntu-eee because of the custom kernel that supported the hardware out of the box without fiddling around. While I really really enjoy fiddling to get stuff to work, I don’t want to have to fiddle just to be able to get a working machine, especially when I’m somewhere I need to actually do some work. I almost immediately switched from the user-friendly Netbook remix interface to a classic Gnome interface, but I could see how it would be really nice for someone newer to Linux.
Here’s some of the key things (?) about my new EeePC (and Ubuntu-eee):
- I like how portable this is, it’s definitely lighter than my MacBook Pro
- It’s not ridiculously expensive like a Mac is
- I like Linux, since I tend to do all of my development on *nix systems, it’s great to have one as a main machine.
- 1024×600 is very small, especially coming from 1440×900. This is helped by fullscreen mode in things like Firefox (with Vimperator for even more screen space) and Gnome Terminal.
- Wifi and networking work great, this has always been shaky on Linux systems, I’m glad that I don’t have to fiddle for 20 minutes just to join a coffeeshop’s hotspot
- Suspend and Hibernate work great, also a big feature, especially since Apple’s sleep feature spoiled me to never turn my Mac off.
- I don’t like some of the trackpad stuff. It’s difficult to turn off the tap-to-click, attempting to install packages to manage it disable the vertical 2-finger scrolling, it’s _insanely_ sensitive (the pad, the buttons themselves are kind of stiff).
- The keyboard is great, since I got the 10″, it’s not small enough to bother me during coding sessions, which I’m sure the 8.9″ would have.
- This machine definitely has less power than I’m used to, but I make up for it by doing a lot of resource-intensive stuff on my home machine over SSH, which makes up for it.
- Con: Linux twitter clients suck. Adobe AIR clients take a ton of resources also.
- Con: Linux sound stuff still sucks, it struggles with 2 processes attempting to share the sound device using ALSA.
I would definitely _not_ recommend this device to anyone with ailing eyesight, I tend to use 8 or 9pt font for everything, and I could definitely see some eye strain for anyone who has vision trouble. Don’t get one for your grandparents unless you don’t play on much screen space being usable (or don’t do everything in the console, like I do
).
And, since I like pictures, here’s a few pictures of my new machine:
Compiling inavd server on FreeBSD
Just a short post, working through some of the modules I received, I ran into the inav module. Turns out that inavd doesn’t compile very nicely on FreeBSD, so I patched it. Previously when trying to compile you get:
c++ -ggdb -g3 -D INAV_VERSION= -c sniffer.cpp
In file included from sniffer.cpp:34:
/usr/include/netinet/ip.h:162: error: 'n_long' does not name a type
/usr/include/netinet/ip.h:165: error: 'n_long' does not name a type
*** Error code 1
So, download the inav-server-0.3.6-freebsd.patch into the directory where you untarred the server and issue the following commands:
cd <dir where you untarred INAV tarball>
patch -p1 < inav-server-0.3.6-freebsd.patch
cd server
make
Right now, the patch is very unclean and making the unitTests doesn’t work, but it does compile inavd and allow you to run the server on FreeBSD, enjoy!











