Tuesday, 8 February 2011

I just received my first Arduino through the post. I went with the Arduino Duemilanove ATmega 328 which I bought on eBay from the seller arduino.hk who I can highly recommend. Their feedback speaks for itself.

I haven't had a chance to properly play around with it yet due to a house move but I will post something later on about it.

Friday, 31 December 2010

URemoteDesktop skipping 2 tracks on Rhythmbox

I downloaded an Android App called URemoteDesktop and when trying to skip a track on rhythmbox it skipped 2 instead of 1.

To fix this (Not sure if it buggers up something else so do this at your own risk), comment out the following lines in vd.sh.

xte "key XF86Back"
xte "key XF86Forward"

I'm guessing these are put in the if statement for programs that don't use XF86AudioPrev & XF86AudioNext.

Saturday, 13 March 2010

Streaming video from Ubuntu to Xbox 360 via BT Home Hub

Before my PS3 shit a brick and I replaced it with a Xbox 360, I tried to get Mediatomb streaming video from my Ubuntu machine to my PS3. Although it worked to some extent, there seemed to be a buffering issue. Videos would play for a few minutes then stop to load up more of the video.

While trying to set up uShare I came across the same problem. The obvious constant here was my router so while dicking around with the settings of my BT Home Hub I managed to solve the problem.

Here's what I did.
  1. Open the home hub's web page. The ip address should be 192.168.1.254.
  2. Click on Basic Config.
  3. Click on Wireless.
  4. Under "Wireless channel" change Channel selection to "Manual" and Channel to "11".
That's it. Give it a minute then crank up uShare.

Thursday, 11 March 2010

Using awk as a floor function

I was searching the internet trying to find out if awk had a floor function when I realised awk IS a floor function.



graham@graham-laptop:~$ x=3.5
graham@graham-laptop:~$ echo $x | awk -F. '{print $1}'
3
graham@graham-laptop:~$

You could always change $1 for $2 and it becomes a mod function.

Thursday, 4 March 2010

Selecting beginning of financial year in Oracle

I recently had to work out how to return the beginning of the financial year from an Oracle database. After trawling the internet, everything looked rather complicated for what I was after.



Below is what I came up with. It's pretty simple to change. If April is not the month you want to return, change the +4 at the end to the number of the month you want to return.



select trunc(add_months(sysdate, - (12 + to_char(sysdate,'MM'))+4),'MM')
from dual

Monday, 19 October 2009

OpenSSH for windows not recognising rsa authentication

It appears there is a bug in OpenSSH running on windows where it will not allow public key authentication.

To fix this simply edit sshd_config file in the /etc/ directory and change the strict modes line to show as

StrictModes no

Hopefully this saves some of you time.

Wednesday, 28 January 2009

Creating a launcher for FreeMind on Ubuntu

You've installed the FreeMind Software by using
graham@graham-laptop:~$ sudo apt-get update
graham@graham-laptop:~$ sudo apt-get install freemind

and you've exported your shell variables by using (if bash is your default shell, other wise substitute .bashrc for your shell startup script.)
graham@graham-laptop:~$ echo export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/ >> ~/.bashrc
graham@graham-laptop:~$ echo export PATH=$PATH:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/bin/ >> ~/.bashrc

but you would rather not have to type
graham@graham-laptop:~$ freemind
to start the software. (According to https://help.ubuntu.com/community/Freemind the launcher should appear under Applications->Office but mine didn't)

Lets face it, we like pointing and clicking on pretty icons. It makes you feel like a man.

First off, we need an Icon, and some kind guy called malefico andauer has created some. Here the are.




Save the image you want to use, I'm going to use the biggest one, into the directory where FreeMind has installed. Should be in /usr/share/freemind. As you will have to be a superuser to copy files to this location, type

graham@graham-laptop:~$ sudo cp /home/graham/Desktop/freemind_icon/48x48/freemind.png /usr/share/freemind/freemind.png

Once that's done, Right click on the Applications menu and select "Edit Menus".

I'm going to place FreeMind by kdissert (in Accessories) because I'm going to be testing both programs but you can put it wherever you want.

Click "New Item" and in the panel that appears type the following
Type=Application
Name=FreeMind
Command=/usr/share/freemind/freemind.sh
Comment=Mind Mapping Application

Then click ok.

If you want it to appear in your top panel, you can right click on the top panel and select "Add to Panel...". Then select "Custom Application Launcher" and enter the info above.

To select the icon, click on the spring button, click browse, then browse to /usr/share/freemind then click "Open". Select the icon then click "Ok".

That's your Launcher ready. Just click close and enjoy.