Tuesday, May 14, 2013

Resettting your mySQL root password

When you need to reset your root password for your mySQL server, proceed this way:

# sudo /etc/init.d/mysql stop
# sudo mysqld_safe --skip-grant-tables &
# sudo mysql -u root

on the mySQL console:

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit


# sudo /etc/init.d/mysql stop
# sudo /etc/init.d/mysql start






To confirm you indeed have access to mySQL with the new password:


# mysql -u root -p

Thursday, May 2, 2013

Clementine - Finally a great Linux music player


I'm currently exploring clementine v1.0.1, a Linux music player. The first impressions are really good. It picked up most of my music collection (although it took a while, but it is a LONG collection...) but I got better organization than all other players I have tried.

A lot of the reviews I read said a lot of great things about last.fm and similar services integration but I'm not a customer of those platforms, so I can't really comment on that. I can tell you, however, that the "internet services" tab is quite comprehensive: Jamendo, last.fm, grooveshark, magnatune, sky.fm and somafm - a lot of them I really never heard about.


Internet services tab

The album art for most of my collection was downloaded without problems, and the ones that were not downloaded were afterwards when you go tot he album covert option and select download missing cover art. There's quite a few that are not correct, but nothing that a little time to kill won't fix. Very happy with this point too.

cover manager window

Another thing that seems to be above average is file meta data management. By that I mean the sometimes tedious task of making sure that the album artist is the same on all your files because media organizers tend to think Korn is a completely different artist to KoRn. Bulk metadata change is a breeze with clementine and in no time you will have your albums/ artists organized in a very OCD-pleasing way - just the way I like it!

Bulk metadata edit made easy!

Integration with my HTC sensation mobile phone is a breeze. It sees it as a removable disk, which is nothing special, but the interaction with the phone and your music library is pretty good in my opinion.

Media player integration

Then there's the song information tab, that shows you - you guessed it - song information: how many people listened to that song on last.fm and how many times was played (note that that information shows up even if you are playing files from your personal collection). It shows you lyrics and artist info. All this is obviously pulled from online resources such as wikipedia and wikilyrics. Some of the more obscure bands and artists in my collection were not found, but I think only me and another 3 people have ever heard of them, so that's understandable.

the lyrics tab - all obviously pulled off the web on demand. So far accuracy has been great!

Another cool thing is the fade-in fade-out feature that you can hear when you skip songs or when you stop the player. For sure this is a feature other players also have but it's yet another point for clementine. On the topic of cool features, I also like the equalizer visualization at the bottom of the window - it's very responsive and you can change the visualization that mostly suits you. Again, for sure you can find this in other programs, but I particularly like it in clementine.

Like I wrote in the beginning of this review, I really like it and I will keep using it. If you are looking for a robust music player, try clementine.

Monday, April 29, 2013

get contents of network share on ubuntu

Took some time to get this one and in the end it's really really easy...

The problem: nautilus finds network share easily, lists it under the network section on the left had side bar. It also allows you to browse it with no problems.

However, regular programs (say a music library program) cannot open folders on the share because the network shares do not show up on the "open folder" dialog.

What do you do?

go to ~/.gvfs and you will find your share contents there.

Why did I not know this?

Thursday, December 20, 2012

Suunto ambit on Linux - log file

As requested in the comments of a previous post, here's a link to a comms log between the suunto and a PC. This is only part 1 of 6 of a session where waypoints are uploaded from the watch, followed by the upload of a move.

https://docs.google.com/open?id=0B-a-9_EzFNVnVGhEenBVWmVadkk

Hopefully this is useful for someone.

Thursday, December 13, 2012

suunto ambit on linux - part 4

Thought I posted a screenshot of the first reply I could get from the ambit:

The ambit replies with the firmware version "bluebird". Converting the hex to char on the ambit's reply gives:

?>]6 � Ù� �    ���0���Bluebird��������00000000�������� � �E J ãO

 Next step try to understand the protocol...

Wednesday, December 12, 2012

how to reload optware usb stick on asus oplay


Sometime ago one of my dogs decided to eat my asus o'play remote control. Without the remote the unit is pretty much useless. At the same time, I was looking for a way to have a always on machine serving 2 HD on my home network and for that I was using my linux machine but it was bugging me that I had so much power for so little needs.

So I thought that maybe I could turn the asus media player into a samba server. I'd heard that the asus was a linux machine and it's true. Not only that but root access is as easy as telnet to the machine and login with username root and no password.

So I went through the processes described here to install moservices on the machine and this way install samba. It works well and my machines on the network can all see and access the two harddisks.

The other requirement I had was to have one of the HD as the main and the other as the backup. Put everything onto HD1 and then, every day at night to a backup with rsync. Thing is rsync is not installed on the asus o'play and it does not come with moservices, so the next option was to install optware (package management for embebbed linux). Trouble is the asus o'play doesn't have enough space to install it. So I followed these instructions to get it running again. For aht's coming to work, do not follow the steps of cleaning up the USB tmp files. It worked well but there's a few things to note:

1. There's a program that loads the USD HD on the o'play. That program comes with the o'play and you either delete and replace it by your own or you are a slave of how the o'play decides to call your USB HD. For me this is not a big problem because it is enough for me to plug them in at the correct sequence for them to be available in the right sequence on samba. I.e. it doesn't matter how they get mounted on the o'play because the first disk is always going to be called disk1 on the samba share and the second is going to be called disk2 on the sahre, no matter is they are automatically mounted as /mnt/usbmounts/sdb1 or /mnt/usbmounts/sdc1 or whatever.

2. I do have a problem with reloading my optware USB stick though, because that one I need to be loaded to the same mount point other wise it will not work. So, instead of making it a persistent mount point, I'm lazy and follow this steps after each reboot (that only really happens every 3 months anyway):

a) plug the USB stick in and find out where it mounted with df:

BusyBox v1.1.3 (2010.09.07-08:50+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                76288     75212      1076  99% /
/dev/mtdblock/2          61440      8608     52832  14% /usr/local/etc
/dev/rd/0                   40        40         0 100% /mnt/rd
/dev/scsi/host5/bus0/target0/lun0/part1 976521568 924004192  52517376  95% /tmp/usbmounts/sdb1
/dev/scsi/host6/bus0/target0/lun0/part1 975592816 921977600  53615216  95% /tmp/usbmounts/sdf1
/dev/scsi/host8/bus0/target0/lun0/part1   7861696    180928   7281412   2% /tmp/usbmounts/sdg1


You  can see my two harddisks and the USB stick above. The HD are the image of each other so they are both used up by 95%. The optware USB stick is the last one (around 8GB with 1.8GB used up).

b) mount / as rw and a few more:

~ # mount / -o rw, remount
~ # mkdir /opt
~ # ln - s /tmp/usbmounts/sdg1 /opt

c) cd to /opt/tmp and run

/opt/tmp/ipkg-cl install uclibc-opt_0.9.28-13_mipsel.ipk
/opt/tmp/ipkg-cl install ipkg-opt_0.99.163-10_mipsel.ipk
  
d) Update optware to the latest version


/opt/bin/ipkg update

e) Find rsync (you may have to install it with optware)

ls -la /opt/bin

f) To make rsync backup your files from the main HD to the backup HD issue the command I spoke about on a previous post

rsync -avh --delete /path/to/main/drive /path/to/backup/drive

suunto ambit on linux part 3

Investigation is my favourite part of any project and especially the part where I start making things happen.

So on part 2 I got to check the protocol between the computer and the ambit. It's not not 100% clear how it operates. Just for fun, I decided to change the HDI program to send some of the packages that I can see my windows machine is sending to the ambit.

See below the screenshot of me sending a command I took from the windows sniffer. I don't get a response from the ambit BUT it reacts to that command because the lock icon disappears and the battery icon also disappears and turns into the little circles that indicate what ambit screen you are on. After briefly changing to the above, it goes back to the lock and battery icon.

Exciting!


Just for records, here's the full HDI package including my modified write to the ambit program on the hidtest folder. There's a lot of files you will not need in this package if you are running linux but I thought I'd leave exactly as I currently have it (see my first post on this series for other packages you require to be able to run this).