<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rss PUBLIC
'-//Netscape Communications//DTD RSS 0.91//EN'
'http://my.netscape.com/publish/formats/rss-0.91.dtd'>

<rss version='0.91'>

<channel>
    <title>Michael's Blog</title>
    <link>http://new.watters.ws</link>
    <description>News Feed</description>


<item>
 <title>Manually create a Wordpress admin user from the mysql command line</title>
 <link>http://new.watters.ws/view/article/186</link>
 <pubDate>2013-05-01 16:06:00</pubDate>
 <description>&lt;p&gt;If you need admin access to a wordpress install you can easily create a new admin user by running a few SQL commands on the database.  This has been tested and verified to work on Wordpress 3.5.&lt;/p&gt;

&lt;p&gt;To do this you will first need to identify what database the site is actually using.  Check wp-config.php for the database name and mysql host info.  Once you have that connect to mysql and run the following statements.&lt;/p&gt;

&lt;p class="code"&gt;INSERT INTO wp_users (user_login,user_pass,user_email,user_registered,user_status) VALUES("user_name",md5('password'),"username@example.com",NOW(),0);&lt;/p&gt;

&lt;p&gt;Find user ID from wp_users table:&lt;/p&gt;

&lt;pre class="code"&gt;SET @user_id = (SELECT ID FROM wp_users where user_login = 'user_name');

INSERT INTO wp_usermeta (user_id,meta_key,meta_value) VALUES (@user_id,"wp_user_level","10");

INSERT INTO wp_usermeta (user_id,meta_key,meta_value) VALUES (@user_id,"wp_capabilities",'a:1:{s:13:"administrator";s:1:"1";}');
&lt;/pre&gt;</description>
</item>


<item>
 <title>Storm VPS Lustre Benchmarks</title>
 <link>http://new.watters.ws/view/article/185</link>
 <pubDate>2013-04-11 13:56:00</pubDate>
 <description>&lt;p&gt;After reading about various cluster file systems I decided to set up a small cluster running Lustre using Storm VPS instances.  All nodes have the same hardware configuration and use a 50 GB SAN volume connected through iSCSI as the lustre block device.  Specs are as follows.&lt;/p&gt;

&lt;pre&gt;
Node configuration:

OS: CentOS 6.3 x86_64
Kernel: 2.6.32-279.19.1.el6_lustre.x86_64
RAM: 3556 MB (Storm 4 GB)
Primary Disk: 300 GB virtual disk
Secondary Disk (iscsi): 50 GB SAN volume
CPU: Two Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cores

Lustre configuration: 1 management server, 1 metadata server, 1 object storage server.  LNET was configured to use a private network interface.
&lt;/pre&gt;

&lt;p&gt;Disk performance was tested with the sgpdd_survey script from the Lustre IOkit.  Write speed appears to average around 35-40 MB/s.&lt;/p&gt;

&lt;pre&gt;
Wed Apr 10 10:29:39 EDT 2013 sgpdd-survey on /dev/sda from oss1.watters.ws
total_size  8388608K rsz 1024 crg     1 thr     1 write   49.32 MB/s     1 x  49.32 =   49.32 MB/s read   68.15 MB/s     1 x  68.15 =   68.15 MB/s
total_size  8388608K rsz 1024 crg     1 thr     2 write   77.15 MB/s     1 x  77.15 =   77.15 MB/s read   92.85 MB/s     1 x  92.85 =   92.85 MB/s
total_size  8388608K rsz 1024 crg     1 thr     8 write   36.15 MB/s     1 x  36.14 =   36.14 MB/s read   94.08 MB/s     1 x  94.09 =   94.09 MB/s
total_size  8388608K rsz 1024 crg     1 thr    16 write   35.84 MB/s     1 x  35.85 =   35.85 MB/s read  101.59 MB/s     1 x 101.59 =  101.59 MB/s
total_size  8388608K rsz 1024 crg     2 thr     2 write   35.34 MB/s     2 x  17.67 =   35.34 MB/s read   67.38 MB/s     2 x  33.69 =   67.39 MB/s
total_size  8388608K rsz 1024 crg     2 thr     4 write   39.09 MB/s     2 x  19.55 =   39.10 MB/s read   79.20 MB/s     2 x  39.60 =   79.19 MB/s
total_size  8388608K rsz 1024 crg     2 thr     8 write   40.40 MB/s     2 x  20.20 =   40.40 MB/s read   98.16 MB/s     2 x  49.09 =   98.17 MB/s
total_size  8388608K rsz 1024 crg     2 thr    16 write   37.73 MB/s     2 x  18.86 =   37.73 MB/s read   99.31 MB/s     2 x  49.66 =   99.32 MB/s
total_size  8388608K rsz 1024 crg     2 thr    32 write   38.08 MB/s     2 x  19.04 =   38.07 MB/s read   97.30 MB/s     2 x  48.66 =   97.31 MB/s
total_size  8388608K rsz 1024 crg     4 thr     4 write   38.38 MB/s     4 x   9.59 =   38.38 MB/s read   98.17 MB/s     4 x  24.55 =   98.19 MB/s
total_size  8388608K rsz 1024 crg     4 thr     8 write   38.25 MB/s     4 x   9.57 =   38.26 MB/s read  100.06 MB/s     4 x  25.01 =  100.06 MB/s
total_size  8388608K rsz 1024 crg     4 thr    16 write   39.42 MB/s     4 x   9.85 =   39.41 MB/s read   99.96 MB/s     4 x  25.00 =   99.98 MB/s
total_size  8388608K rsz 1024 crg     4 thr    32 write   39.43 MB/s     4 x   9.86 =   39.44 MB/s read   99.93 MB/s     4 x  24.99 =   99.95 MB/s
total_size  8388608K rsz 1024 crg     4 thr    64 write   38.22 MB/s     4 x   9.56 =   38.22 MB/s read   97.80 MB/s     4 x  24.45 =   97.81 MB/s
total_size  8388608K rsz 1024 crg     8 thr     8 write   38.73 MB/s     8 x   4.84 =   38.76 MB/s read   87.71 MB/s     8 x  10.97 =   87.74 MB/s
total_size  8388608K rsz 1024 crg     8 thr    16 write   39.70 MB/s     8 x   4.96 =   39.67 MB/s read   81.09 MB/s     8 x  10.14 =   81.10 MB/s
total_size  8388608K rsz 1024 crg     8 thr    32 write   43.40 MB/s     8 x   5.43 =   43.41 MB/s read   81.21 MB/s     8 x  10.16 =   81.25 MB/s
total_size  8388608K rsz 1024 crg     8 thr    64 write   38.88 MB/s     8 x   4.86 =   38.91 MB/s read   67.10 MB/s     8 x   8.39 =   67.14 MB/s
total_size  8388608K rsz 1024 crg     8 thr   128 write   42.19 MB/s     8 x   5.27 =   42.19 MB/s read   65.92 MB/s     8 x   8.24 =   65.92 MB/s
&lt;/pre&gt;

&lt;p&gt;IOPS performance was tested using &lt;i&gt;iozone&lt;/i&gt;, here are the results.&lt;/p&gt;

&lt;pre&gt;
	OPS Mode. Output is in operations per second.
	Include fsync in write timing
	No retest option selected
        Record Size 4 KB
        File size set to 4194304 KB
        Command line used: iozone -l 32 -O -i 0 -i 1 -i 2 -e -+n -r 4K -s 4G
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 Kbytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.
        Min process = 32
        Max process = 32
        Throughput test with 32 processes
        Each process writes a 4194304 Kbyte file in 4 Kbyte records

        Children see throughput for 32 initial writers  =   27764.87 ops/sec
        Parent sees throughput for 32 initial writers   =   26692.16 ops/sec
        Min throughput per process                      =     840.07 ops/sec
        Max throughput per process                      =     903.35 ops/sec
        Avg throughput per process                      =     867.65 ops/sec
        Min xfer                                        =  975918.00 ops

        Children see throughput for 32 readers          =   26758.37 ops/sec
        Parent sees throughput for 32 readers           =   26755.12 ops/sec
        Min throughput per process                      =     448.79 ops/sec
        Max throughput per process                      =    1372.74 ops/sec
        Avg throughput per process                      =     836.20 ops/sec
        Min xfer                                        =  342845.00 ops
&lt;/pre&gt;

&lt;p&gt;As you can see lustre is a relatively high performance file system and is easily scalable to store petabytes of data.  Adding more space is as simple as building a new object server and running mkfs.lustre.&lt;/p&gt;</description>
</item>


<item>
 <title>create an rpm mirror using wget</title>
 <link>http://new.watters.ws/view/article/184</link>
 <pubDate>2013-04-10 13:35:00</pubDate>
 <description>&lt;p&gt;If you want to set up a yum repo you can easily mirror an existing site using wget.  To do this you will need to run this command.&lt;/p&gt;

&lt;pre&gt;
wget --mirror -np --no-host-directories -A rpm,srpm http://downloads.whamcloud.com/public/lustre/latest-maintenance-release/
&lt;/pre&gt;

&lt;p&gt;In this case we are mirroring the lustre rpm repo.&lt;/p&gt;

&lt;p&gt;After the files are downloaded you can run the &lt;b&gt;createrepo&lt;/b&gt; command to create yum metadata.&lt;/p&gt;</description>
</item>


<item>
 <title>quickly remove old ssh keys with sed</title>
 <link>http://new.watters.ws/view/article/181</link>
 <pubDate>2012-04-24 10:13:00</pubDate>
 <description>&lt;p&gt;If you work on a lot of servers and do a lot of reinstalls you will see the following error often.&lt;/p&gt;

&lt;pre&gt;
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a8:6a:60:5a:48:64:ac:90:33:b9:f2:7c:be:56:92:81.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:9948
RSA host key for host.example.com has changed and you have requested strict checking.
Host key verification failed.
&lt;/pre&gt;

&lt;p&gt;To save some time you can quickly remove the old host key with a single sed command:&lt;/p&gt;

&lt;pre&gt;sed -i '9948d' .ssh/known_hosts&lt;/pre&gt;

</description>
</item>


<item>
 <title>Building the wl module on linux 3.2</title>
 <link>http://new.watters.ws/view/article/180</link>
 <pubDate>2012-04-02 21:57:00</pubDate>
 <description>&lt;p&gt;After upgrading my netbook kernel to the latest stable version available on backports.org I soon discovered that my wireless interface no longer worked.  Trying to rebuild the module resulted in the following error:&lt;/p&gt;

&lt;pre&gt;
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c: In function ‘_wl_set_multicast_list’:
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1435: error: ‘struct net_device’ has no member named ‘mc_list’
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1435: error: ‘struct net_device’ has no member named ‘mc_count’
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1436: error: dereferencing pointer to incomplete type
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1442: error: dereferencing pointer to incomplete type
make[4]: *** [/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.o] Error 1
make[3]: *** [_module_/usr/src/modules/broadcom-sta/amd64] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-0.bpo.2-amd64'
make: *** [all] Error 2
root@netbook:/usr/src/modules/broadcom-sta/amd64#  run "make API=WEXT"
bash: run: command not found
root@netbook:/usr/src/modules/broadcom-sta/amd64# "make API=WEXT"
bash: make API=WEXT: command not found
root@netbook:/usr/src/modules/broadcom-sta/amd64# make API=WEXT
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-0.bpo.2-amd64'
  CC [M]  /usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.o
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c: In function ‘_wl_set_multicast_list’:
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1435: error: ‘struct net_device’ has no member named ‘mc_list’
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1435: error: ‘struct net_device’ has no member named ‘mc_count’
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1436: error: dereferencing pointer to incomplete type
/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.c:1442: error: dereferencing pointer to incomplete type
make[4]: *** [/usr/src/modules/broadcom-sta/amd64/src/wl/sys/wl_linux.o] Error 1
make[3]: *** [_module_/usr/src/modules/broadcom-sta/amd64] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-0.bpo.2-amd64'
make: *** [all] Error 2
&lt;/pre&gt;

&lt;p&gt;A bit of googling lead me to a few patches that helped solve the issue.  Here is a unified diff of my changes which should allow you to cleanly build and install the wl module using module-assistant.&lt;/p&gt;

&lt;p&gt;http://www.watters.ws/broadcom_bcm4313_linux3.2.patch&lt;/p&gt;

&lt;p&gt;One thing to note is that the source code needs to be patched BEFORE you run m-a, i.e. cd to /usr/src/modules/broadcom_sta/amd64/src/wl/sys and run patch the patch from there.&lt;/p&gt;

&lt;p&gt;I hope that somebody will find this useful.&lt;/p&gt;</description>
</item>


<item>
 <title>Happy Thanksgiving!</title>
 <link>http://new.watters.ws/view/article/177</link>
 <pubDate>2009-11-26 13:16:12</pubDate>
 <description>&lt;p&gt;Hard to believe it's been a year since I posted this.&lt;/p&gt;

&lt;pre&gt;
                              ,+*^^*+___+++_
                         ,*^^^^              )
                      _+*                     ^**+_
                    +^       _ _++*+_+++_,         )
        _+^^*+_    (     ,+*^ ^          \+_        )
       {       )  (    ,(    ,_+--+--,      ^)      ^
      { (@)    } f   ,(  ,+-^ __*_*_  ^^\_   ^\       )
     {:;-/    (_+*-+^^^^^+*+*&lt;_ _++_)_    )    )      /
    ( /  (    (        ,___    ^*+_+* )   &lt;    &lt;
     U _/     )    *--&lt;  ) ^\-----++__)   )    )       )
      (      )  _(^)^^))  )  )\^^^^^))^*+/    /       /
    (      /  (_))_^)) )  )  ))^^^^^))^^^)__/     +^^
   (     ,/    (^))^))  )  ) ))^^^^^^^))^^)       _)
    *+__+*       (_))^)  ) ) ))^^^^^^))^^^^^)____*^
    \             \_)^)_)) ))^^^^^^^^^^))^^^^)
     (_             ^\__^^^^^^^^^^^^))^^^^^^^)
       ^\___            ^\__^^^^^^))^^^^^^^^)
            ^^^^^\uuu/^^\uuu/^^^^\^\^\^\^\^\^\^
               ___) &gt;____) &gt;___   ^\_\_\_\_\_\_\)
              ^^^//\_^^//\_^       ^(\_\_\_\)
                ^^^ ^^ ^^^ ^^


 #    #    ##    #####   #####    #   #
 #    #   #  #   #    #  #    #    # #
 ######  #    #  #    #  #    #     #
 #    #  ######  #####   #####      #
 #    #  #    #  #       #          #
 #    #  #    #  #       #          #


  #####  #    #    ##    #    #  #    #   ####
    #    #    #   #  #   ##   #  #   #   #
    #    ######  #    #  # #  #  ####     ####
    #    #    #  ######  #  # #  #  #         #
    #    #    #  #    #  #   ##  #   #   #    #
    #    #    #  #    #  #    #  #    #   ####


  ####      #    #    #     #    #    #   ####
 #    #     #    #    #     #    ##   #  #    #
 #          #    #    #     #    # #  #  #
 #  ###     #    #    #     #    #  # #  #  ###
 #    #     #     #  #      #    #   ##  #    #
  ####      #      ##       #    #    #   ####

&lt;/pre&gt;

&lt;p&gt;Download the script here: http://linuxshellaccount.blogspot.com/2008/11/happy-thanksgiving-unixlinux-ascii-art.html&lt;/p&gt;</description>
</item>


<item>
 <title>Ubuntu Automatic Updates</title>
 <link>http://new.watters.ws/view/article/176</link>
 <pubDate>2009-09-14 00:38:05</pubDate>
 <description>&lt;p&gt;If you're sick of the update notifier bugging you on your Ubuntu desktop you can easily set up a cron job to automatically take care of things.&lt;/p&gt;

&lt;pre class='code'&gt;sudo crontab -e
0 5 * * * apt-get -y upgrade
&lt;/pre&gt;

&lt;p&gt;Change the time to whenever you want.&lt;/p&gt;</description>
</item>


<item>
 <title>SQL Query Optimization</title>
 <link>http://new.watters.ws/view/article/172</link>
 <pubDate>2009-06-10 18:19:19</pubDate>
 <description>&lt;p&gt;I've been updating the code for my site a bit to make things load a bit faster and one of the things I fixed was the random query generator.&lt;/p&gt;

&lt;p class="code"&gt;SELECT quote, name FROM quotes ORDER BY RANDOM() LIMIT 1&lt;/p&gt;

&lt;p&gt;The query above works great for small tables but consider the issue when you have a table with millions of rows, the server must read every row, sort them, and then throw out all the results but the first.  This takes a lot of CPU time and is slow, the optimal solution is to use create a sequence as the primary key and then generate a random number using that.  For example:&lt;/p&gt;

&lt;p class="code"&gt;idx = select last_value FROM quotes_idx_seq&lt;/p&gt;

&lt;p class="code"&gt;SELECT quote_text, name FROM quotes WHERE quote_id = '%s' %idx&lt;/p&gt;

&lt;p&gt;It requires two queries instead of one but there is much less disk I/O required.&lt;/p&gt;

</description>
</item>


<item>
 <title>Tip of the Day</title>
 <link>http://new.watters.ws/view/article/171</link>
 <pubDate>2009-06-05 14:51:43</pubDate>
 <description>&lt;p class="code"&gt;Directory '/var/run/screen' must have mode 777.&lt;/p&gt; &lt;p&gt;This is a fairly common error I've been seeing lately and the solution is quite simple.&lt;/p&gt; &lt;p class="code"&gt;chmod g+s /usr/bin/screen&lt;/p&gt;</description>
</item>


<item>
 <title>Market Freefall</title>
 <link>http://new.watters.ws/view/article/169</link>
 <pubDate>2009-03-02 22:39:08</pubDate>
 <description>&lt;p&gt;I originally posted about this back in October when this whole crisis started but as with all things econ there is a time lag between cause and effect.  I have stated many times that I expect the DJIA to return to around the 5000 level and now many economists expect it to go even lower than that.&lt;/p&gt;

&lt;p&gt;I'm not trying to spread gloom and no matter what happens I think we'll survive, humanity has made it through far worse times.  One things for sure, the days of zero down, interest only loans are OVER.&lt;/p&gt;

&lt;p&gt;Here's the latest graph I've made reflecting recent closing values.&lt;img src="images/dow.png" border="0"&gt;&lt;/p&gt;</description>
</item>


</channel>
</rss>
