<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Linux and Programming Tips, Tricks, Hacks, Guides, and How-Tos &#187; Uncategorized</title> <atom:link href="http://seanp2k.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" /><link>http://seanp2k.com</link> <description>Linux how to articles and guides, PHP / MySQL / Python / Bash scripting, and music tips, tricks, and hacks</description> <lastBuildDate>Thu, 12 Jan 2012 22:33:41 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>An interesting bit of math</title><link>http://seanp2k.com/2011/06/an-interesting-bit-of-math/</link> <comments>http://seanp2k.com/2011/06/an-interesting-bit-of-math/#comments</comments> <pubDate>Tue, 07 Jun 2011 08:38:28 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[math]]></category><guid isPermaLink="false">http://seanp2k.com/?p=297</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/06/an-interesting-bit-of-math/' addthis:title='An interesting bit of math '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>http://plus.maths.org/content/os/issue26/features/sautoy/index Every time you use your credit card on the internet to buy a ticket to see Real Madrid play, your account is kept secret from hackers thanks to the power of prime numbers. Prime numbers have become the locks that preserve the secrets that are racing through the electronic shopping mall. Each e-business chooses [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/06/an-interesting-bit-of-math/' addthis:title='An interesting bit of math ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/06/an-interesting-bit-of-math/' addthis:title='An interesting bit of math '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p><a href="http://plus.maths.org/content/os/issue26/features/sautoy/index">http://plus.maths.org/content/os/issue26/features/sautoy/index</a></p><blockquote><p>Every time you use your credit card on the internet to buy a ticket to see Real Madrid play, your account is kept secret from hackers thanks to the power of prime numbers. Prime numbers have become the locks that preserve the secrets that are racing through the electronic shopping mall.</p><p>Each e-business chooses two big primes, p and q, which they keep secret. The product of these primes, N=pxq, is made public. A calculation using N encrypts your credit card, but the only way to undo the calculation and decrypt the secret message is to know the secret primes p and q. Cracking codes is the same as cracking the public number N into its prime building blocks. It&#8217;s a bit like a chemist who wants to know the atoms inside a compound. Although chemists have solved their problem, mathematicians lack any fast way to do this prime-number spectroscopy &#8211; to the relief of internet cryptographers.</p></blockquote><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/06/an-interesting-bit-of-math/' addthis:title='An interesting bit of math ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/06/an-interesting-bit-of-math/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quick list of words I misspell</title><link>http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/</link> <comments>http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/#comments</comments> <pubDate>Fri, 27 May 2011 01:40:29 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[english]]></category> <category><![CDATA[learning]]></category> <category><![CDATA[spelling]]></category><guid isPermaLink="false">http://seanp2k.com/?p=278</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/' addthis:title='Quick list of words I misspell '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I keep a list of words that I commonly typo so I can learn how to spell them over time. It&#8217;s good to just have something like this echo at your in your .bashrc so every time you open a new terminal tab, you&#8217;ll see the right way to spell them and eventually you&#8217;ll read [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/' addthis:title='Quick list of words I misspell ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/' addthis:title='Quick list of words I misspell '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I keep a list of words that I commonly typo so I can learn how to spell them over time.  It&#8217;s good to just have something like this echo at your in your .bashrc so every time you open a new terminal tab, you&#8217;ll see the right way to spell them and eventually you&#8217;ll read them enough to learn.</p><pre class="brush: plain; title: ; notranslate">
ambiguous
anonymity
authoritative
believe
character
convenience
corresponding
decommissioned
definitely
degradation
discipline
embarrassment
figuratively
frustrated
guarantee
interpretive
license
maintenance
maneuver
miniature
possession
privilege
receipt
receive
residual
ridiculous
weird
</pre><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/' addthis:title='Quick list of words I misspell ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/05/quick-list-of-words-i-misspell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Shortest bit of JS to hide text after [time]</title><link>http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/</link> <comments>http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/#comments</comments> <pubDate>Sat, 07 May 2011 21:33:05 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[hide text after]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[js]]></category> <category><![CDATA[subliminal]]></category><guid isPermaLink="false">http://seanp2k.com/?p=256</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/' addthis:title='Shortest bit of JS to hide text after [time] '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I was trying to figure out the least amount of code that would render in a browser for 15ms, which is supposedly about the shortest time that subliminal advertising works. Here is what I came up with: If you can get it even shorter, leave a comment!<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/' addthis:title='Shortest bit of JS to hide text after [time] ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/' addthis:title='Shortest bit of JS to hide text after [time] '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I was trying to figure out the least amount of code that would render in a browser for 15ms, which is supposedly about the shortest time that subliminal advertising works.  Here is what I came up with:</p><pre class="brush: xml; title: ; notranslate">
&lt;script&gt;
function s(){setTimeout(function(){document.getElementById(&quot;m&quot;).style.display=&quot;none&quot;;},15);}
&lt;/script&gt;
&lt;body onload=s()&gt;
&lt;div id=m&gt;Test
</pre><p>If you can get it even shorter, leave a comment!</p><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/' addthis:title='Shortest bit of JS to hide text after [time] ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/05/shortest-bit-of-js-to-hide-text-after-time/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Python retreive SQLite results as dictionary of lists</title><link>http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/</link> <comments>http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/#comments</comments> <pubDate>Tue, 19 Apr 2011 08:46:51 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[dict]]></category> <category><![CDATA[iterate]]></category> <category><![CDATA[list]]></category> <category><![CDATA[python]]></category> <category><![CDATA[sqlite]]></category><guid isPermaLink="false">http://seanp2k.com/?p=253</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/' addthis:title='Python retreive SQLite results as dictionary of lists '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>This is an interesting block of code that I just wrote while working on Beaker, the statistics package that goes along with MadScience<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/' addthis:title='Python retreive SQLite results as dictionary of lists ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/' addthis:title='Python retreive SQLite results as dictionary of lists '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>This is an interesting block of code that I just wrote while working on Beaker, the statistics package that goes along with MadScience</p><pre class="brush: python; title: ; notranslate">
# numbers that are floating-point and must be handled as such
floats = ['up', 'time', 'data', 'resptime', 'trans', 'bw', 'concur', 'long', 'short']
# ditto for integers
ints = ['hits', 'ok', 'fail']

# init a new dictionary
mydict = {}

# for every item in the combination of the integers and the floats, create a key for it and assign the value to a blank list
for i in floats + ints:
    mydict[i] = []

# for every row returned by the SQLite query, iterate through all the integers, then all the floats
# for each different named value, go to the dict key that matches and add something to the value of that key, which is a list
# the value should be converted to the respective type and the key coming from the SQLite results (the column name in the DB) matches the names of our keys and thus can be iterated 1:1
for row in cursor.execute(myquery):
    for key in floats:
        mydict[key].append(float(row[key]))
    for key in ints:
       mydict[key].append(int(row[key]))
</pre><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/' addthis:title='Python retreive SQLite results as dictionary of lists ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/04/python-retreive-sqlite-results-as-dictionary-of-lists/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>R1Wrangler</title><link>http://seanp2k.com/2011/04/r1wrangler/</link> <comments>http://seanp2k.com/2011/04/r1wrangler/#comments</comments> <pubDate>Fri, 08 Apr 2011 22:09:18 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[api]]></category> <category><![CDATA[php xmlrpc]]></category> <category><![CDATA[phpxmlrpc]]></category> <category><![CDATA[r1soft]]></category> <category><![CDATA[r1soft api]]></category> <category><![CDATA[r1soft cdp]]></category> <category><![CDATA[r1wrangler]]></category><guid isPermaLink="false">http://seanp2k.com/?p=235</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/r1wrangler/' addthis:title='R1Wrangler '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I&#8217;m working on a full-blown webapp to manage our R1Soft CDP backup server cluster. We have around 1,000 servers and needed a good way to keep track of what backup server(s) they&#8217;re on, when they&#8217;re getting backed up, if they&#8217;re failing, disk space used, if they failed backups previously, etc. I also wanted to have [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/r1wrangler/' addthis:title='R1Wrangler ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/r1wrangler/' addthis:title='R1Wrangler '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I&#8217;m working on a full-blown webapp to manage our R1Soft CDP backup server cluster.  We have around 1,000 servers and needed a good way to keep track of what backup server(s) they&#8217;re on, when they&#8217;re getting backed up, if they&#8217;re failing, disk space used, if they failed backups previously, etc.  I also wanted to have a way to easily add backups to any existing backup server, so I created R1Wrangler: https://github.com/ip2k/R1-Wrangler .  It&#8217;s still a work in progress and the DB schema isn&#8217;t even on the final revision yet, but it&#8217;s getting there and should be useful if you want to dive in to the R1Soft CDP Server 2.x XMLRPC API, OO PHP, normalised database schema, etc.</p><p>Clicky kitty to check it out!<br /> <a href="https://github.com/ip2k/R1-Wrangler"><img src="http://seanp2k.com/octocat.png" alt="" /></a></p><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/r1wrangler/' addthis:title='R1Wrangler ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/04/r1wrangler/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>My .vimrc</title><link>http://seanp2k.com/2011/04/my-vimrc/</link> <comments>http://seanp2k.com/2011/04/my-vimrc/#comments</comments> <pubDate>Tue, 05 Apr 2011 22:00:32 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[dot vimrc]]></category> <category><![CDATA[vim]]></category> <category><![CDATA[vimrc]]></category><guid isPermaLink="false">http://seanp2k.com/?p=228</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/my-vimrc/' addthis:title='My .vimrc '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Still a work in progress. I don&#8217;t use vim all the time, but more and more I see it as a huge time saver.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/my-vimrc/' addthis:title='My .vimrc ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/04/my-vimrc/' addthis:title='My .vimrc '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Still a work in progress.  I don&#8217;t use vim all the time, but more and more I see it as a huge time saver.</p><pre class="brush: plain; title: ; notranslate">
&quot; General config
set nocompatible
set nowrap
set listchars=tab:&gt;-,trail:-

set nu
set list
set showmatch
set autowrite
filetype plugin indent on
syntax on
set ruler

&quot;make it so that jk, instead of navigating across actual lines, allows you
&quot;to scroll up/down visual lines... so if you have a really long wrapped line,
&quot;you can actually scroll down through it
nnoremap &lt;Down&gt; gj
nnoremap &lt;Up&gt; gk

&quot; Customizing indentation so it just does what I expect it to
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab
set shiftround
set smarttab
set autoindent
set smartindent
set cindent
filetype indent on

&quot; set shift-tab to unindent
imap &lt;S-Tab&gt; &lt;C-o&gt;&lt;&lt;

&quot; C-specific configuration
set cino=+0.5s
autocmd FileType c,cpp   set cindent

&quot; Syntax highlighting for non-standard files
autocmd BufNewFile,BufRead *.thrift set filetype=c
&quot; viki config
&quot; au BufNewFile,BufRead *.viki :VikiMinorMode
&quot; let g:vikiUseParentSuffix = 1
</pre><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/04/my-vimrc/' addthis:title='My .vimrc ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/04/my-vimrc/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Scripting Siege for semi-automated testing</title><link>http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/</link> <comments>http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/#comments</comments> <pubDate>Sat, 12 Mar 2011 20:28:41 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[benchmark]]></category> <category><![CDATA[magento]]></category> <category><![CDATA[siege]]></category><guid isPermaLink="false">http://seanp2k.com/?p=185</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/' addthis:title='Scripting Siege for semi-automated testing '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>More can be done with this, but at work, we&#8217;re benchmarking Magento with various changes to our hosting platform and I&#8217;m using the following to standardized tests: Put that in a script and save it. To run it, do:<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/' addthis:title='Scripting Siege for semi-automated testing ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/' addthis:title='Scripting Siege for semi-automated testing '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>More can be done with this, but at work, we&#8217;re benchmarking Magento with various changes to our hosting platform and I&#8217;m using the following to standardized tests:</p><pre class="brush: bash; title: ; notranslate">
[[ $1 ]] || echo 'Please specify a number of runs like this: ' $0 '[number of runs]'
for i in $(seq 1 $1); do
  echo ${i}'.)'
  siege --concurrent=100 --reps=100 -i -b -f urls-bench1.txt 2&gt;&amp;1 \
  |grep -v HTTP/1.1 |grep -v error |grep -vi siege |grep -v battle |grep -vi done \
  |grep -v FILE |grep -v annoying|grep -v chunk |grep -v show-logfile
  sleep 120
done
</pre><p>Put that in a script and save it.  To run it, do:</p><pre class="brush: bash; title: ; notranslate">
bash benchmark.sh [number of runs]
</pre><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/' addthis:title='Scripting Siege for semi-automated testing ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2011/03/scripting-siege-for-semi-automated-testing/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WANdisco SVN installer without registering</title><link>http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/</link> <comments>http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/#comments</comments> <pubDate>Fri, 01 Oct 2010 18:41:36 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://seanp2k.com/?p=133</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/' addthis:title='WANdisco SVN installer without registering '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I really really really really hate stuff that requires you to register or enter an E-Mail address to get a download link, so I make an effort to post the actual link to that type of stuff all over the internet so people don&#8217;t have to register if they poke around a bit. http://www.bugmenot.com/ is [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/' addthis:title='WANdisco SVN installer without registering ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/' addthis:title='WANdisco SVN installer without registering '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I really really really really hate stuff that requires you to register or enter an E-Mail address to get a download link, so I make an effort to post the actual link to that type of stuff all over the internet so people don&#8217;t have to register if they poke around a bit.  http://www.bugmenot.com/ is a great site for finding logins to annoying sites, but some just require an e-mail address so they can spam you.</p><p>Screw that, and screw you WANdisco: If you need the SVN installer from them for CentOS 5, just hit the link below instead of filling out the form at http://www.wandisco.com/products/download_reg.php?download=centos : <a href='http://seanp2k.com/wp-content/uploads/2010/10/svninstall_centos5_wandisco.txt'>svninstall_centos5_wandisco.sh</a> Download and rename to svninstall_centos5_wandisco.sh .</p><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/' addthis:title='WANdisco SVN installer without registering ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2010/10/wandisco-svn-installer-without-registering/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Bash script to pop a Gnome notification for IRC activity</title><link>http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/</link> <comments>http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/#comments</comments> <pubDate>Thu, 30 Sep 2010 02:08:05 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://seanp2k.com/?p=129</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/' addthis:title='Bash script to pop a Gnome notification for IRC activity '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Tweak the vars as needed. This requires &#8216;ii&#8217; , download from here: http://tools.suckless.org/ii/ or install with &#8216;apt-get install ii&#8217; if using Ubuntu/Debian Set debug to &#8216;true&#8217; if you want live debug output. Filtering options coming soon.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/' addthis:title='Bash script to pop a Gnome notification for IRC activity ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/' addthis:title='Bash script to pop a Gnome notification for IRC activity '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Tweak the vars as needed.  This requires &#8216;ii&#8217; , download from here: http://tools.suckless.org/ii/ or install with &#8216;apt-get install ii&#8217; if using Ubuntu/Debian</p><p>Set debug to &#8216;true&#8217; if you want live debug output.  Filtering options coming soon.</p><pre class="brush: bash; title: ; notranslate">
#!/bin/bash

# trap ^C so we can clean up
trap sorry INT

# the hostname or IP of the IRC server
ircserver='10.0.120.98'

# the IRC channel
channel='#techs'

# the bot's IRC nick
nickname=&quot;$(uname -n)&quot;

# the path to ii's irc directory (default is $HOME/irc)...NO TRAILING SLASH!
pathtoircdir=&quot;$HOME/irc&quot;

# set to 'true' to enable debugging output
debug='false'

outfile=&quot;$pathtoircdir/$ircserver/$channel/out&quot;
infile=&quot;$pathtoircdir/$ircserver/in&quot;
joindelay='5'

sorry () {
	echo 'Caught ^C, killing ii now...'
	kill $iipid
	sleep 3
	while [ -d /proc/$iipid ]; do
		kill -9 $iipid
	done
exit 0
}

if [ &quot;$(pidof ii)&quot; ]; then
	echo 'ii is already running!  Exiting...'
	exit 1
fi

ii -s &quot;$ircserver&quot; -n &quot;$nickname&quot; &amp;
iipid=&quot;$!&quot;
echo &quot;ii launched! PID: $iipid&quot;
sleep &quot;$joindelay&quot;
# uncomment / edit the next line to identify to nickserv or send some other command after connecting
# echo '/msg nickserv identify SOMEPASS' &gt; &quot;$infile&quot;

echo &quot;/j $channel&quot; &gt; &quot;$infile&quot;
echo &quot;channel joined!&quot;

if [ &quot;$debug&quot; = 'true' ]; then
	echo &quot;$(date) ircserver $ircserver , channel $channel , nickname $nickname , pathtoircdir $pathtoircdir &quot;
fi

while true; do
	oldcount=&quot;$(cat $outfile | wc -l)&quot;
	sleep 1
	newcount=&quot;$(cat $outfile | wc -l)&quot;
	thediff=&quot;$(echo $newcount - $oldcount | bc)&quot;

	if [ &quot;$debug&quot; = 'true' ]; then
		echo &quot;$(date) oldcount $oldcount , new	count $newcount , thediff $thediff&quot;
	fi

	if [ &quot;$thediff&quot; -gt '0' ]; then
		notify-send &quot;$(tail -$thediff $outfile)&quot;
	fi
done
</pre><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/' addthis:title='Bash script to pop a Gnome notification for IRC activity ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2010/09/bash-script-to-pop-a-gnome-notification-for-irc-activity/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Default BIOS passwords</title><link>http://seanp2k.com/2010/02/default-bios-passwords/</link> <comments>http://seanp2k.com/2010/02/default-bios-passwords/#comments</comments> <pubDate>Tue, 09 Feb 2010 15:10:38 +0000</pubDate> <dc:creator>sean</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[BIOS]]></category> <category><![CDATA[BIOS password]]></category> <category><![CDATA[BIOS reset]]></category> <category><![CDATA[password]]></category> <category><![CDATA[reset]]></category><guid isPermaLink="false">http://seanp2k.com/2010/02/default-bios-passwords/</guid> <description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/02/default-bios-passwords/' addthis:title='Default BIOS passwords '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Here are some to try if you can&#8217;t open the case to short the password reset jumper: AWARD_SW, j262 , HLT, SER, SKY_FOX, BIOSTAR, ALFAROME, lkwpeter, j256, AWARD?SW, LKWPETER, Syxz, aLLy, 589589, 589721, awkward AMI BIOS: AMI, BIOS, PASSWORD, HEWITT RAND, AMI?SW, AMI_SW, LKWPETER, A.M.I. Credit goes to here<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/02/default-bios-passwords/' addthis:title='Default BIOS passwords ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description> <content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://seanp2k.com/2010/02/default-bios-passwords/' addthis:title='Default BIOS passwords '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Here are some to try if you can&#8217;t open the case to short the password reset jumper:<br /> AWARD_SW, j262 , HLT, SER, SKY_FOX, BIOSTAR, ALFAROME,<br /> lkwpeter, j256, AWARD?SW, LKWPETER, Syxz, aLLy, 589589,<br /> 589721, awkward<br /> AMI BIOS:<br /> AMI, BIOS, PASSWORD, HEWITT RAND, AMI?SW, AMI_SW, LKWPETER,<br /> A.M.I.</p><p>Credit goes to <a href="http://lkml.indiana.edu/hypermail/linux/kernel/9806.1/0737.html">here</a></p><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://seanp2k.com/2010/02/default-bios-passwords/' addthis:title='Default BIOS passwords ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded> <wfw:commentRss>http://seanp2k.com/2010/02/default-bios-passwords/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 1/72 queries in 0.021 seconds using memcached
Object Caching 1032/1191 objects using memcached

Served from: seanp2k.com @ 2012-02-06 18:16:49 -->
