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
February 26th, 2010
Masao
Most Comcast remotes have a counter-clockwise curly arrow that is pre-programmed for this code.
1. Press the “Cable” button at the top of the remote to put it into Cable Box control mode.
2. Press and hold the “Setup” button until the “Cable” button blinks twice.
3. Type in the code 994. The “Cable” button will blink twice.
4. Press (do not hold) the “Setup” button.
5. Type in the code 00179.
6. Press whatever button you want to map the 15-second back command to (ex: A / Lock). The “Cable” button will blink twice if successful.
‘Note: To reprogram a “One For All” remote please see this page– http://www.hifi-remote.com/ofa/advanced.shtml
February 26th, 2010
Masao
Add 30-Second Skip
The following technique can be used to map an unused or unneeded button on the “silver” remote to the 30-second skip command. Current versions of the i-Guide software will skip forward 30 seconds into a recording when this command is sent. A good choice is the ‘A / Lock’ button since many users don’t need that function; you can feel both the ‘15-second-back’ and ‘30-second-skip’ buttons with one finger and move between them without looking. Another option is to reprogram the ‘15-second back’ button, since PgDn already provides that functionality. Some users have found, however, that double-clicking the play button results in a 30-second skip forward.
1. Press the “Cable” button at the top of the remote to put it into Cable Box control mode.
2. Press and hold the “Setup” button until the “Cable” button blinks twice.
3. Type in the code 994. The “Cable” button will blink twice.
4. Press (do not hold) the “Setup” button.
5. Type in the code 00173.
6. Press whatever button you want to map the 30-second skip command to (ex: A / Lock). The “Cable” button will blink twice if successful.
Note: This did not work on boxes with the Microsoft TV Foundation Interface (previously used in Washington State, but now converted back to the i-Guide software). As of firmware version 12.22 Insight Cable disabled this feature, but has been re-enabled in firmware version 16.35. Comcast software Version 73.44 disabled this feature, but the latest software, Version 74.53-3321, re-enables it (this has been confirmed on the 3416 w/ 16.20 firmware). See software for more info.
Note: As of software A25.2-2, the Page Up key is removed from some operators and others have programmed it as a 5 min skip.
Note: This code does work for the PACE TDC577X (vegas) standard def DVR with Comcast service (SW version 75.69-a25p2-2S1.r-8).
February 18th, 2010
Masao
Windows 7 does not have the QuickLaunch toolbar enabled by default. Here’s how to add it:
- Right-click the taskbar, then click “New Toolbar”
- In the Folder input field, copy and paste the following line:
%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
- Click “Select Folder”
- Unlock the taskbar.
- Right click the Quick Launch toolbar and uncheck “Show Text” and “Show Title”.
- Drag the Quick Launch toolbar to the desired location.
- Double-click the dotted edge of the toolbar to auto-size the toolbar to the width of the icons.
Done!
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!
December 15th, 2009
Masao
my $string = 'this is a string of text';
$string =~ s/\b(\w+)\b/ucfirst($1)/ge;
print "$string\n";
December 12th, 2009
Masao
foreach($objectA as $k => $v) $objectB->$k = $v;
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 5th, 2009
Masao
While running Apache configure, if you get this error:
No recognized SSL/TLS toolkit detected
…do this:
yum install -y openssl-devel # Required for Apache configure
September 3rd, 2009
Masao
If you’re using HTML::TreeBuilder, you might find a memory leak when creating lots of trees. You must explicitly delete the trees because HTML::Tree does not use weak refs. Here’s how to delete the ref:
use HMTL::TreeBuilder;
my $formatter = HTML::FormatText->new();
my $html_tree = HTML::TreeBuilder->new_from_content($line);
my $plain_text = $formatter->format($html_tree);
$html_tree->delete();
Or if you use HTML::Parse:
my $html_tree = parse_html($line);
$html_tree->eof();
my $plain_text = HTML::FormatText->new()->format($html_tree);
$html_tree->delete();
Or using Object::Destroyer
use Object::Destroyer;
my $html_tree = parse_html($line);
$html_tree = Object::Destroyer->new($html_tree, ‘delete’);
$html_tree->eof();
my $plain_text = HTML::FormatText->new->format($html_tree);
Source: perlmonks.org
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]%/*}
Three men decided to split the cost of a hotel room. The hotel manager gave them a price of $30.
The men split the bill evenly, each paying $10, and went to their room. However, the hotel manager realized that it was a Wednesday night, which meant the hotel had a special: rooms were only $25. He had overcharged them $5!
He called the bellboy, gave him five one-dollar bills and told him to return it to the men.
When the bellboy explained the situation to the men, they were so pleased at the honesty of the establishment that they promptly tipped the bellboy $2 of the $5 he had returned and each kept $1 for himself.
So each of the three men ended up paying $9 (their original $10, minus $1 back) totaling $27, plus $2 for the bellboy which makes $29. So where is the missing dollar?
Redirecting STDERR to STDOUT in Perl:
open STDERR, '>&STDOUT';
Reassign raw file handles:
*STDERR = *STDOUT;
Redirect all output to a logfile:
open(LOG,">/tmp/foo.log");
*STDERR = *LOG;
*STDOUT = *LOG;
Example:
#!/usr/bin/perl
use strict;
use warnings;
warn "regular error";
open STDERR, '>&STDOUT';
warn "redirected error";
Output:
[kitamura@web3 perl]$ ./stderr.pl 2>/dev/null
redirected error at ./stderr.pl 6.
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
You have two ropes that each burn for 1 hour end to end, but at varying rates.
You have a lighter. You cannot cut the ropes (and doing so wouldn’t help, since they burn at unknown rates and you only know total burn time).
How do you measure 45 minutes?
You have 8 bricks, but one of them is lighter than the rest.
You have a balance you can only use twice.
How do you find the lighter brick?
Of three options, you have a 1/3 chance of picking the “right” option.
If you pick one at random, then a single “wrong” option is eliminated, should you switch and why?
Recent Comments