Hi! If you want mysql to use utf8 as default when you create databases and tabels, add the following text to /etc/mysql/my.cnf
[mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
[client]
default-character-set=utf8
Found the solution at http://notes.timeghost.net/2008/10/utf-8-and-mycnf.html
Here you find my solutions to diffrent technical problems. Secret comes from that it required much search on Google and much testing to acquire the solutions.
tisdag 22 juni 2010
måndag 31 maj 2010
Cannot find demux plugin for MRL dvbpipe.m2t
Solved this by uninstalling Kaffeine through the GUI and then installed it by following the instructions at: https://help.ubuntu.com/community/Kaffeine. No more "Cannot find demux plugin for MRL dvbpipe.m2t" after this :)
_____________________
I did uninstall Kaffeine through the GUI, but I do not think there is any difference between uninstalling through terminal. Here is a solution with the terminal only.
sudo apt-get remove kaffeine
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install kaffeine libxine1 libxine1-all-plugins phonon-backend-xine
This solution is tested on Ubuntu Lucid (10.04) 64bit. But should work on 32bit and Ubuntu Karmic (9.10). As you may see the key in the solution is installing the extra packages "libxine1 libxine1-all-plugins phonon-backend-xine". Of course all needed packages should be installed when installing Kaffeine, but for some reason it does not.
_____________________
I did uninstall Kaffeine through the GUI, but I do not think there is any difference between uninstalling through terminal. Here is a solution with the terminal only.
sudo apt-get remove kaffeine
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install kaffeine libxine1 libxine1-all-plugins phonon-backend-xine
This solution is tested on Ubuntu Lucid (10.04) 64bit. But should work on 32bit and Ubuntu Karmic (9.10). As you may see the key in the solution is installing the extra packages "libxine1 libxine1-all-plugins phonon-backend-xine". Of course all needed packages should be installed when installing Kaffeine, but for some reason it does not.
söndag 30 maj 2010
Manipulate date in EXIF
Hi! My camera had the wrong date set. I noticed this first when I imported all my pictures in a program (Fspot) that sorts based on date in EXIF. The solution was to use exiv2 to correct the date, or at least the year.
The following commands helped a lot:
Take all pictures in subfolders and subtract 22years from exif date.
find . -type f -name \* -exec exiv2 -Y -22 ad {} \;
Take all pictures in current folder that start with IMG_ and add 22years (I had to correct some pictures which I had subtracted 22years from twice).
exiv2 -Y +22 ad IMG_*
_______________________
I have noticed that FSpot do support manipulation of EXIF date also! So all this can probably be done in FSpot.
The following commands helped a lot:
Take all pictures in subfolders and subtract 22years from exif date.
find . -type f -name \* -exec exiv2 -Y -22 ad {} \;
Take all pictures in current folder that start with IMG_ and add 22years (I had to correct some pictures which I had subtracted 22years from twice).
exiv2 -Y +22 ad IMG_*
_______________________
I have noticed that FSpot do support manipulation of EXIF date also! So all this can probably be done in FSpot.
lördag 22 maj 2010
Acer recovery problem 0xa0000001
Hi! My friend couldn't use recovery on his Acer. He got the 0xa0000001 error when trying. After much searching we found an solution. I was little skeptic about it, but it did work!
First of, backup all important data! You might loose it all otherwise. Note that we did delete the special partition with Asus mini OS. Maybe it's not necessary, but my friend did not use it anyway.
Solution (as we did it):
Delete all partitions except the first, pqservice. Create a primary partition for windows, after that a partition which is 10gb ntfs. Then create a extended partition with one partition for linux and one for linux-swap. You get the following partition structure: PQService|NTFS|NTFS|Extended{ext4|swap}
Install linux (I installed ubuntu 10.04) on the ext4. Use the "swap" as swap. This installs grub which can load acer recovery (at least it could for me).
Boot ubuntu or the distro you have installed. Copy PQService to the 10gb large NTFS partition. Open a terminal and use following command:
dd if=/dev/sda1 of=/dev/sda3 (this is specific for hardware setup, sda might be wrong for you).
Restart and start recovery. Start the first one at the harddrive, not the copy (did not show up for me). I thought it was something wrong as I create a copy of a partition but don't use it. However it did work.
Found solution at: http://forum.notebookreview.com/acer/137664-help-recovery-issue-my-new-aspire-5920g-2.html
First of, backup all important data! You might loose it all otherwise. Note that we did delete the special partition with Asus mini OS. Maybe it's not necessary, but my friend did not use it anyway.
Solution (as we did it):
Delete all partitions except the first, pqservice. Create a primary partition for windows, after that a partition which is 10gb ntfs. Then create a extended partition with one partition for linux and one for linux-swap. You get the following partition structure: PQService|NTFS|NTFS|Extended{ext4|swap}
Install linux (I installed ubuntu 10.04) on the ext4. Use the "swap" as swap. This installs grub which can load acer recovery (at least it could for me).
Boot ubuntu or the distro you have installed. Copy PQService to the 10gb large NTFS partition. Open a terminal and use following command:
dd if=/dev/sda1 of=/dev/sda3 (this is specific for hardware setup, sda might be wrong for you).
Restart and start recovery. Start the first one at the harddrive, not the copy (did not show up for me). I thought it was something wrong as I create a copy of a partition but don't use it. However it did work.
Found solution at: http://forum.notebookreview.com/acer/137664-help-recovery-issue-my-new-aspire-5920g-2.html
fredag 21 maj 2010
Stopping multiple soundcards from switching
I recently got a problem with my X-fi soundcard switching identification number with my ATI HDMI. I use 2:0 in my configuration. But this do not work always as the id is "randomly" assigned.
Solution:
cat /proc/asound/modules
sudo gedit /etc/modprobe.d/alsa-base
At the bottom add the following lines:
options snd_hda_intel index=0
options cx88_alsa index=1
options snd_ctxfi index=2
Where the names (snd_hda_intel...) is those you did get from the first command (cat...) It is not necessarily three as in my case.
Here is the original solution: http://ubuntuforums.org/showthread.php?t=205449
Solution:
cat /proc/asound/modules
sudo gedit /etc/modprobe.d/alsa-base
At the bottom add the following lines:
options snd_hda_intel index=0
options cx88_alsa index=1
options snd_ctxfi index=2
Where the names (snd_hda_intel...) is those you did get from the first command (cat...) It is not necessarily three as in my case.
Here is the original solution: http://ubuntuforums.org/showthread.php?t=205449
söndag 9 maj 2010
Can't click at flash applications in Ubuntu?
This might by your solution! http://helpforlinux.blogspot.com/2009/11/i-cannot-click-on-flash-in-ubuntu.html
Note that it stands "i386", my first thought was that it's wrong for me as I am running x86_64. However it did work for me anyway.
Note that it stands "i386", my first thought was that it's wrong for me as I am running x86_64. However it did work for me anyway.
Install Samsung scx-5x30 on Ubuntu 10.04
Hi. Samsung provides a .ppd file. But when you try to use this a error occures. You must install "rastertosamsungspl" is written. To do this you must copy a file from the downloaded driver.
sudo cp ./cdroot/Linux/x86_64/at_root/usr/lib64/cups/filter/rastertosamsungspl /usr/lib/cups/filter/
I found the solution here: http://ubuntuforums.org/showthread.php?p=8926494
sudo cp ./cdroot/Linux/x86_64/at_root/usr/lib64/cups/filter/rastertosamsungspl /usr/lib/cups/filter/
I found the solution here: http://ubuntuforums.org/showthread.php?p=8926494
lördag 8 maj 2010
Completely remove mysql on ubuntu
Hi! I have had some problems with an broken mysql installation. After much searching I found a way to completely delete the installation and start from the begining. The following command did the trick:
sudo apt-get --purge remove mysql-server mysql-common mysql-client libmysqlclient15-dev
sudo apt-get --purge remove mysql-server mysql-common mysql-client libmysqlclient15-dev
How to fix 4.1 Ubuntu 10.04
Hi. As you've probably noticed you can choose 4.1 in the GUI for configuration of the sound. However for me it didn't work. When I choose 4.1 the subwoofer channel won't get any audio. To solve this I must remap!
Open /etc/pulse/default.pa (sudo gedit /etc/pulse/default.pa)
Add the following lines at the bottom
load-module module-alsa-sink device=hw:1,0 sink_name=working channels=5 channel_map=front-left,front-right,rear-left,rear-right,lfe
load-module module-remap-sink sink_name=realWorking master=working channels=5 master_channel_map=front-left,front-right,rear-left,rear-right,center channel_map=front-left,front-right,rear-left,rear-right,lfe
These lines remaps the LFE-channel to the center channel (which is 50% left, 50% right if you don't have one). My 4.1 system doesn't have a LFE input (so it isn't a real 4.1 in my opinion, but it's called so by the manufacturer). The system (amplifier in speaker) takes LF-signals from the front and redirects to the subwoofer.
NOTE that "device=hw:1,0" in the remap is specific for my setup. You might get some help from running "aplay -l" or just experiment. First case to test is "device=hw:0,0"
When you're done restart pulseaudio simply by writing "pulseaudio -k" (not sudo). When you kill pulseaudio it starts by itself.
Open /etc/pulse/default.pa (sudo gedit /etc/pulse/default.pa)
Add the following lines at the bottom
load-module module-alsa-sink device=hw:1,0 sink_name=working channels=5 channel_map=front-left,front-right,rear-left,rear-right,lfe
load-module module-remap-sink sink_name=realWorking master=working channels=5 master_channel_map=front-left,front-right,rear-left,rear-right,center channel_map=front-left,front-right,rear-left,rear-right,lfe
These lines remaps the LFE-channel to the center channel (which is 50% left, 50% right if you don't have one). My 4.1 system doesn't have a LFE input (so it isn't a real 4.1 in my opinion, but it's called so by the manufacturer). The system (amplifier in speaker) takes LF-signals from the front and redirects to the subwoofer.
NOTE that "device=hw:1,0" in the remap is specific for my setup. You might get some help from running "aplay -l" or just experiment. First case to test is "device=hw:0,0"
When you're done restart pulseaudio simply by writing "pulseaudio -k" (not sudo). When you kill pulseaudio it starts by itself.
onsdag 7 april 2010
Start up with Ubuntu server!
Hi! Here's a short article of how to get going with Ubuntu server (9.10+, maybe works on older).
1. Download Ubuntu server http://www.ubuntu.com/getubuntu/download-server
2. Install, you may burn it on a CD or create an startup-USB with http://unetbootin.sourceforge.net/
3. Install! It's easy, just boot and chose install.
4. Update everything! Write the following in terminal:
sudo apt-get update
sudo apt-get upgrade
Now you're up and running! However it's not that fun to have an empty server! It's easy to install stuff however. For example, install apache, php and mysql: write "tasksel install lamp-server" in terminal. And phpmyadmin, write "sudo apt-get install phpmyadmin". Don't forget ssh-server, so you can login remotely: "sudo apt-get install openssh-server".
Why use Ubuntu (or other linux based server)? Well it's free, it's stable, it's secure and it ain't that hard. All info you need can be found on the internet, and the quality of diffrent tutorials and guides or just being better and better! Give it a try!
1. Download Ubuntu server http://www.ubuntu.com/getubuntu/download-server
2. Install, you may burn it on a CD or create an startup-USB with http://unetbootin.sourceforge.net/
3. Install! It's easy, just boot and chose install.
4. Update everything! Write the following in terminal:
sudo apt-get update
sudo apt-get upgrade
Now you're up and running! However it's not that fun to have an empty server! It's easy to install stuff however. For example, install apache, php and mysql: write "tasksel install lamp-server" in terminal. And phpmyadmin, write "sudo apt-get install phpmyadmin". Don't forget ssh-server, so you can login remotely: "sudo apt-get install openssh-server".
Why use Ubuntu (or other linux based server)? Well it's free, it's stable, it's secure and it ain't that hard. All info you need can be found on the internet, and the quality of diffrent tutorials and guides or just being better and better! Give it a try!
torsdag 1 april 2010
PHP 5.3 problems with references
Hi! I have recently updated to Ubuntu Lucid. With this I also got PHP 5.3.2. I thought it would be no problems updating PHP, but now after some hours for debugging I know I was wrong.
First I got a mysql SQLException (My own exception telling my about syntax error). And an warning:
Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in /var/www/bla/lib/classes/Database/MysqliStmt.class.php on line 68
This was confusing as SQL-syntax shouldn't change. It hadn't. I found that the SQLException was due to another query that returned nothing, and by this causing the other query to fail. The other problem with the warning was trickier. I have built an Database abstraction layer, and I'm using "call_user_func_array(array(&$stmt, 'bind_param'), $params);" in my mysqli-driver, on line 68.
This error was new, I have used my database abstraction layer several times on diffrent servers without any errors. I first tried to solve the problem by changing how $params is created.
From:
foreach($values as $value) {
$params[] = $value;
}
to:
foreach($values as $value) {
$params[] = &$value;
}
Problem solved, if my only aim was to get rid of warnings at least. I didn't get any results from my querys earlier, but now I still didn't get results but no errors or warnings either. When I printed out $params I could see that all values where the same, the last put into the array $params. Then after a while I realized what I was doing. "foreach" copies a value from $values to $value. If PHP is working with references (which 5.3.2 seems to do more), then I'm just placing references into $params to $value. And $value changes on every loop. This explains why all values in $params had the same value, the last entered into $params. The solution was to use this code:
for($i = 0; $i < $max; $i++) {
$params[$i+1] = &$values[$i];
}
Here I go thorugh $values. For each value in $values I put an reference into $params. The reference is pointing into the right position in the array $values.
First I got a mysql SQLException (My own exception telling my about syntax error). And an warning:
Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in /var/www/bla/lib/classes/Database/MysqliStmt.class.php on line 68
This was confusing as SQL-syntax shouldn't change. It hadn't. I found that the SQLException was due to another query that returned nothing, and by this causing the other query to fail. The other problem with the warning was trickier. I have built an Database abstraction layer, and I'm using "call_user_func_array(array(&$stmt, 'bind_param'), $params);" in my mysqli-driver, on line 68.
This error was new, I have used my database abstraction layer several times on diffrent servers without any errors. I first tried to solve the problem by changing how $params is created.
From:
foreach($values as $value) {
$params[] = $value;
}
to:
foreach($values as $value) {
$params[] = &$value;
}
Problem solved, if my only aim was to get rid of warnings at least. I didn't get any results from my querys earlier, but now I still didn't get results but no errors or warnings either. When I printed out $params I could see that all values where the same, the last put into the array $params. Then after a while I realized what I was doing. "foreach" copies a value from $values to $value. If PHP is working with references (which 5.3.2 seems to do more), then I'm just placing references into $params to $value. And $value changes on every loop. This explains why all values in $params had the same value, the last entered into $params. The solution was to use this code:
for($i = 0; $i < $max; $i++) {
$params[$i+1] = &$values[$i];
}
Here I go thorugh $values. For each value in $values I put an reference into $params. The reference is pointing into the right position in the array $values.
fredag 11 december 2009
Pulseaudio
Hi, I'm been testing different settings in pulseaudio. I wanted to disable upmixing from stereo to 4.1 as my amplifier does this. I also been investigating how the LFE channel works. I only have two stereo cables from my soundcard (meaning 4channels). So I wanted to route all bass to front-speakers, as my amplifier then automatically sends it to the subwoofer (at least it seems so).
I didn't succeed with what I wanted, but I did learn some things about pulseaudio. And got my audio to work pretty good, even if not exactly as I wanted. Now my system does remix audio from stereo to 4 channels (front-left,front-right,rear-left,rear-right). But the reason why this is enabled is that it also routes the center channel to front speakers.
Here's a summary of stuff that I want to remember next time I work with pulseaudio:
I didn't succeed with what I wanted, but I did learn some things about pulseaudio. And got my audio to work pretty good, even if not exactly as I wanted. Now my system does remix audio from stereo to 4 channels (front-left,front-right,rear-left,rear-right). But the reason why this is enabled is that it also routes the center channel to front speakers.
Here's a summary of stuff that I want to remember next time I work with pulseaudio:
- pavumeter:
- paman:
- /etc/pulse/daemon.conf: ... remix, channels (example)
- /etc/pulse/client.conf: ...autospawn...
- /etc/pulse/default.pa: ... sink, remap
- pulseaudio -k && pulseaudio --start
lördag 5 december 2009
Spaces in /etc/fstab
Hi! I just had a problem with spaces in a mountpoints name. While searching for solutions I found others who had problems with this, but in their case while trying to mount a network share. The solution can be found in the manual page for fstab (write "man fstab" in terminal).
Here's the text from fstabs manual:
And here's a working example that mounts "/dev/sdb1" (ntfs) into "/media/drive 2"
Here's the text from fstabs manual:
The second field, (fs_file), describes the mount point for the filesys‐
tem. For swap partitions, this field should be specified as `none'. If
the name of the mount point contains spaces these can be escaped as
`\040'.
And here's a working example that mounts "/dev/sdb1" (ntfs) into "/media/drive 2"
/dev/sdb1 /media/drive\0402 ntfs nls=iso8859-1,umask=000 0 0
söndag 22 november 2009
A look into the future - check out gnome-shell
I tried gnome-shell some days ago. I'm running it default on my laptop now actually. The design is intuitive and it is perfect for us that have several applications running at once and want to switch between all windows easily. It's very good-looking and allows you to work more effective than all others desktop managers I've tested.
If you're interested in what might be the beginning of a new GUI for operating systems, check out the official website: http://live.gnome.org/GnomeShell
If you wan't to install it, here's instructions for Ubuntu 9.10:
BTW if you run Fedora 12 you can enable gnome-shell by entering desktop effects and click on a button.
If you're interested in what might be the beginning of a new GUI for operating systems, check out the official website: http://live.gnome.org/GnomeShell
If you wan't to install it, here's instructions for Ubuntu 9.10:
- Start "Software sources" (find in menu or: alt+f2, write "gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk")
- Check "Community-maintained Open Source software (universe)" by clicking on it
- Click on close
- Open a terminal (alt+f2, write gnome-terminal)
- Write "sudo apt-get update" in the terminal
- Write "sudo apt-get install gnome-shell" in the terminal
- Now it's installed, just write "gnome-shell --replace" in the terminal to start it.
- System --> Preferences --> Startup applications
- Click on add, write "gnome-shell --replace" in the command field. Write what you want in the other fields.
BTW if you run Fedora 12 you can enable gnome-shell by entering desktop effects and click on a button.
Ubuntu 9.10 installation can't find my harddrive
Hi. I tried to install Ubuntu 9.10 a while ago. But in the partition manager within the installation software I couldn't find my hard drive. This was quite frustrating since I had no problems installing Ubuntu 9.04 (or older) and Ubuntu 9.10 did find my hard drive in GParted.
I think it's my motherboard that Ubuntu dosen't like. I have a Asus P5Q Pro (the hard drive is a Samsung 500GB SATA). However I did find a solution to this problem. Start the live-cd and do the following:
It should look like this when you're ready:
Now just save the file. Start the installation and your hard drive should be found. This worked for me at least. Of course you shouldn't do this if your hard drive actually is a part of a dmraid. In my case my hard drive was tagged as part of a dmraid falsely.
I'm actually a bit disappointed at Ubuntu 9.10 compared to Ubuntu 9.04. Ubuntu 9.10 doesn't boot sometimes, just hangs in the boot process and doesn't write any information about why. And it doesn't boot faster then Ubuntu 9.04, or at least it doesn't feel as it boots faster. However if it's working as it should (compatible hardware is used) it's very good. The sound configuration manager isn't even comparable with the old one, it's much better. Everything looks a bit nicer and it's very stable.
Use this solution (as all solutions I publish here) at your own risk. If you have critical data I wouldn't recommend you to try this solution without taking a backup.
I think it's my motherboard that Ubuntu dosen't like. I have a Asus P5Q Pro (the hard drive is a Samsung 500GB SATA). However I did find a solution to this problem. Start the live-cd and do the following:
- Cancel the installation (if you started it), shutdown the installation software (ubiquity)
- Open terminal (alt+f2; write gnome-terminal)
- Write "sudo gedit /lib/partman/init.d/30parted" in terminal
- Comment out the following:
# Skip devices that are part of a dmraid device
if type dmraid >/dev/null 2>&1 && \
dmraid -r -c >/dev/null 2>&1; then
if part_of_sataraid $device && \
[ -f /var/lib/disk-detect/activate_dmraid ]; then
continue
fi
fi
It should look like this when you're ready:
# # Skip devices that are part of a dmraid device
# if type dmraid >/dev/null 2>&1 && \
# dmraid -r -c >/dev/null 2>&1; then
# if part_of_sataraid $device && \
# [ -f /var/lib/disk-detect/activate_dmraid ]; then
# continue
# fi
# fi
Now just save the file. Start the installation and your hard drive should be found. This worked for me at least. Of course you shouldn't do this if your hard drive actually is a part of a dmraid. In my case my hard drive was tagged as part of a dmraid falsely.
I'm actually a bit disappointed at Ubuntu 9.10 compared to Ubuntu 9.04. Ubuntu 9.10 doesn't boot sometimes, just hangs in the boot process and doesn't write any information about why. And it doesn't boot faster then Ubuntu 9.04, or at least it doesn't feel as it boots faster. However if it's working as it should (compatible hardware is used) it's very good. The sound configuration manager isn't even comparable with the old one, it's much better. Everything looks a bit nicer and it's very stable.
Use this solution (as all solutions I publish here) at your own risk. If you have critical data I wouldn't recommend you to try this solution without taking a backup.
Hi
Hi. I just mention what the blog will be about here. I have thought for a while about writing down solutions to diffrent computer related problems, just so I remember how I did next time the problem occurs. Example of problems: Ubuntu can't find my harddrive; PHP isn't working; FFMPEG can't convert 3gp to flv; C is mean to me; Java do not obey my instructions and so on.
In short I will write about my solutions to diffrent technical problems, just to document the solutions.
BTW, English isn't my native language, just so you know, if you haven't noticed yet :)
In short I will write about my solutions to diffrent technical problems, just to document the solutions.
BTW, English isn't my native language, just so you know, if you haven't noticed yet :)
Prenumerera på:
Inlägg (Atom)