December 16, 2010

Running iTunes on LinuxMint

Check your wine setup:

#dpkg -l | grep wine | awk '{ print $2, " ",$3}'
 
wine   1.0.1-0ubuntu8
wine1.2   1.1.31-0ubuntu3
wine1.2-gecko   1.0.0-0ubuntu3

Install wine 1.2 and the iTunes version 10 (i took the latest from the iTunes.com) website. This worked out of the box. I still have to test iPhone connection.

The iPhone connection can be setup doing this. Using http://www.libimobiledevice.org/

October 20, 2010

Linux command line stuff

Finding number of files in a folder:
find . -type f | wc -l

Finding number of subfolders in a folder:
find . -type d | wc -l


All taken from here

Creating 1 pdf from multiple images:

cd FOLDER_WITH_IMAGES
FILES=$(ls *jpg)
mkdir temp && cd temp
for file in $FILES; do BASE=$(echo $file | sed 's/.jpg//g'); convert ../$BASE.jpg $BASE.pdf; done &&
pdftk *pdf cat output ../FINAL_NAME.pdf &&
cd ..
rm -rf temp

All taken from here

July 28, 2010

Active state perl under cygwin

Follow the script description here, But instead of removing the perl from the cygwin installation and adding stuff to the path :) Simply replace the cygwin perl.exe file with the script.


Perl and the windows registry links:
http://cpansearch.perl.org/src/INGY/Kwiki-0.39/lib/Kwiki/Registry.pm
http://www.xav.com/perl/site/lib/Win32/TieRegistry.html

March 04, 2010

LinuxMint 8 running in Virtualbox

At work I have a WineDoh$ machine :( So not to miss my trusty Mint machine during the day I decided to install it in virtualBox.

The tricky part is to get the network running for the guest machine (the LinuxMint), as you need to create a bridge between the host and the guest. Then you need to set the proxy on your LinuxMint guest machine.


Now you should be able to run: 

sudo apt-get update
sudo apt-get upgrade

And get the latest package updates, as well as intall your favorite applications. To share data between the two machines, open the host machines shared folder menu:


Create a shared drive
Then on the guest you need to mount this drive:

sudo mkdir /mnt/windows_drive
sudo mount.vboxfs D_DRIVE /mnt/windows_drive
ls /mnt/windows_drive

and you should be able to see your files.

 [Edit 1] Update on the proxy configuration

March 01, 2010

PS3 media server on LinuxMint

Setting up a ps3 media server was extremely easy! just follow the guide at: http://ps3mediaserver.org/forum/viewtopic.php?f=3&t=5589Tests

I previously attempted streaming to my ps3 using vlc but the result was not good. The video was stopping. It seemed like a transcoding problem.

However, installing vlc and using this through the ps3media server has an exellent result.

C++ enum inheritance

Today I needed to have enums with an inheritance ability. I have some HMI panels in an application where each panel button has a handler function, which is placed incide a stl vector. Each of these buttons can be enabled and disabled using a unique ID, it's number in the vector.

The problem I fased was that the base class implementing the basic functionality of the panels (done and cancel) also implemented the indecies for these functions. Now in a derived class i wanted to extend the enum with button indecies for the buttons added by the new class, but enums and C++ does not support this directly.

To overcome the problem a template can be used. here is a similar approach using atemplate to extend enum definitions. This solved my problems and I can get the panels back in action.

February 18, 2010

Asus eeepc 1101H & Linux

Woooa, and I thought my biggest problem was some F****r stealing my powerbook!! But no, I wasn't even close!

So in the lack of Mac i decided to get one of those nice looking eeePC seashells. In fact I was so "blinded by the light" that I completely forgot to look at the hardware compatibility.

So, I ended up buying a Asus eeePC 1101H, which I regretted until today! Since this machine includes the *famous* gma500 Intel (aka poulsbo) graphics chip :O

Ubuntu, 9.04  (EasyPeasy 1.5) and 9.10  all have vesa (read:slow graphics) Now what?? I waited! and waited and waited .... from October 2009 to Feburary 2010, when finally the poulsbo drivers have a decent installation script!!

Now I'm the lucky owner of a Asus eeePC running Ubuntu 9.10.

To get your own simply follow the instructions here, and here.

In short the procedure is:

0. Create ubuntu libe stick and Install ubuntu from live usb stick
2. Reboot
3. sudo apt-get update
4. sudo apt-get upgrade
5. reboot
6. wget http://dl.dropbox.com/u/1338581/Gma500/scripts/poulsbo.sh && sh ./poulsbo.sh
7. reboot
8. sudo apt-get install ndisgtk (may not be needed)
9. restart network (or reboot)
10. edit /etc/resolv.conf and /etc/dhcp3/dhcp.conf with settings from open dns (208.67.222.222, 208.67.220.220)
11. Open Firefox and put about:config in address bar and hit enter.
In filter type network.dns.disableIPv6 and hit enter:
double click on line and it will change to:
network.dns.disableIPv6;true
12. Disable the ipv6 kernel module
13. Install the wicd wireless handler


You should now have a running Ubuntu distro great with network and graphics!

Previous distro attempts:
Slackware13 from stick - booted after installation but, darn this distro could not see my hard disk, due to a missing scsi module in the kernel

Xandros from stick (I figured: hey this is an Asus distro so i most likely will install smoothly) No, not even close, during usb install it barfed all over me with "can't find installation media" There's no optical drive on the 1101!!

Debian (I already have a machine running this) - No network! no driver! and really slow graphics :(

ArchLinux. See debian.

I considering dumping MintLinux8 on a second partition just to test the installation again.