Wednesday, November 04, 2009
Clean install of 64-bit Flash player in Ubuntu 9.10 Karmic Koala
- Dowload the archive from http://labs.adobe.com/downloads/flashplayer10.html
- Unpack it to /opt:
sudo mkdir /opt/flashplayer
cd /opt/flashplayer/
sudo tar zxf /some/path/Downloads/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz - Use update-alternatives to make it the default flash player:
for i in firefox iceape iceweasel midbrowser mozilla xulrunner-addons xulrunner
do
sudo update-alternatives --install /usr/lib/${i}/plugins/flashplugin-alternative.so \
${i}-flashplugin /opt/flashplayer/libflashplayer.so 100
done - Verify that the link really points to /opt/flashplayer:
ls -l /etc/alternatives/firefox-flashplugin
# outputs /etc/alternatives/firefox-flashplugin -> /opt/flashplayer/libflashplayer.so - Remove the Ubufox Flash player override:
ls -l /usr/share/ubufox/plugins/
# npwrapper.libflashplayer.so ->
# /usr/lib/flashplugin-installer/npwrapper.libflashplayer.so
sudo rm /usr/share/ubufox/plugins/npwrapper.libflashplayer.so
sudo ln -s /opt/flashplayer/libflashplayer.so /usr/share/ubufox/plugins/ - Verify that Firefox is using the plugin:
- restart Firefox
- open a new tab and type about:plugins
- you should see File name: libflashplayer.so under Shockwave Flash
Monday, February 09, 2009
update-alternatives
So you want to add another alternative to the
Assumptions: Sun's binary JDK installed to
Add all it's basic tools to the list as follows:
update-alternatives list in Ubuntu or Debian? Here's an example for Java.Assumptions: Sun's binary JDK installed to
/opt/java/jdk1.6.0_12/.Add all it's basic tools to the list as follows:
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_12/bin/java 1or even simpler:
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_12/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_12/bin/javaws 1
for p in java javac javaws
do
sudo update-alternatives --install /usr/bin/$p $p /opt/java/jdk1.6.0_12/bin/$p 1
done
Friday, November 14, 2008
Tune MySQL performance
For a dual-core machine with 2 GB of RAM:
$ cat /etc/mysql/conf.d/performance.cnf
[mysqld]
query_cache_size=32M
max_connections=300
thread_cache_size=80
thread_concurrency=4
key_buffer=128M
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=1M
Especially max_connections is helpful if you have high concurrency and get
$ cat /etc/mysql/conf.d/performance.cnf
[mysqld]
query_cache_size=32M
max_connections=300
thread_cache_size=80
thread_concurrency=4
key_buffer=128M
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=1M
Especially max_connections is helpful if you have high concurrency and get
"Lost connection to server during query" errors.
Thursday, November 13, 2008
MySQL character set information
General:
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
Particular (existing) database/table etc:
mysql> show create database dbname;
+----------+--------------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------------+
| crawler | CREATE DATABASE `dbname` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+--------------------------------------------------------------------+
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
Particular (existing) database/table etc:
mysql> show create database dbname;
+----------+--------------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------------+
| crawler | CREATE DATABASE `dbname` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+--------------------------------------------------------------------+
Set default MySQL charset in Ubuntu
$ cat /etc/mysql/conf.d/charset.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
[mysql]
default-character-set=utf8
Friday, March 14, 2008
Determine the memory type in Linux
- sudo lshw # for basic information
- sudo apt-get install i2c-tools lm-sensors
- sudo modprobe eeprom
- sudo modprobe i2c-i801
- wget http://www.lm-sensors.org/browser/i2c-tools/trunk/eeprom/decode-dimms.pl?format=raw
- mv decode-dimms.pl\?format\=raw decode-dimms.pl
- perl decode-dimms.pl
Tuesday, May 29, 2007
Resetting an xterm
- reset
- if that doesn't help, ESC c should supposedly do a full reset (seems not to work for me)
- or enable the xterm menu:
XTerm*vtMenu*softreset*Label: Do Soft Reset
XTerm*vtMenu*hardreset*Label: Do Full Reset
Locales in Ubuntu and Debian
It used to be a matter of dpkg-reconfigure locales to get the locales you want. Not any more. At least in Ubuntu you have to install the relevant language packs.
- apt-get install language-pack-et language-pack-en # Estonian and English
- update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 # set default to English
Friday, May 18, 2007
Enhancements to xubuntu-desktop metapackage
xubuntu-desktop-expert:
- either don't depend on xorg-video-all and xorg-input-all or purge unused modules after install.
- either don't depend on Eastern fonts or purge unused ones after install.
- add localepurge, debfoster, deborphan
Install Ubuntu (Feisty) from Windows
If you want to do it manually from Windows 95/98:
Possible errors:
It may happen, that the filesystem type is not properly changed if you chose to setup partition table manually. Grub fails to install in that case and grub-install will fail with a confusing message "file ...boot/grub/stage1 not read correctly". Just umount /target, fdisk /dev/hda and fix the partition type + rerun Install grub boot loader from menu.
- mkdir c:\boot; cd boot
- download http://kent.dl.sourceforge.net/sourceforge/grub4dos/grub_for_dos-0.4.2.zip and unzip to boot
- download http://archive.ubuntu.com/ubuntu/dists/feisty/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz and http://archive.ubuntu.com/ubuntu/dists/feisty/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux
- create a menu.lst file. I've chosen to install the minimal server edition, consult http://archive.ubuntu.com/ubuntu/dists/feisty/main/installer-i386/current/images/netboot/ubuntu-installer/i386/pxelinux.cfg/default
if you want to install the full Gnome Ubuntu edition.
menu.lst
title Install Ubuntu Server Edition
kernel (hd0,0)/boot/linux base-installer/kernel/linux/extra-packages-2.6= tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal --
initrd (hd0,0)/boot/initrd.gz - reboot into plain DOS (press F8 during boot and choose Safe mode command prompt),
cd boot
grub (or grub --config-file="c:\boot\menu.lst") - Ubuntu installation will start.
Possible errors:
It may happen, that the filesystem type is not properly changed if you chose to setup partition table manually. Grub fails to install in that case and grub-install will fail with a confusing message "file ...boot/grub/stage1 not read correctly". Just umount /target, fdisk /dev/hda and fix the partition type + rerun Install grub boot loader from menu.