This usually happens when you’re doing massive queries on InnoDB tables:
ERROR 1206 (HY000): The total number of locks exceeds the lock table size
In /etc/my.cnf, do something like this:
innodb_buffer_pool_size=524288000
By default, MySQL sets innodb_buffer_pool_size to 8MB.
500 megabytes = 524 288 000 bytes
December 30th, 2009
Masao
# yum install -y ImageMagick-perl
Loaded plugins: fastestmirror
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick-perl.i386 0:6.2.8.0-4.el5_1.1 set to be updated
filelists.xml.gz | 3.9 MB 00:09
http://apt.sw.be/redhat/el5/en/i386/rpmforge/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
filelists.xml.gz | 3.9 MB 00:29
http://ftp-stud.fht-esslingen.de/dag/redhat/el5/en/i386/rpmforge/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
filelists.xml.gz | 3.9 MB 00:12
http://fr2.rpmfind.net/linux/dag/redhat/el5/en/i386/rpmforge/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
Error: failure: repodata/filelists.xml.gz from rpmforge: [Errno 256] No more mirrors to try.
Run the following commands:
yum clean all
yum makecache
yum update
Then, it should work:
# yum install -y ImageMagick-perl
Loaded plugins: fastestmirror
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick-perl.i386 0:6.2.8.0-4.el5_1.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
ImageMagick-perl i386 6.2.8.0-4.el5_1.1 base 145 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 145 k
Downloading Packages:
ImageMagick-perl-6.2.8.0-4.el5_1.1.i386.rpm | 145 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ImageMagick-perl 1/1
Installed:
ImageMagick-perl.i386 0:6.2.8.0-4.el5_1.1
Complete!
September 13th, 2009
Masao
- Download the plugin here.
- Tar -zxvf the tar.gz file.
- Copy that file to: /usr/lib64/mozilla/plugins
- Restart firefox.
- Check “about:plugins” in your address bar to see the Flash plugin installed
Plugin file should look like this:
/usr/lib64/mozilla/plugins/libflashplayer.so
about:plugins should look like this:
Shockwave Flash
File name: nswrapper_64_64.libflashplayer.so
Shockwave Flash 10.0 r32
September 2nd, 2009
Masao
Sourcing a script can be useful for exporting variables in the current shell.
However, you can’t use “dirname $0″ to get the directory of the script.
Here’s how to get the same effect of dirname, but still allowing you to export variables.
Relative path:
DIRNAME=${BASH_ARGV[0]%/*}
Full path:
ABSDIR=$PWD/${BASH_ARGV[0]%/*}
If you bash shell prompt is empty when logging in, here’s how to fix it.
Create a ~/.bashrc file:
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
Create a ~/.bash_profile file:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
If you have asked yourself, “Do I have a 64-bit processor?”, then here are several ways to find out:
uname
# uname -p
x86_64
cpuinfo
# cat /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr
pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good pni
dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow
bogomips : 4255.87
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
The “lm” flag stands for Long Mode.
You can read more in this file:
/usr/src/kernels/#.#.#-#.#.fc11.x86_64/arch/x86/include/asm/cpufeature.h
#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */
lshw
# lshw
*-cpu
description: CPU
product: Intel(R) Core(TM)2 CPU 6420 @ 2.13GHz
width: 64 bits
From the lshw manpage:
lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).
To fix this error:
# nslookup mydomain.com
nslookup: error while loading shared libraries: liblwres.so.50: cannot open shared object file: No such file or directory
Do this:
# ldconfig
# dig mydomain.com
; <<>> DiG 9.6.1-RedHat-9.6.1-2.fc11 <<>> mydomain.com
...
From the ldconfig manpage:
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which versions should have their links updated.
If your SSH public key authentication is failing with errors like this:
$ ssh -vvv myhost.com
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/kitamura/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
…try these permissions on the server:
server$ chmod go-w ~/ (same as 755)
server$ chmod 700 ~/.ssh
server$ chmod 600 ~/.ssh/authorized_keys
more troubleshooting tips
How to Automatically Install CPAN Dependencies without having to answer “yes” to each question:
export PERL_MM_USE_DEFAULT=1
# rpm -ql mysql-devel
/usr/include/mysql
/usr/include/mysql/chardefs.h
/usr/include/mysql/decimal.h
/usr/include/mysql/errmsg.h
...
Here’s how to monitor multiple cores on Linux:
# mpstat -P ALL
Example:
Monitor all CPU’s in 1 second intervals forever
# mpstat -P ALL 1
If Synergy fails for you with this error: “Server refused client with name XXX”, then your IP might conflict with another machine on the same network.
Here’s how to renew your IP on Linux:
### Release your current IP
$ sudo dhclient -r
### Request a new IP
$ sudo dhclient
- Go through the usual setup at Samba.org or use YUM (yum install -y samba)
- By default, the smb.conf allows sharing of home directories.
- Add a Samba user (smbpasswd -a myusername)
- On Fedora, run SELinux Administration
- On the left menu, click “Boolean”.
- Scroll down to “samba”, and check the box next to “Allow samba to share users home directories”.
- Also on Fedora, make sure your Firewall allows the Samba ports 139 and 445.
- On Windows Vista, now map the network drive.
Sample smb.conf:
[homes]
comment = Home Directories
browseable = no
writable = yes
; valid users = %S
; valid users = MYDOMAIN\%S
February 17th, 2009
Masao
The new short way:
$ date -d '1 day ago' +'%Y/%m/%d'
2009/07/21
Or the longer way:
Yesterday in epoch seconds
$ yesterday=$((`date +'%s'` - 86400))
Get default formatted yesterday's date
$ date -d "1970-01-01 $yesterday sec"
Tue Feb 17 01:27:32 PST 2009
Same thing in YY-MM-DD
$ date -d "1970-01-01 $yesterday sec" +"%Y-%m-%d"
2009-02-17
On the destination server, remove the known_hosts file:
rm ~/.ssh/known_hosts
Also, try this in your /etc/hosts.allow file
/etc/hosts.allow:
SSHD: ALL
December 18th, 2008
Masao
- Go to System -> Administration -> Network
- Select your “eth0″ device.
- Activate it.
- Click “Edit”.
- Check the box next to “Controlled by Network Manager”.
- Save and exit.
Your connection should now work.
November 30th, 2008
Masao
For example, the “kill” manpage shows:
SEE ALSO
bash(1), tcsh(1), kill(2), sigvec(2), signal(7)
This is how to view section 7 of the “signal” manpage:
man 7 signal
November 30th, 2008
Masao
Edit your ssh_config file like this:
/etc/ssh/ssh_config
ServerAliveInterval 30
This will cause your SSH client to send a keep alive ping every 30 seconds to the server.
November 25th, 2008
Masao
Combined some tips together to figure this one out.
Put this into your .vimrc file:
au FileType * setl fo=cql
I’m using VIM version 7.1.12
Recent Comments