IPv6 Presentation, Introduction to IPv6

I am doing a presentation on IPv6, at my company’s TechFest.  This is a day event with keynote speakers, and break out sessions.  The purpose of TechFest is to give the developers and engineers a break from their day to day activity and get a view of what’s going on around the company and in the industry.

In this article, I’m copy/pasting my slide deck, and stripping out the company specific information, making this a generic Introduction to IPv6.

The Agenda for Today:

What is IPv6? (~10 minutes)
DNS (~10 minutes)
Getting Started (~10 minutes)
Web Application Development (~10 Minutes)

Read more

My first chess video

I might get around to making a series of Chess videos. First, I set out to figure out how. I found that I can record my desktop with the free Windows Media Encoder. I used this site http://bhccvb.blogspot.com/2007/10/how-to-make-chess-videos-on-your-pc.html to learn how. The result of my first stab at this is below. I have a couple problems:
1. Microphone – I need a good one. The one I have sucks.
2. I need Fritz 11 software. I used WinBoard – which is OK, but Fritz is better.
3. Video dimensions. Winboard is rectangular, but taller than it is wide. I need to find a way to make a frame that is ideal for youtube.

Here is the video:

Read more

Solutions to the ORDER BY RAND() problem.

Just getting them in there, these are not original ideas, I got them from someone else, just wanted to post them on my blog for convenience sakes:


* Run a query to determine the MAX ID number in the table.
$MAX = SELECT COUNT(*) FROM tbl

/* Use PHP to generate a random number between 1, and the max
$ID = RAND(1, $MAX)

/* Run a last query to select the ID that is >= the random one.
SELECT * FROM tbl WHERE id >= $ID LIMIT 1


Another possible solution would be a heavy modification to that query. This solution is likely the best.

New Query:

SELECT *
FROM `tbl` AS `l1`
JOIN
(SELECT (RAND() * (SELECT MAX(`id`) FROM `tbl`)) AS `id`) AS `l2`
WHERE
`l1`.`id` >= `l2`.`id`
ORDER BY
`l1`.`id` ASC
LIMIT 1;

tar pipe ssh

I always have to look this up when I need it, so storing on my blog, so I can look it up faster. This is way faster than “scp”, for deep directories or directories with lots of files.


tar cf - whatever | ssh remotehost " ( cd /some/path ; tar xf - ) "
ssh remotehost "( cd /somewhere ; tar cf - something ) " | tar xf -

Using tmpfs for MySQL tmpdir setting

This is incredible, by the way. Any time MySQL needs to use a tmp table on disk, you can make it use RAM disk instead.

WARNING: if the tmpfs partition you make isn’t big enough, MySQL will not be able to complete queries. Make sure you have enough RAM to do this.


mkdir /tmp/mysqltmp
chown mysql:mysql /tmp/mysqltmp

id mysql
# example:   uid=502(mysql) gid=503(mysql) groups=503(mysql)

#to set up on server restart, put in fstab something like (replace gid, uid with number from above)
tmpfs    /tmp/mysqltmp    tmpfs   rw,gid=503,uid=502,size=2G,nr_inodes=10k,mode=0700 0 0

mount /tmp/mysqltmp

# you don't need this:
# mount -o size=2g,gid=520,uid=518,nr_inodes=10k,mode=0700 -t tmpfs tmpfs /tmp/mysqltmp

#edit my.cnf, adding
tmpdir=/tmp/mysqltmp/

restart mysql

Read more

Scaling MySQL Vertically, The Sun Way

This is a response to a response to an article about Scaling MySQL with a Sun server with a 256-thread count.

With x86 based processors, you get high speed threads, but only a couple (up to four) per processor. With the Sun Coolthread T2 processor, you get slower speed threads, but a lot of them, 64 threads per processor. The 256-way is 4 of these processors on one board.

Read more