Crop pdfs when converting with image magick April 30, 2008
Posted by maxmil in : pdf , add a commentWhen converting pdf’s with image magick i have had the problem that invisible content that is outside the visible page of the pdf shows up in the converted image. After some searching i found the solution. Use the pdf option use-cropbox.
imconvert -define pdf:use-cropbox=true file.pdf file.jpeg
Character conversión in UTF-8 between Actionscript PHP and Mysql
Posted by maxmil in : Flash, MySql, php , add a commentAlways a tricky one. The best solution that i’ve found is
1) Mysql database and/or tables with the utf-8 character set and utf_general_ci collation.
2) PHP files encoded in UTF8
3) After the initial connection with the database send the querySET NAMES `utf8`
Launch application from terminal in background April 25, 2008
Posted by maxmil in : Debian , add a commentTaken me ages to find this little beauty.
If you follow any command with an ampersand (&) on the in a terminal it will run the command as a background process allowing you to continue using the terminal. You will ofcourse be deprived of any standard output from the command but in the case of something like gedit thats fine by me.
Installing Compiz on with nVidia GForce 8600M GS
Posted by maxmil in : Debian, VGN-FZ31Z , 3 commentsJust successfully installed and configured compiz on my Sony VIAO FZ31Z.
Previously i had installed the nVidia drivers and configured X to use them.
The installation of compiz was pretty easy
sudo aptitude update
sudo aptitude install xorg compiz libgl1-mesa-dri
Then edit /etc/X11/xorg.conf.
Add to the Device section
Option "XAANoOffscreenPixmaps" "true"
Add a new section
Section "Extensions"
Option "Composite" "enable"
EndSection
Contrary to various references to nVidia users having to add extra configuration options i have not had to.
I then restarted X and gave the command compiz –replace. The result was not great the initialization of compiz hung in the line “Starting gtk-window-decorator”, all my windows lost their borders and there were no visible effects.
However after a bit of searching i found that the solution was to add a window decorator to the command.
compiz --replace & gtk-window-decorator --replace &
With this i entered into the world of wobbly windows, desktop cubes and the rest. I still haven’t explored much but the first impression in pretty impressive.
NOTE: Having installed xorg i found that on some of my apps (skype and VirtualBox) i had broken fonts. I checked and it seemed that compiz did not need this package. Purging it has brounght back my clean fonts.
Getting nVidia drivers for GForce 8600M GS on Debian testing
Posted by maxmil in : Debian, VGN-FZ31Z , add a commentThe latest nVidia drivers were not available in the debian testing repository at the time of writing. However is the unstable the package that i was after was nvidia-glx.
In order to install it i had to pin my apt preferences in /etc/apt/preferences (the file did not exist)Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 900
Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 300
Package: *
Pin: release o=Debian
Pin-Priority: -1
Then using module assistant i compiled the module
module-assistant prepare
module-assistant auto-install nvidia
And then load the module
modprobe nvidia
Finally i reconfigured /etc/X11/xorg.conf. In Devices section i put
Identifier "nVidia Corporation GeForce 8600M GS"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "NoLogo" "true"
(The NoLogo line avoids a nasty nVidia splash screen when x starts).
Disactivating a synaptic alps pointing device April 14, 2008
Posted by maxmil in : Debian, VGN-FZ31Z , add a commentTo avoid the irritating problem of the cursor jumping when you are in the middle of writing you can use syndaemon. This is a process that desactivates the touch pad for two seconds (configurable) after each keystroke.
Configuring synaptics and alps pointing device on VGN-FZ31Z
Posted by maxmil in : Debian, VGN-FZ31Z , add a commentBy default my mouse pointer was a bit slow when i installed X on my Sony VIAO.
To remedy the situation the option AccelFactor of the synaptics driver came to my rescue. In addition i find the VertEdgeScroll option (which allows you to scroll by moving your finger up and down the right hand side of the touchpad is really useful too).
My /etc/X11/xorg.conf section for the touchpad now looks like this
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "AccelFactor" "0.050"
Option "VertEdgeScroll" "true"
Option "SHMConfig" "true"
EndSection
Addind gpg key for VirtualBox repository
Posted by maxmil in : Debian , add a commentAfter adding the virtualbox repository to my /etc/apt/sources.list i was getting a gpg error on every update since i didn’t have the key installed. I was able to install it like so:wget http://www.virtualbox.org/debian/innotek.asc -O- | sudo apt-key add -
USB support for VirtualBox
Posted by maxmil in : Debian , add a commentI had installed and was happily using the Virtual Box OSE (Open Source Edition) from the main debian repositories until i found that my guest Windows XP OS did not have access to my USB ports.
This is because, at the time of writing, Virtual Box OSE does not support USB. However the closed source edition does. According to VirtualBox the features from the closed source project will be transfered to the open source project, i hope that this happens. Meanwhile it was not complicated changing to the closed source version.
Add the virtual box repository to /etc/apt/source.listdeb http://www.virtualbox.org/debian etch non-free
Then download and install the “virtualbox” paquet. This paquet compiles the virtualbox module on the fly and replaces the ose modules if you had previously installed it.
In order for the USB to work on my Debian system i had to add the following line to /etc/fstabnone /proc/bus/usb usbfs devgid=116,devmode=0664 0 0Where 116 is the group id of vboxusers and my user is in this group.
To add your user to vboxusers (my user is called maxmil)useradd -G vboxusers maxmil
To get the group id of the vboxusersgrep vboxusers /etc/group
Finally if you want virtualbox to be available after each boot of the machine add vboxdrv to /etc/modules.
Getting ALSA working on VGN-FZ31Z April 13, 2008
Posted by maxmil in : Debian, VGN-FZ31Z , add a commentJust bought a new laptop. Alsa installed fine and the onboard speakers worked from the outset. However i had two problems.
1) The headphone jack didn’t work. That is to say that when you plugged in the headphones sound continued to come out of the onboard speakers.
2) The microphone didn’t work.
My alsamixer only offered three volume controls, Master, PCM and Digital. I’m not sure what Digital is, it is a capture device but is not the microphone jack. The laptop has an HDMI socket, i don’t know much about this but i presume that its a digital input and that this is the Digital device that showed up in my alsamixer.
After searching the Internet the solution that i found was to specify the model of the laptop as part of the ALSA module configuration options.
In my case with Debian Testing (lenny) this was acheived by creating a new file in /etc/modprobe.d called snd_hda_intel (the name of the module for my sound card) and adding the lineoptions snd_hda_intel model=vaioI then restarted the machine and found that the capture devices listed i alsamixer had changed. I now saw PCM, Capture, Digital and Internal capture devices.
But most importantly the microphone and headphone now work without a problem. I had seen other people having the problem that when you connect the headphones sound continues to come from the speakers but luckily that did not happen to me.
The only thing that i have to resolve is that the onboard volume control seems to modify the Capture voume rather than the master volume, but this is really a minor inconvenience.
As a note to myself here are some of the useful commands that i learnt while solving this problem.
amixerLike alsamixer but prints out the information on all devices. Can be used to set properties that don’t appear in the alsamixer grafical environment.
cat /proc/asound/card0/codec#0Sound card specs. There are other files in the same directory that give information on the capture and playback configuration of the card aswell.
lspci -vThe verbose option of lspci gives you a bit more info about the card and modules.
cat /proc/modules | grep sndGives information on all sound related kernel modules.