Jun 23, 2014

Excited for Divinity Original Sin

Somehow I missed the Kickstarter campaign but I'm still very excited to play Divinity Original Sin. For those of you who aren't familiar with it, it's a computer role playing game with tactical combat similar to Baldur's Gate 2. BG2 was one of the best games ever released so anything that can be mentioned in the same breath is thrilling.

From what I've seen on YouTube, you can interact with everything in this game. Move chests, chairs, brooms, etc. But, you'll be limited by your characters ability to do so. Trying to move a heavy chest when your toon is a weak mage? Better use telekenisis rather than brute strength.

It's also going to be smart about the environment. For example if you want to steal an object be sure nobody is looking! That's a great advancement from most other games where you can pretty much do whatever you want. Or, in best case scenarios, whatever you want as long as nobody is in the room. (Hat tip, Ultima III)

Plus, you'll be able to cast spells that cause rain which can in turn electrify your friends/enemies (friendly fire!) or douse flames. Coupled with the fact that you won't find a ton of quest helpers and you can see losing yourself just in the exploratory phase of this game.

The clincher for me is that it's got tactical combat. I do enjoy games like Guild Wars 2 and Diablo 2 (booo, D3) but I'd rather use my brain than test my twitch so being able to pause and think is a big win. (I'm also psyched that they've agreed to release a linux port of this game so I can play it on my lovely Debian system.)

One thing this game has which will be really nice is the ability to play with one other person. Each of you can have a henchman, cooperate or disagree, and work like a real team. At first I thought this was kind of lame but let's face it: it's way easier to find one person to play with than a group of 4. And even if I do find 4 friends who want to play, the way this game is looking I think I'll be really happy to try a few different playstyles with different groups.

Early indications from Steam early access is that it's living up to the hype. One more week and then we'll see!
Read on...

Apr 18, 2014

Suddenly my trackpad is unresponsive

It was the weirdest thing.. I'd be working on something, go to move my trackpad and it wouldn't budge. Then I'd try again and suddenly it'd jump to life. What on earth was going on? Ug, "last time I buy non-Lenovo or Apple hardware for my laptop" I thought.

The touchscreen was fine actually and after a day I found myself typing an email and tapping the send button rather than trying to use the mouse to click it. Enough of this nonsense, what's going on here!?

Well it turns out that Ubuntu has a feature that disables the trackpad while you're typing. Makes sense I suppose.. who wants big meaty hands accidentally moving your beloved cursor while you're typing sweet nothings to your dear 'ol sweetie pie?

Not I said the cat. Luckily the solution is fairly simple. Pop open your settings and head to the trackpad tab. There you'll find the options to disable it OR you can just lower the timeout. The default for some reason is 2 seconds. 0.2 seconds worked for me though you may want to try 0.5 if you're a bit slower.



If you don't have those settings, check out this handy blog post which will show you how to achieve the same effect from the command line.


Read on...

Apr 14, 2014

Setting up postgres for local development on Ubuntu 14.04



I'm starting to do some ruby development on my trusty (so far) Dell XPS 13. Time to get my stack set up. First order of business is Postgresql. Then Ruby, then rails, then it's go time. Let's get started!


For postgres, first update and get the packages you'll need:


sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install postgresql postgresql-contrib pgadmin3


I don't know about you, but for local development on my laptop I don't like to set up a password for postgres. Let's set that up.


sudo -u postgres psql
ALTER USER postgres PASSWORD 'newpassword';

If you chose '' in the above you'll have no password so there's one more step to take in order to connect locally. Pop open your editor of choice and modify the pg_hba.conf file. (For me that was located in /etc/postgresql/9.3/main/pg_hba.conf)

You'll want to make sure you entries look similar to this:


local all postgres trust


Here's the part of the file you need to alter:

 84 # Database administrative login by Unix domain socket
 85 local   all             postgres                                trust
 86 
 87 # TYPE  DATABASE        USER            ADDRESS                 METHOD
 88 
 89 # "local" is for Unix domain socket connections only
 90 local   all             all                                     peer
 91 # IPv4 local connections:
 92 host    all             all             127.0.0.1/32            trust
 93 # IPv6 local connections:
 94 host    all             all             ::1/128                 trust


One last thing you'll optionally want to do is uncomment the line in /etc/postgresql/9.3/main/postgresql.conf where postgres listens. This might not be necessary but let's get it done anyway:

listen_addresses = 'localhost'    # what IP address(es) to listen on;

With that out of the way let's give postgres as restart

sudo /etc/init.d/postgresql restart

And now you should be able to connect to postgres via the command line or pgadmin3.

Last thing. If you're going to eventually install the pg gem on ubuntu, you'll need to install the postgresql dev packages. Might as well do that now:

sudo apt-get install libpq-dev


With that all done you should be set. Give it a try from pgadmin3, your client of choice, or the command line
Read on...

Apr 13, 2014

XPS 13 Developer Edition - Day 1

So you pushed the Xubuntu 14.04 LTS Stick in and decided to give it a whirl. Before you go any further, keep in mind that, as of the end of day 1, I still have an overly sensitive trackpad, and can't get past the Operating System not found error without manual intervention. If you're cool with that, let's chat a bit about how I went about getting set up.




First, I went with XFCE. I don't hate Ubuntu proper but Dash isn't as efficient as I'd liked so I decided to step back a little.

Second, I installed a whole slew of software: The heroku toolbelt, build-essential, playonlinx, chromium, an xmodmap script, libreoffice, steam, dropbox, calibre, gnucash, audacity, gvim, vlc and many more.

I also got rid of some apps I'm unlikely to use like gnumeric, abiword, and thunderbird.

With that out of the way, here are some of the tweaks I've used:

1. On upgrade to 14.04 your trackpad may not work as it did before. You'll want to try blacklisting ic2_hid as mentioned in this post.

2. Trackpad still not where you want it? Try installing gpointing-device-settings as described in this post.

3. Want to rest your thumb on the trackpad the way you did on Mac OS X? Me too! I haven't been able to figure it out yet though I did find a blog comment where somebody left some instructions for debian. Didn't work for me but if it works for you, drop me a line!

And that's where I've gotten so far. Most of the other tweaks have been personal preferences to get the right programs and key bindings.

So what's next? I'd like to figure out that Operating System not found error (boot-repair did not work for me). I'd also like to try running a game like Hearthstone or Wildstar via PlayOnLinux. And then if things go really well, maybe try to get a VM set up with Windows or MacOS.

PS: if you mess something up badly and need your service tag number to get support from Dell, you can find it by typing. Probably do that now. :)


$ dmidecode | grep "Serial Number"


Read on...

Apr 12, 2014

Quick Tip: Don't show usernames on Xubuntu 14.04 Login

I'm continuing to peck away at things I want to customize in Xubuntu 14.04. Next on the list is getting rid of the dialog that shows my username on the splash screen. I'm not into having my laptop auto-login and so it's not surprised I don't want to display my username either. To get rid of it, open up a text editor and add these two lines to /etc/lightdm/lightdm.conf.d/10-xubuntu.conf


greeter-hide-users=true
greeter-show-manual-login=true

Restart lightdm (or reboot) and you're on your way. Woot! Read on...

Getting started with the XPS13 Developer Edition - Sputnik

I recently decided to give up my trusty Macbook Air and head back down the road of free-ish software. After considering the Asus Zenbook Infinity and Lenovo X1 Carbon, I opted to get myself a Dell XPS 13 Developer Edition notebook.

There's no single reason why, but the price had dropped significantly (right around $1000 as of this writing) and it came with 8GB of RAM and a touch screen. If it had had an option for a 512 GB SSD I would have probably gotten it long ago.

It appeared on the doorstep a few days ago, in spectacular timing with a price drop of an excellent 512 GB mSATA SSD from Samsung. After carefully swapping the hard disk out, using these handy instructions, I thought a bit more about what I was going to run on this laptop.

Before the hard disk swap I'd gotten a chance to play with the stock Ubuntu 12.04 that came with the laptop. For the most part things just worked though the touch pad configuration is terrible out of the box. I upgraded to 14.04 beta and played around a bit there as well.

14.04 beta is a lot less stable which surprised me given how soon this release is supposed to ship. In the past, I'd heard a lot of complaints about Unity so it was nice to use it for myself. It's not bad. I think my biggest issue is Dash which is just not as efficient as say Quicksilver or Spotlight. There's a much better app for ElementaryOS called indicator-synapse but I sadly couldn't figure out how to bind activation to my preferred Space keystroke.

So it was good to know that 14.04 was there and usable. But I have this brand new hard disk.. so I played around a bit. Here are the cliff notes:

1. Debian 7.4 with non-free drivers. (Required due to the firmware for my wireless card which is non-free). Booted but did not get WiFi

2. Debian Jessie alpha installer with non-free drivers. Booted but did not get WiFi

3. Linux Mint LMDE (Debian Edition). Booted, had wifi and most things seem to work. If you like Cinnamon, this is a pretty good choice for running a debian based distribution on your XPS 13.

4. The above but converted to Debian. There are some instructions for converting it to raw Debian. For grins I gave it a shot. It was mostly successful except some nagging issues like dual wifi indicators in my panels. I finally gave up on this as the hardware buttons for adjusting volume and brightness stopped working after the conversion.

5. Xubuntu 14.04 beta. This is where I finally ended up. XFCE4 is just a tad heavier than LXDE but I honestly can't notice it. Plus, the xfce4-terminal makes a great replacement for Guake if you add the --drop-down option. (For some reason guake keybindings won't let me set Control anything).

I'll try to post a few articles on how I set my machine up but keep in mind that this isn't a forum so you're best finding a user group or forum you like for technical questions if what I've documented here becomes outdated.

TL;DR: Tried a bunch of debian based distros on my XPS13 and ended up on Xubuntu. Other than an iffy trackpad, all else seems to work just fine!

Keep on keeping on.

PS: If you're looking to get the additional drivers that Dell shipped you can grab them here. Full warning, these might not be necessary and may even ruin your setup.
Read on...

Oct 8, 2013

Quick Tip, export from rails console to CSV

This is an ugly solution but one that can come in handy if you just need to get some sample data out of your rails application. My particular use case was exporting data from various tables into a CSV file so I could use a 3rd party email service. We have users in a multi-tenant app so it's not quite so simple as just exporting a single table. This is something you almost certainly don't need to use if your SQL-fu is strong. For the rest of us, here we go:



require 'csv'

file = "#{Rails.root}/public/users.csv"

userrefs = UserReference.where(:tenant_id => 7)

CSV.open( file, 'w' ) do |writer|
  userrefs.each do |ur|
    next unless ur.user.present?
    writer << [ur.user.username, ur.user.email]
  end
end

So what's going on here? Well, first things first we require the CSV library since we'll be manipulating a CSV file.

Next, we create a string that points to that file (make sure the file is created first). The userrefs variable grabs the top level data you need and from there we cycle though them adding records to our CSV file based on any associations we have. Done!

Pretty straight-forward but handy to have in a pinch!
Read on...

May 17, 2013

Quick Tip: Fix Sidekiq-Web with asset pipeline

For those still struggling to figure out why the HTML won't render with Sidekiq web, here's a quick tip:

Old way:

# routes.rb
require 'sidekiq/web'
# ...
mount Sidekiq::Web, at: '/sidekiq'


New way

# config.ru
require 'sidekiq/web'

run Rack::URLMap.new(
    "/" => Rails.application,
    "/sidekiq" => Sidekiq::Web
)
Read on...