• Home
  • Blogger
  • Github
  • Travel
  • The Tank Project
skip to main | skip to sidebar

Steven Occhipinti

A braindump.

Cleaning up indicator-applet in Ubuntu

By default, the indicator applet in the Unity panel has an item in the list for evolution and another for empathy - two programs I don't use!

But, its quite easy to get rid of them! All you have to do is remove the appropriate file in /usr/share/indicators/messages/applications

Instead of removing them, I just removed all read permissions (root can still do anything with it of course)
$ cd /usr/share/indicators/messages/applications
$ sudo chmod 000 empathy evolution
Posted by Steve at 20:33 0 comments
Labels: linux , ubuntu Email This BlogThis! Share to X Share to Facebook

Multi monitor keyboard shortcuts in Ubuntu

I'm now using Ubuntu 11.04 with Unity as my primary OS for my desktop at work.
I'm still coming to grips with Unity - somethings I like, others I don't.

One of the things I do like is the compiz plugin called "Grid".
At first I thought it was just a clone of Windows 7 where you can drag a window to the left and it will fill the left half of the screen, drag it to the top and it will maximize, but after taking a look at the key bindings it does a bit more!

Using alt + ctrl + the number pad, you get more options!
Alt+ctrl+4 will make the window fill the left half (like dragging), 6 will do right, 8 will do the top half, 2 will do the bottom half and 7, 9, 1 and 3 will put the window in the appropriate corner, 5 will put it in the middle and 0 will maximize it.
On top of this, if you press the key repeatedly it will adjust from 1/2 screen, to a 1/3, to 1/4, to 3/4 and to 2/3. This is surprisingly easy to use and really helpful!

The only thing I couldn't work out how to do was move a window from one monitor to the other as these actions occur per monitor (i.e. 1/2 of one screen).

The answer was quite easy though, I just needed to enable one more plugin: "Put".
The "Put" plugin looks like it does similar actions to "Grid", so before I enabled it, I disabled all the key bindings (there was only about 2 enabled anyway).
Then I set the keyboard binding for "Put To Next Output" to "<Control><Alt>KPEnter".

When I enabled it, the Unity panel got a little screwed up (which is evidently not hard to break), so I restarted X and everything worked how I expected it to.
Now atl+ctrl+keypad-enter will move the window between my left monitor and my right monitor!
Posted by Steve at 15:55 0 comments
Labels: compiz , linux , ubuntu Email This BlogThis! Share to X Share to Facebook

The Tank Project!

So my brother Rob and I have wanted to work on a project together for a while now, and after our awesome Minecraft Server, we came to the realization that I love doing the functional side of things (setting up the software, etc.) and Rob loves doing the creative, hands-on side of things (putting the hardware together and making it look pro) and so together, this things compliment each other!

After scoring a Netduino (like an Arduino, but I write in C#.net instead of C) for use in a future project, this was the perfect opportunity for our skills to come together as Rob isn't keen on programming, and I'm probably not as good as him at making things, whereas he is quite passionate about that!

I've always wanted to have a play with an Arduino (or Netduino in this case). To actually allow my interest in programming to bridge across to the hardware world always seemed like a mystical unknown to me, but these little programmable micro-controllers allow just that - my software to use hardware!

Enter The Tank Project!

The idea was to build a physical tank that we can use the Netduino to control, but not just limited to controlling the movement of the tank, but then a variety of other features.
Things that came to mind were a working (not-so-dangerous, legal) canon, webcam feeds for remote control, mobile application to drive it, 360 degree spinning turret and just about anything else we could think of!
Our imagination started going wild with vague memories back to Robot Wars and so we set aside a day to brainstorm ideas and develop a plan of attack (pardon the pun). That day was yesterday, and it went well! :)

We're going to try to keep a project blog going if you want to keep track of the progress:
http://tank.stevenocchipinti.com

("keep track of the progress" is also a pun... theres going to be a few of these, lol!)
Posted by Steve at 15:31 2 comments
Labels: netduino , tank Email This BlogThis! Share to X Share to Facebook

DHCP fixedhosts to /etc/hosts file

This was a completely random (and not that useful) thought!

I have memorized which IPs are assigned to which machines in our home LAN as simply pinging a hostname doesnt really work in linux (by default) as it did with windows (unless I setup WINS... I think... correct me if I'm wrong).
So short of setting up an in-house DNS server, hosts files come in handy for stuff like this.
(I really didn't need to setup a hosts file, but assuming I did want the convenience)

I thought I've already defined which hosts get which IPs in the fixed hosts table of the DHCP server in my router, surely I could just use that!
I remembered the router has telnet open internally, so I wrote a one-liner to do it:

echo "admin^M$PASSWORD^Mdhcpserver list fixedhosts^M^]^D" | nc 192.168.1.1 23 | \grep "[ ]*[0-9]" | sed "s/[ 0-9]*| \([^ ]*\)[ ]*| \([^ ]*\).*/\2\t\1/g"
I echo the username, password, the command to give me the table and logout then grep for the (numbered) entries of the printed table, which gives me entries that look like this:

...
   4 | stevepc    | 192.168.1.3      |  00:11:22:33:44:55  | 0         |
   5 | NAS        | 192.168.1.10     |  00:22:33:44:55:66  | 0         |
   9 | Minecraft_SVR | 192.168.1.62     |  00:33:44:55:66:77  | 0         |

...

Then I use sed to put it into the same format as /etc/hosts:
...
192.168.1.3     stevepc
192.168.1.10    NAS
192.168.1.62    Minecraft_SVR
...
This isn't really that useful, but it took a couple of minutes, just to "see if I could do it"... and it worked :)

... I don't think I'll actually use it, lol, but it was fun anyway :P
Posted by Steve at 22:28 0 comments
Labels: bash , linux , regex , sed Email This BlogThis! Share to X Share to Facebook

Multiple Google accounts at once!

So I started my new job and they use Google Apps!
Initially I thought this was fantastic, until I realized that because I also use Google Apps for my personal email, I couldn't have 2 simultaneous gmail logins (by default).

I found some out-of-date firefox plugins to work around this, but they weren't very nice, so I just pinned my work gmail as an app tab and left it at that.

Then I noticed a co-worker had about 3 gmail app tabs, and too my surprise it wasnt some dodgy plugin that allowed this, but an official Google solution!

The answer:
http://www.google.com/support/accounts/bin/answer.py?answer=181599

This allows you to have multiple Google accounts signed in at once, with a few caveats.
Once enabled, the first account you sign into is your "primary" and behaves normal, the subsequent logins will only work on particular products (gmail is the obvious one) but will work in isolation to your other logins.

I chose my personal account as my primary because things like blogger do not work as a secondary account.. and I don't have a work-blogger account :P

This is was only really an issue if you want to use a single browser on a computer, as my phones gmail app handles multiple logins fine.
Posted by Steve at 09:36 2 comments
Labels: Google Email This BlogThis! Share to X Share to Facebook

24-70mm f2.8 VS 17-50mm f2.8

A friend of mine has a Canon 24-70mm f2.8 'L' lens and after having a play with it and looking at his photos I have had a little bit of gear-envy.
The extra speed and frequent bokeh was really nice!
Naturally I started looking at prices.. and the Nikon equivalent is... not cheap!

I cant justify $1969 on a lens! Especially considering that I dont actually need it, and I am just a hobbyist (therefore: return on investment == profit from my work == $0).

I then read up on some more affordable Sigma and Tamron lenses that were similar and liked the prices much better!
... but im still really indecisive :(

Then I saw the 17-50mm f2.8 lenses (from Tamron, Sigma and Tokina), and this made me think..
When I was travelling to Japan (with Sarma, the Canon guy) I remember him complaining about not being able to get a wide enough shot and he would often stand pretty far back to get the shot he wanted or swap to his 10-20mm lens.
This probably wouldn't be an issue with a full-frame camera, but the 50d's smaller sensor means it is already quite "zoomed-in" at its widest setting.

I started writing up an email to ask Sarma what he thought and realized I have all his photos from our Japan trip, so with a bit of linux command line fun, I came up with this:
exiftool -p '$focallength' -q -f `find -L .` | sort -n | uniq -c
Now for the explanation:
exiftool -p '$focallength' -q -f
exiftool extracts exif information from jpg's.The -p prints a formatted string, which I inserted just the $focallength variable.The -q means quiet (basically, dont print too much).The -f is the list of files, which I use a sub-command (wrapped in backticks) to get.
find -L .
As all of our groups photos were kind-of mixed in together, I created a directory with symlinks to just Sarma's photos (hence the find -L, where -L will follow symlinks to the appropriate directories).
sort -n
This just sorts the data by numberic value (so 10 > 1), this is mainly so the uniq command works properly.
uniq -c
This will collapse the data down to unique values and with the -c, it will also print the number of occurences have been collapsed down.
The output of this command included all of Sarma's photos (not just taken with the 24-70) but it still gave me a pretty good idea.
The output looked like this:

86    10.0 mm
2     11.0 mm
2     15.0 mm
14    16.0 mm
2     18.0 mm
108   20.0 mm
2362  24.0 mm
142   28.0 mm
176   32.0 mm
138   35.0 mm
104   40.0 mm
118   45.0 mm
136   47.0 mm
120   50.0 mm
94    55.0 mm
78    58.0 mm
76    60.0 mm
76    65.0 mm
70    67.0 mm
52    70.0 mm
52    73.0 mm
34    75.0 mm
14    80.0 mm
48    82.0 mm
56    84.0 mm
18    85.0 mm
24    88.0 mm
10    90.0 mm
14    92.0 mm
12    93.0 mm
16    95.0 mm
10    96.0 mm
4     97.0 mm
8     98.0 mm
8     99.0 mm
12    100.0 mm
10    102.0 mm
404   105.0 mm

With the majority of Sarma's photos clearly being taken at 24mm, it made me think that as I too have a cropped sensor camera, the wider 17-50mm lenses are probably a better choice for me as I really dont have any plans to lash out on a full frame camera anytime soon :P
Posted by Steve at 19:12 2 comments
Labels: bash , linux , photography Email This BlogThis! Share to X Share to Facebook

(Minecraft and) Arch Linux FTW!

I haven't really played a game properly since back in my Counter Strike days, but recently my brother and I started playing Minecraft... and its incredibly addictive!

Minecraft give you the option of running a Java based dedicated server and so as we were starting out, my brother would start up a dedicated server and we would both connect to it.
As time went on, we thought it would be really cool to have a dedicated Minecraft box and thought we could build one out of some old hardware, which brings me to the HTPC!

A little while ago, my brother built this (the black box):


He did an awesome job!
Basically gutted our very first dvd player (which was great for its time) and got some cheap (physically small) hardware off eBay and managed to fit it all inside!
It involved making alot of little brackets, extender cables, etc. but with a lot of effort it turned out pretty impressive!

Unfortunately, using it as a media pc was a bit tough as it wasn't the most powerful of machines around and the graphics drivers weren't working too well so this got left in the dust for a while... until Minecraft came along!

Last weekend we decided to make this our dedicated server :)
A while ago a friend of a friend was talking about how good Arch Linux was for its simplicity and ease of administration, so I started reading up on it and I am impressed!

On the Arch Linux wiki they have a couple of guides to help you get going, but my favorite page was the explanation of the boot process.
After a bit of reading I worked out my plan of attack:
  • Burn ISO to cd
  • Install Arch Linux
  • Install sudo (via pacman) 
  • Setup 'minecraft' user with sudo access to the poweroff command
  • Install Java (via pacman)
  • Install rungetty (via AUR)
  • Replace 'agetty' with 'rungetty' and make the minecraft server startup on tty1, followed by a 'poweroff'
  • Configure Wake-On-Lan

After the server was all setup, I wrote a little client side wrapper that will:
  • Launch minecraft
  • Broadcast a magic-packet to power on the server
  • Start pinging it and when it is available, notify me via Ubuntu's 'notify-send' command

So now when I want to play Minecraft, I launch my script and it will power on the server and launch the client, I log in, wait about 5 seconds until my fancy fade-in notification appears, then join the server, play, and when im done, I issue the '/stop' command in Minecraft and it will stop the server and power it self off!

This was a great first experiment with Arch Linux and I didn't even know what getty was before this day.

Needless to say I was pretty happy with this setup and all in a days work :)
Posted by Steve at 18:25 2 comments
Labels: arch linux , bash , htpc , linux , minecraft Email This BlogThis! Share to X Share to Facebook
Newer Posts Older Posts Home

Blog Archive

  • ▼  2013 (4)
    • ▼  June (1)
      • Printing over previously printed characters and lines
    • ►  May (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (17)
    • ►  December (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (3)
    • ►  February (3)
  • ►  2011 (33)
    • ►  December (1)
    • ►  November (3)
    • ►  October (3)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (6)
    • ►  April (3)

Labels

android (5) apache (1) arch linux (1) arduino (1) bash (11) calendar (1) compiz (1) design (1) diff (1) email (1) gimp (1) git (3) github (2) gnome3 (1) Google (2) hacking (1) hardware (4) howto (1) htpc (1) java (1) lamp (1) linux (28) Mac (2) minecraft (2) mysql (1) netduino (1) nfs (1) parallel port (1) patch (1) photography (4) php (1) pidgin (2) printer (1) programming (6) python (1) rails (1) regex (5) review (3) ruby (3) Samsung Galaxy S3 (2) Samsung Series 9 (1) security (1) sed (3) ssh (1) sudo (1) tank (2) Toshiba Portege (1) troubleshooting (1) ubuntu (16) ui (2) unity (2) vim (5) webcam (1) websites (3) xbmc (1) xclip (1) xul (1)

Total Pageviews

Sparkline
 
Copyright (c) 2010 Steven Occhipinti. Designed by Conveyancing
High Deductible Health Insurance, Purchase Beats