Add Scroogle to your search area in Firefox 2.0 Install the 'Scroogle Scraper' search plugin.

October 2007


We recently upgraded from MySQL 4 to MySQL 5 and we noticed strange characters in some of the varchar and text fields.

step 1: dump out the contents of the bad field in hex
mysql> select hex(myfieldname) from mytablename where myid=’something’;

step 2: run a php program to print out the chars one at a time

function hex2asc($temp) {
  $len = strlen($temp);
  for ($i=0;$i<$len;$i+=2) {
  $data[$i]=chr(hexdec(substr($temp,$i,2)))."  ".substr($temp,$i,2);
 
  }
  return $data;
}
$str="HEX GOES HERE";
$data=hex2asc($str);
print_r($data);

step 3: once you’ve identified the bad chars and their hex values, change them in the database

here are some bad chars I found:

– fix apostrophe
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’92′),”‘”);

– fix left single quote
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’93′),”‘”);

– fix right single quote
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’94′),”‘”);

– fix bullets
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’95′),”& #8226;”);

– fix double dash
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’96′),”–”);

– fix triple dash
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’97′),”—”);

— fix supscripted TM
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(’99′),”<sup>TM</sup>”);

– replace jacked up apostrophe/single quote
– delete EFs
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(‘EF’),”");
– replace BFs with single quote
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(‘BF’),”‘”);
– delete BDs
update mytablename set myfieldname=REPLACE(myfieldname,UNHEX(‘BD’),”");

see also: http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html

forward a single IP

  • ssh into a server
  • right click on toolbar, change settings
  • ssh->tunnels
    • source: 80
    • destination: someip:80
    • CLICK Add
    • click Apply
  • in a browser: goto localhost and you’ll see the contents of someip

forward all addresses

  • ssh into a server
  • right click on putty toolbar, change settings
  • ssh->tunnels
    • source: 5432
    • select (*) Dynamic
    • Click Add
    • Click Apply
  • in firefox:
    • tools->options, advanced, network
    • (*) manual proxy configuration
    • SOCKS host: 127.0.0.1, port: 5432

To make it more secure, set the user shell on the ssh server to /bin/false and in ssh settings click [x] don’t start a shell or command at all
don’t forget to change the network settings back when you want to surf normally. Also once the ssh session closes your internet access will not work

mcbride-lies.jpgWe all know that SCO sucks. By extension, the people who work for that deplorable company also suck and because now SCO isn’t doing so well financially, SCO is laying off a bunch of employees. These people took the bet that SCO would win and now that SCO is losing, they’ll expect to pretend that nothing ever happened and jump to another job. Of course, they stood to gain a lot if SCO’s attempt to extort money out of the Linux world would have worked. Fortunately SCO’s plan has failed miserably. Sorry SCO employees, You can’t eat your cake and have it too (as the saying originally went) — no jobs for you!

Send to a friend * Print this page * Join the club * Talk with my robot * Advertise here * Search this Site * Donate * Link to me


Web hosting by Utah Hub *  Powered by CreativeTap *  In association with Segomo
Unless otherwise noted, Copyright 2004-2013, Ryan Byrd. All Rights Reserved.
Ryan Byrd dot net -- probably the coolest site in Utah