<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8717593967327947380</id><updated>2012-01-01T05:35:48.884-08:00</updated><category term='mobile'/><category term='lostandfound'/><category term='taverna'/><category term='cli'/><category term='sysadmin'/><category term='admin'/><category term='characters'/><category term='encoding'/><category term='rsync'/><category term='namazu'/><category term='phonefail'/><category term='truecrypt'/><category term='postfix'/><category term='tomcat'/><category term='export'/><category term='sync'/><category term='freerunner'/><category term='C++'/><category term='file-handling'/><category term='encryption'/><category term='applications'/><category term='base64'/><category term='satan'/><category term='keyboard'/><category term='scp'/><category term='vim'/><category term='tv'/><category term='eclipse'/><category term='cron'/><category term='silc'/><category term='crontab'/><category term='backup'/><category term='linux'/><category term='calendars'/><category term='n770'/><category term='java'/><category term='vmware'/><category term='programming'/><category term='openmoko'/><category term='resizing'/><category term='ssh'/><category term='gsm'/><category term='hate'/><category term='sendmail'/><category term='bash'/><category term='networking'/><category term='gaybuntu'/><category term='pdf'/><category term='du'/><category term='permissions'/><category term='android'/><category term='wireless'/><category term='session'/><category term='search'/><category term='partition'/><category term='ubuntu'/><category term='virtualisation'/><category term='env'/><category term='txtreader'/><category term='svn'/><title type='text'>linuxjunk</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default?start-index=101&amp;max-results=100'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>189</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4901590740110198034</id><published>2011-06-13T07:53:00.000-07:00</published><updated>2011-06-13T07:56:24.049-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>Sum weights</title><content type='html'>I have a file with a bunch of sequences and some weights at the top of the file:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt;WEIGHTS 0.926434 1.000000 1.000000 0.926434 1.000000 0.892712 1.000000 1.000000 1.000000 1.000000 1.000000 0.892712 &lt;br /&gt;&amp;gt;CRTC_EUGGR__Q9ZNY3 Calreticulin precursor.&lt;br /&gt;XRKELWXXXXXXXXXXXXXXXXXXXXXXXXXTRWTHSTXXSDYXKFKLTSGKFYGDKAKDAGIQTSQDAKFYAISSPIASXXSXEXXXLVLQFSVKHXXXXXXGXGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXKXEPRCEXDTLSHTYXAXXXXDXXXEVLVDQVKKESGTLEEDWEILKPKTIPDPEDKKPADWVDEPDMVDPEDKKPEDWDKEPAQIPDPDATQPDDWDEEEDGKWEAPMISNPKYKGEWKAKKIPNPAYKGVWKPRDIPNPEYEADDKVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXFYDQTNGATKDAEKKAFDSAEADKRKKEEDERKKQEEEEKKTAEEDEXXXDEXXXEDDKKDEL&lt;br /&gt;&amp;gt;HSP47_RAT__P29457 47 kDa heat shock protein precursor (Collagen-binding protein 1) (GP46).&lt;br /&gt;XRSLXXXXXXXXXXXXXXXXXXXXEAAAPGTAEKLSSKATTLAEXSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXKXXXXSQAKAVLSAEKLRDEEVHTGLGELVRSLSNXTARNVTWKLGSXXXXXXXXSFADDFVRSSKQHYNCEHSKINFRDKRSALQSINEWASQTTDGKLPEVTKDVERTDXXLLXXAMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYXYXXXXXXXXQXVEMXXXXXXXXXXXXXXXXXXXXXRLEKXXTKXQLKTWMGKMQKKAXXISLPXGVVXVTHDLQKXXAGLGLTEAIXKNKADLSXXSGXXXXXXXXXXXXXXXEWDTEGNPFDQDIYGRXXXRSXXXXXXXXXXXXXXXXXXXXXXXXIGRLXXXXGDKMRDEL&lt;br /&gt;&amp;gt;ENPL_PIG__Q29092 Endoplasmin precursor (94 kDa glucose-regulated protein) (GRP94) (GP96 homolog) (98 kDa protein kinase) (PPK 98) (ppk98).&lt;br /&gt;XRAXXXXXXXXXXXXXXXXXXXXEVDVDGTVEEDLGKSREGSRTDDEVVQREEEAIQLDGLNASQIRELREKSEKXAFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXELTVKXKCDKEKNLLHVTDTGVGMTREELVKNLGTIAKSGTSEFLNKMAEAQEDGQSTSELIGXXXXXXXXXXXXXXXXXVTXXHNNDTQHIWESDSNEFSVIADPRGNTLGRGTTITLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSXKTETVEXPMXXXXAAKXEKEESDDEAAVXXXXXEKXPXTXKVEKTVWDWELMNDIKPIWQRPSKEVEDDEYKAFYKSFSXXXXXPMAYIHFTXXXXXXXXXILXXXXXXXXXLFDEYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXLNVSREXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXGVIXDHXXXXRLAKLLRFQSSHHPSDITSLDQYVERMKEKQDKIYFMAGSSRKEAESSPFVEXXXXXXXXXXXXXXXXXXXXXQALPXXXXKRFQNVAKEGVKFDESEKSKENREAVEKEFEPLLNWMKDKALXDKIEKAVVSQRXXEXXXXLVASQYGWXGNXERIMKAQAYQTGKDISTNYYASQKKTFEINPRHPLIRDMLRRVKEDEDDKXXSDLXXXXXXXXXXXXXXLLPDTKAYXXRIERMLRLSLNIDPDAKVEXXPXXXPXXTTEDTTEDTEQDDDEEMDAGADEXXQXTSETSTAEKDEL&lt;br /&gt;&amp;gt;CRTC_HUMAN__P27797 Calreticulin precursor (CRP55) (Calregulin) (HACBP) (ERp60) (grp60).&lt;br /&gt;XLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXTSXXIESXXXSDFXXFVLSSGKFYGDEEKDKGLQTSQDARFYALSASFEXXSXXXXXLVVXFXXKHXXXXXXGGGYVKLFPNSLDQTDMHGDSEYNIMFGPDIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXTYEVKIDNSQVESGSLEDDWDFLPPKKIKDPDASKPEDWDERAKIDDPTDSKPEDWDKPEHIPDPDAKKPEDWDEEMDGEWEPPVIQNPEYKGEWKPRQIDNPDYKGTWIHPEIDNPEYSPDPSIYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXAYAEEFGNETWGVTKAAEKQMKDKQDEEQRLKEEEEDKKRKEXXXAXDKEDXEXKXEDXXDXXDKXXDXXEDVPGQAKDEL&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I want to sum the weights which is fine for this example with like 12 sequences. However, some of the files have a couple of hundred entries. Step in Bash:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt; head -n 1 filename.txt &amp;#124; awk '{for (i=1; i&amp;lt;=NF; i++) s=s+$i}; END{print s}'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Giving me the sum of the weights! Woohoo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4901590740110198034?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4901590740110198034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4901590740110198034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4901590740110198034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4901590740110198034'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2011/06/sum-weights.html' title='Sum weights'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6642412066426142853</id><published>2011-04-16T07:13:00.000-07:00</published><updated>2011-10-02T16:47:14.778-07:00</updated><title type='text'>find a random webserver using libcurl</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/10/find-a-random-webserver-using-libcurl/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6642412066426142853?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6642412066426142853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6642412066426142853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6642412066426142853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6642412066426142853'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2011/04/find-random-webserver-using-libcurl.html' title='find a random webserver using libcurl'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5958848201391127980</id><published>2010-11-29T03:14:00.000-08:00</published><updated>2010-12-02T02:35:27.097-08:00</updated><title type='text'>Metasploit simple example (3.5.0)</title><content type='html'>Download and install metasploit framwork from here: http://www.metasploit.com/framework/download/&lt;br /&gt;&lt;br /&gt;run msfconsole type the following to run exploits:&lt;br /&gt;&lt;br /&gt;db_driver sqlite3&lt;br /&gt;db_connect&lt;br /&gt;db_nmap [ip address]&lt;br /&gt;db_autopwn -p -e -t&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5958848201391127980?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5958848201391127980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5958848201391127980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5958848201391127980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5958848201391127980'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/11/metasploit-simple-example.html' title='Metasploit simple example (3.5.0)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7436087534852973443</id><published>2010-11-27T15:43:00.000-08:00</published><updated>2011-10-02T16:57:45.636-07:00</updated><title type='text'>Unobservable alphabetic password entry</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/10/unobservable-pin-and-password-entry/"&gt;HERE&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7436087534852973443?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7436087534852973443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7436087534852973443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7436087534852973443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7436087534852973443'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/11/unobservable-alphabetic-password-entry.html' title='Unobservable alphabetic password entry'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4518922832450416071</id><published>2010-11-27T05:09:00.000-08:00</published><updated>2011-10-02T16:58:09.631-07:00</updated><title type='text'>Unobservable pin entry</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/10/unobservable-pin-and-password-entry/"&gt;HERE&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4518922832450416071?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4518922832450416071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4518922832450416071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4518922832450416071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4518922832450416071'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/11/following-is-command-line-number.html' title='Unobservable pin entry'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5957272376155105105</id><published>2010-11-23T08:27:00.000-08:00</published><updated>2011-10-02T17:00:21.145-07:00</updated><title type='text'>Grabbing environment variables in gnuplot</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/10/grabbing-environment-variables-in-gnuplot/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5957272376155105105?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5957272376155105105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5957272376155105105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5957272376155105105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5957272376155105105'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/11/grabbing-environment-variables-in.html' title='Grabbing environment variables in gnuplot'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-338898520714371060</id><published>2010-08-24T08:57:00.001-07:00</published><updated>2010-08-24T08:59:53.529-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>vim magic</title><content type='html'>So I have a bunch of sequences in fasta format - and I need to rearrange the mo'fos. &lt;br /&gt;&lt;br /&gt;To start with the entries look like this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt;F13C5.1        CE19383 WBGene00017422  status:Partially_confirmed      UniProt:O76564  protein_id:AAC64611.1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Run this vim command:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;:%s:&amp;gt;\(\S\{4,}\)\t.*UniProt\:\(\S\{6,}\).*$:&amp;gt;\1_CAEEL__\2:g&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And now they look like this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&gt;geneName_OrgID__UniProtAccNo&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-338898520714371060?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/338898520714371060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=338898520714371060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/338898520714371060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/338898520714371060'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/08/vim-magic.html' title='vim magic'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5872911178621610730</id><published>2010-08-05T17:13:00.000-07:00</published><updated>2010-08-05T17:15:01.586-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><title type='text'>LaCie Network Space</title><content type='html'>So.. you've hacked your network space and got root. But your lazy and you can't find up to date instructions on installing ipkg?&lt;br /&gt;&lt;br /&gt;wget http://ipkg.nslu2-linux.org/feeds/optware/mssii/cross/stable/mssii-bootstrap_1.2-7_arm.xsh&lt;br /&gt;&lt;br /&gt;and then sh mssii-bootstrap_1.2-7_arm.xsh&lt;br /&gt;&lt;br /&gt;Now you have ipkg goodness.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5872911178621610730?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5872911178621610730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5872911178621610730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5872911178621610730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5872911178621610730'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/08/lacie-network-space.html' title='LaCie Network Space'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4752216977467685894</id><published>2010-07-30T08:18:00.000-07:00</published><updated>2010-07-30T08:19:34.175-07:00</updated><title type='text'>Quick and Dirty histogram in awk</title><content type='html'>awk '{histogram[int(($2*100)/100)]++;}END{for (i in histogram) { print i, histogram[i] }}' somerandomfilewithatagandcountdataincol2 | sort -n -k 1 &gt; hist&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4752216977467685894?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4752216977467685894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4752216977467685894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4752216977467685894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4752216977467685894'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/07/quick-and-dirty-histogram-in-awk.html' title='Quick and Dirty histogram in awk'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6543003108086285326</id><published>2010-07-30T07:56:00.001-07:00</published><updated>2010-07-30T07:56:36.974-07:00</updated><title type='text'>Print every other line of a file</title><content type='html'>cat blah | awk 'BEGIN{n=0}{if(n%2==0) print $0;n++;}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6543003108086285326?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6543003108086285326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6543003108086285326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6543003108086285326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6543003108086285326'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/07/print-every-other-line-of-file.html' title='Print every other line of a file'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1608770055530092333</id><published>2010-07-28T08:55:00.000-07:00</published><updated>2010-07-28T09:19:42.912-07:00</updated><title type='text'>Getting started with Cython on Centos 5.4 64Bit</title><content type='html'>Centos is a nightmare. OK so first up I wanted to do with with Python 2.6 for which there is no official Centos package. So get the geekymedia repos which has a version of Python 2.6 which will install along side the existing 2.4 (and can be access as python26) here: &lt;a href="http://www.geekymedia.com/tech-articles/rhel5-centos-5-python-2-62-rpms/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Then download the Cython tarball. Before you build Cython make sure you setup compile flags for 32bitness and make sure python 2.6 gets used i.e.&lt;br /&gt;&lt;br /&gt;export CFLAGS="-m32 -march=i386"&lt;br /&gt;export PYTHON="python26"&lt;br /&gt;&lt;br /&gt;then run python26 setup.py install in the Cython directory. I had to do some other hacking of -m32 and -march=i386 on to things, but I think doing it this way should work. That should build and install Cython.&lt;br /&gt;&lt;br /&gt;Put the following example in a file called demo.pyx:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;cdef extern from &amp;quot;math.h&amp;quot;:&lt;br /&gt;    double sin(double)&lt;br /&gt;&lt;br /&gt;cdef double f(double x):&lt;br /&gt;    return sin(x)&lt;br /&gt;&lt;br /&gt;print f(2.0)&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then make the following Makefile. Make sure you have tabs!&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;demo: demo.pyx&lt;br /&gt;        cython demo.pyx --embed&lt;br /&gt;        gcc -g -pthread -m32 -march=i386 demo.c -L/usr/lib -lm -lpython2.6 -o ./demo -I/usr/include/python2.6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then just type make and it should build a binary called demo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1608770055530092333?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1608770055530092333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1608770055530092333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1608770055530092333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1608770055530092333'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/07/getting-started-with-cython-on-centos.html' title='Getting started with Cython on Centos 5.4 64Bit'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4631851212781405842</id><published>2010-06-14T03:12:00.000-07:00</published><updated>2010-06-14T03:22:57.546-07:00</updated><title type='text'>Digital Archaeology Tags</title><content type='html'>It's fairly clear that in the future archaeology will move in to the digital domain with researchers digging through hard discs, USB keys, floppy discs, tapes, EEPROMs etc. I've often though it would be nice to drop them a message every so often, or just leave a note apologizing for my appalling spelling and grammar. So I suggest the following tags, to be encoded in 8bit ASCII when possible:&lt;br /&gt;&lt;br /&gt;DIGIARCHNOTESTART&lt;br /&gt;&lt;br /&gt;DIGIARCHNOTEEND&lt;br /&gt;&lt;br /&gt;Dear future archaeologists, I shall use this in my documents from now on when I want to give you some background, point you in the direction of more information, or just say Hi, so grep away!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4631851212781405842?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4631851212781405842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4631851212781405842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4631851212781405842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4631851212781405842'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/06/digital-archaeology-tags.html' title='Digital Archaeology Tags'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6193979813149082923</id><published>2010-06-02T08:41:00.000-07:00</published><updated>2010-06-02T08:43:09.682-07:00</updated><title type='text'>Grab all hrefs from a html page which have text containing View associated with them</title><content type='html'>Quick and dirty perl program to grab all links from a webpage which have have anchors with the text "View" in them:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use constant false =&amp;gt; 0;&lt;br /&gt;use constant true  =&amp;gt; 1;&lt;br /&gt;&lt;br /&gt;use HTML::TreeBuilder;&lt;br /&gt;use HTML::FormatText;&lt;br /&gt;&lt;br /&gt;$html = HTML::TreeBuilder-&amp;gt;new();&lt;br /&gt;$html-&amp;gt;parse_file($ARGV[0]);&lt;br /&gt;&lt;br /&gt;my @stuff = $html-&amp;gt;look_down( '_tag' , 'a' );&lt;br /&gt;&lt;br /&gt;my $seqtag = &amp;quot;&amp;quot;;&lt;br /&gt;my $use_next = false;&lt;br /&gt;&lt;br /&gt;for my $i (@stuff) {&lt;br /&gt;  my @thing = $i-&amp;gt;content();&lt;br /&gt;  my $target = $i-&amp;gt;attr('href');&lt;br /&gt;  my $str = $thing[0][0];&lt;br /&gt;&lt;br /&gt;  # string contains View&lt;br /&gt;  if($str =~ m/View/) {&lt;br /&gt;    print $target . &amp;quot;\n&amp;quot;;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6193979813149082923?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6193979813149082923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6193979813149082923' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6193979813149082923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6193979813149082923'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/06/grab-all-hrefs-from-html-page-which.html' title='Grab all hrefs from a html page which have text containing View associated with them'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2092959020453747627</id><published>2010-05-04T07:03:00.000-07:00</published><updated>2010-05-04T07:06:05.800-07:00</updated><title type='text'>samtools, bam cigar to string cigar</title><content type='html'>This code fragment converts a bam style binary cigar string in to a normal cigar string. &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;    CigarLen = b-&amp;gt;core.n_cigar;  // Cigar length&lt;br /&gt;    uint32_t *cigar    = bam1_cigar(b);&lt;br /&gt;&lt;br /&gt;    Cigar.clear();&lt;br /&gt;    for(size_t n=0;n&amp;lt;cigar_len;n++) {&lt;br /&gt;      uint32_t opcode = cigar[n] &amp;amp; 0x0000000F;&lt;br /&gt;      uint32_t len    = cigar[n] &amp;amp; 0xFFFFFFF0;&lt;br /&gt;&lt;br /&gt;      len = len &amp;gt;&amp;gt; 4;&lt;br /&gt;&lt;br /&gt;      if(opcode == 0)  { Cigar += stringify(len); Cigar += &amp;quot;M&amp;quot;; }&lt;br /&gt;      if(opcode == 1)  { Cigar += stringify(len); Cigar += &amp;quot;I&amp;quot;; }&lt;br /&gt;      if(opcode == 2)  { Cigar += stringify(len); Cigar += &amp;quot;D&amp;quot;; }&lt;br /&gt;      if(opcode == 3)  { Cigar += stringify(len); Cigar += &amp;quot;N&amp;quot;; }&lt;br /&gt;      if(opcode == 4)  { Cigar += stringify(len); Cigar += &amp;quot;S&amp;quot;; }&lt;br /&gt;      if(opcode == 5)  { Cigar += stringify(len); Cigar += &amp;quot;H&amp;quot;; }&lt;br /&gt;      if(opcode == 6)  { Cigar += stringify(len); Cigar += &amp;quot;P&amp;quot;; }&lt;br /&gt;      if(opcode == 7)  { Cigar += stringify(len); Cigar += &amp;quot;a&amp;quot;; }&lt;br /&gt;      if(opcode == 8)  { Cigar += stringify(len); Cigar += &amp;quot;b&amp;quot;; }&lt;br /&gt;      if(opcode == 9)  { Cigar += stringify(len); Cigar += &amp;quot;c&amp;quot;; }&lt;br /&gt;      if(opcode == 10) { Cigar += stringify(len); Cigar += &amp;quot;d&amp;quot;; }&lt;br /&gt;      if(opcode == 11) { Cigar += stringify(len); Cigar += &amp;quot;e&amp;quot;; }&lt;br /&gt;      if(opcode == 12) { Cigar += stringify(len); Cigar += &amp;quot;f&amp;quot;; }&lt;br /&gt;      if(opcode == 13) { Cigar += stringify(len); Cigar += &amp;quot;g&amp;quot;; }&lt;br /&gt;      if(opcode == 14) { Cigar += stringify(len); Cigar += &amp;quot;h&amp;quot;; }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2092959020453747627?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2092959020453747627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2092959020453747627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2092959020453747627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2092959020453747627'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/05/samtools-bam-cigar-to-string-cigar.html' title='samtools, bam cigar to string cigar'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2472209326642420101</id><published>2010-04-21T08:35:00.001-07:00</published><updated>2010-04-21T15:29:54.700-07:00</updated><title type='text'>string to int conversion</title><content type='html'>I was recently asked to write a string to int conversion function (without using library functions). I initially came up with a solution using the pow function (which is quite expensive). I had a think about it and found there were a surprising number of solutions. Briefly I came up with the following methods:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;TABLE BORDER=1 CELLPADDING=1&gt;&lt;TR&gt; &lt;TD&gt;Method&lt;/TD&gt; &lt;TD&gt;Summary&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Pow&lt;/TD&gt; &lt;TD&gt;my initial pow based solution (after converting a position to an in calculating 10^val)&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Mul&lt;/TD&gt; &lt;TD&gt;Rather than using pow generating powers of 10 in the loop (multiplier = multipler*10)&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Table&lt;/TD&gt;&lt;TD&gt;Just use a lookup table for the multipliers&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Case&lt;/TD&gt; &lt;TD&gt;More of less the same as table, but encode the table in a switch statement (very ugly!)&lt;/TD&gt; &lt;/TR&gt;&lt;/TABLE&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Results are probably compiler/CPU/platform dependent. But on my Atom Z530 (1.6GHz) based netbook using GCC 4.3.3 I obtained the following results when performing the conversion 10 million times:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;TABLE BORDER=1 CELLPADDING=1&gt;&lt;TR&gt; &lt;TD&gt;Method&lt;/TD&gt; &lt;TD&gt;User time&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Pow&lt;/TD&gt; &lt;TD&gt;43.67s&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Mul&lt;/TD&gt; &lt;TD&gt;28.21s&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Table&lt;/TD&gt; &lt;TD&gt;28.22s&lt;/TD&gt; &lt;/TR&gt;&lt;TR&gt; &lt;TD&gt;Case&lt;/TD&gt; &lt;TD&gt;29.13s&lt;/TD&gt; &lt;/TR&gt;&lt;/TABLE&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;There's a big difference between the pow method and the others, but I was reasonably surprised that multiplier and table based methods performed similarly. It would be interesting to look at the assembler generated for these.&lt;br /&gt;&lt;br /&gt;For reference, source code follows (note I sum and output the converted values to prevent the call to string_to_int from being optimised away). I was slightly concerned that something funky /might/ be going on in string::size() however benchmarked with this in and outside the loop and didn't observe any difference. Note: Following programs don't process signs, but in terms of benchmarking I don't believe this should be relevant. &lt;br /&gt;&lt;br /&gt;Pow:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int string_to_int(string s) {&lt;br /&gt;&lt;br /&gt;  int output=0;&lt;br /&gt;&lt;br /&gt;  for(int n=0;n&amp;lt;s.size();n++) {&lt;br /&gt;    int cval = s[n]-'0';&lt;br /&gt;    output += cval*pow(10,s.size()-n-1);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return output;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  // Simple tests&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;1 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;1&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;10 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;10&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;14532 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;14532&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  int rsum=0;&lt;br /&gt;  for(int i=0;i&amp;lt;10000000;i++) {&lt;br /&gt;    string s;&lt;br /&gt;    int numlen = rand()%11;&lt;br /&gt;    for(int n=0;n&amp;lt;numlen;n++) {&lt;br /&gt;      int rval;&lt;br /&gt;      if((numlen==10) &amp;amp;&amp;amp; (n==0)) { rval = rand()%2;  }&lt;br /&gt;                           else  { rval = rand()%10; }&lt;br /&gt;      s.push_back('0'+rval);&lt;br /&gt;    }&lt;br /&gt;    int v = string_to_int(s);&lt;br /&gt;    rsum += v;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; rsum &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Mul:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int string_to_int(string s) {&lt;br /&gt;&lt;br /&gt;  int output=0;&lt;br /&gt;&lt;br /&gt;  int mul=1;&lt;br /&gt;  for(int n=s.size()-1;n&amp;gt;=0;n--) {&lt;br /&gt;    int cval = s[n]-'0';&lt;br /&gt;    output += cval*mul;&lt;br /&gt;    mul = mul * 10;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return output;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  // Simple tests&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;1 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;1&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;10 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;10&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;14532 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;14532&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  int rsum=0;&lt;br /&gt;  for(int i=0;i&amp;lt;10000000;i++) {&lt;br /&gt;    string s;&lt;br /&gt;    int numlen = rand()%11;&lt;br /&gt;    for(int n=0;n&amp;lt;numlen;n++) {&lt;br /&gt;      int rval;&lt;br /&gt;      if((numlen==10) &amp;amp;&amp;amp; (n==0)) { rval = rand()%2;  }&lt;br /&gt;                           else  { rval = rand()%10; }&lt;br /&gt;      s.push_back('0'+rval);&lt;br /&gt;    }&lt;br /&gt;    int v = string_to_int(s);&lt;br /&gt;    rsum += v;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; rsum &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Table:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;const int powtable [] = { 1,&lt;br /&gt;                          10,&lt;br /&gt;                          100,&lt;br /&gt;                          1000,&lt;br /&gt;                          10000,&lt;br /&gt;                          100000,&lt;br /&gt;                          1000000,&lt;br /&gt;                          10000000,&lt;br /&gt;                          100000000,&lt;br /&gt;                          1000000000&lt;br /&gt;                        };&lt;br /&gt;&lt;br /&gt;int string_to_int(string s) {&lt;br /&gt;&lt;br /&gt;  int output=0;&lt;br /&gt;&lt;br /&gt;  for(int n=s.size()-1;n&amp;gt;=0;n--) {&lt;br /&gt;    int cval = s[n]-'0';&lt;br /&gt;    output += cval*(powtable[s.size()-n-1]);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return output;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  // Simple tests&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;1 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;1&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;10 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;10&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;14532 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;14532&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  int rsum=0;&lt;br /&gt;  for(int i=0;i&amp;lt;10000000;i++) {&lt;br /&gt;    string s;&lt;br /&gt;    int numlen = rand()%11;&lt;br /&gt;    for(int n=0;n&amp;lt;numlen;n++) {&lt;br /&gt;      int rval;&lt;br /&gt;      if((numlen==10) &amp;amp;&amp;amp; (n==0)) { rval = rand()%2;  }&lt;br /&gt;                           else  { rval = rand()%10; }&lt;br /&gt;      s.push_back('0'+rval);&lt;br /&gt;    }&lt;br /&gt;    int v = string_to_int(s);&lt;br /&gt;    rsum += v;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; rsum &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Case:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int string_to_int(string s) {&lt;br /&gt;&lt;br /&gt;  int output=0;&lt;br /&gt;&lt;br /&gt;  int pos=0;&lt;br /&gt;  for(int n=s.size()-1;n&amp;gt;=0;n--) {&lt;br /&gt;    int cval = s[n]-'0';&lt;br /&gt;&lt;br /&gt;    switch(pos) {&lt;br /&gt;      case 0:&lt;br /&gt;        output += cval*1;&lt;br /&gt;        break;&lt;br /&gt;      case 1:&lt;br /&gt;        output += cval*10;&lt;br /&gt;        break;&lt;br /&gt;      case 2:&lt;br /&gt;        output += cval*100;&lt;br /&gt;        break;&lt;br /&gt;      case 3:&lt;br /&gt;        output += cval*1000;&lt;br /&gt;        break;&lt;br /&gt;      case 4:&lt;br /&gt;        output += cval*10000;&lt;br /&gt;        break;&lt;br /&gt;      case 5:&lt;br /&gt;        output += cval*100000;&lt;br /&gt;        break;&lt;br /&gt;      case 6:&lt;br /&gt;        output += cval*1000000;&lt;br /&gt;        break;&lt;br /&gt;      case 7:&lt;br /&gt;        output += cval*10000000;&lt;br /&gt;        break;&lt;br /&gt;      case 9:&lt;br /&gt;        output += cval*100000000;&lt;br /&gt;        break;&lt;br /&gt;      case 10:&lt;br /&gt;        output += cval*1000000000;&lt;br /&gt;        break;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    pos++;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return output;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  // Simple tests&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;1 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;1&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;10 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;10&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;14532 is: &amp;quot; &amp;lt;&amp;lt; string_to_int(&amp;quot;14532&amp;quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  int rsum=0;&lt;br /&gt;  for(int i=0;i&amp;lt;10000000;i++) {&lt;br /&gt;    string s;&lt;br /&gt;    int numlen = rand()%11;&lt;br /&gt;    for(int n=0;n&amp;lt;numlen;n++) {&lt;br /&gt;      int rval;&lt;br /&gt;      if((numlen==10) &amp;amp;&amp;amp; (n==0)) { rval = rand()%2;  }&lt;br /&gt;                           else  { rval = rand()%10; }&lt;br /&gt;      s.push_back('0'+rval);&lt;br /&gt;    }&lt;br /&gt;    int v = string_to_int(s);&lt;br /&gt;    rsum += v;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; rsum &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2472209326642420101?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2472209326642420101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2472209326642420101' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2472209326642420101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2472209326642420101'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/04/string-to-int-conversion.html' title='string to int conversion'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2043640206967714771</id><published>2010-04-20T05:29:00.000-07:00</published><updated>2010-04-20T06:28:57.892-07:00</updated><title type='text'>Floating point precision</title><content type='html'>I was recently asked a question about the precision of floating point numbers. As most people know the representation used by most computers to store real numbers does not have continuous precision across the number line.&lt;br /&gt;&lt;br /&gt;I thought it would be interesting therefore to plot the density of numbers across the number line. This is a nice illustration of the fact that numbers near 0 have higher precision that large numbers. The following plots are for 32bit floats (this was on a 64bit Snow Leopard Mac):&lt;br /&gt;&lt;br /&gt;&lt;img src="http://sgenomics.org/mediawiki/upload/0/0e/Range200.png" /&gt;&lt;br /&gt;&lt;img src="http://sgenomics.org/mediawiki/upload/d/d2/Range5000.png" /&gt;&lt;br /&gt;&lt;br /&gt;The following code was used to generate the data, which was plotted with Gnuplot:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;limits&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  //float smallest = 0.00000000000000000000001;&lt;br /&gt;  float smallest = 0.00000001;&lt;br /&gt;&lt;br /&gt;  float block_size = 10;&lt;br /&gt;  for(float range_start=-100000;range_start&amp;lt;100000;range_start+=block_size) {&lt;br /&gt;    float range_end = range_start+block_size;&lt;br /&gt;&lt;br /&gt;    size_t different_n=0;&lt;br /&gt;    float n;&lt;br /&gt;    for(float n=range_start;n&amp;lt;range_end;) {&lt;br /&gt;&lt;br /&gt;      float new_n=n;&lt;br /&gt;      for(float i=1;new_n &amp;lt;= n;i++) {&lt;br /&gt;        new_n = n + (smallest*i);&lt;br /&gt;      }&lt;br /&gt;      n = new_n;&lt;br /&gt;      different_n++;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; range_start+((range_end-range_start)/2) &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; different_n &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2043640206967714771?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2043640206967714771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2043640206967714771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2043640206967714771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2043640206967714771'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/04/floating-point-precision.html' title='Floating point precision'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4706216178884640228</id><published>2010-03-30T04:45:00.001-07:00</published><updated>2010-06-26T15:50:38.138-07:00</updated><title type='text'>mpt2sas raid card from Dell r710 driver installation with Centos 5.3</title><content type='html'>The REDACTED at Dell don't support Centos 5.3 on r610s raid card (Dell H200). I seriously REDRACTED hate propriety drivers and it's going to be a constant nightmare as we change kernel versions, but whatever. The problem is basically that the drivers are signed for Redhat Enterprise and Centos doesn't like that. So you have to crack open the driver package and remove the signing. A fixed package is available here: &lt;a href="http://sgenomics.org/mediawiki/images/7/71/Mpt2sas-02.00.00.00-3-rhel5.3.i686-nav.img"&gt;i686&lt;/a&gt; &lt;a href="http://sgenomics.org/mediawiki/images/c/cc/Mpt2sas-02.00.00.00-3-rhel5.3.x86_64-nav.img"&gt;x86_64&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I robbed most of the instructions to do this from here:&lt;br /&gt;&lt;br /&gt;http://centos.org/modules/newbb/viewtopic.php?topic_id=22284&amp;amp;forum=37&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4706216178884640228?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4706216178884640228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4706216178884640228' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4706216178884640228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4706216178884640228'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/mpt2sas-raid-card-from-dell-r710-driver.html' title='mpt2sas raid card from Dell r710 driver installation with Centos 5.3'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7929034964444874722</id><published>2010-03-25T04:35:00.000-07:00</published><updated>2010-03-25T04:38:03.636-07:00</updated><title type='text'>Replace all instance of string with an incrementing number</title><content type='html'>Perl solution with thanks to &lt;A HREF="http://psyphi.net/blog/"&gt;rmp&lt;/A&gt;. In this case replace all instances of MAGIC in the file small.sam:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;cat small.sam &amp;#124; perl -pe 's/MAGIC/$c++/eg'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7929034964444874722?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7929034964444874722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7929034964444874722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7929034964444874722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7929034964444874722'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/replace-all-instance-of-string-with.html' title='Replace all instance of string with an incrementing number'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1613836903894021894</id><published>2010-03-21T11:08:00.001-07:00</published><updated>2010-03-21T11:11:27.880-07:00</updated><title type='text'>Pausing/Suspending a running process</title><content type='html'>I had a couple of analysis jobs running they appeared to be stepping all over each other, with both jobs trashing a lot. I wanted to suspend one of the jobs to allow the other to continue in peace. You can do this using kill:&lt;br /&gt;&lt;br /&gt;kill -STOP processid&lt;br /&gt;&lt;br /&gt;and to continue it later:&lt;br /&gt;&lt;br /&gt;kill -CONT processid&lt;br /&gt;&lt;br /&gt;Found here:&lt;br /&gt;&lt;br /&gt;http://linuxpoison.blogspot.com/2007/11/temporarily-suspend-process.html&lt;/processid&gt;&lt;/processid&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1613836903894021894?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1613836903894021894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1613836903894021894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1613836903894021894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1613836903894021894'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/pausingsuspending-running-process.html' title='Pausing/Suspending a running process'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-129936966901584022</id><published>2010-03-17T09:33:00.000-07:00</published><updated>2011-09-28T13:06:26.401-07:00</updated><title type='text'>Very simple OpenCL example</title><content type='html'>&lt;h1&gt;This blog post has been moved &lt;a href="http://41j.com/blog/?p=218"&gt;HERE&lt;/a&gt;&lt;/h1&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-129936966901584022?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/129936966901584022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=129936966901584022' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/129936966901584022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/129936966901584022'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/very-simple-opencl-example.html' title='Very simple OpenCL example'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5375895879443967248</id><published>2010-03-17T04:41:00.000-07:00</published><updated>2010-03-17T04:42:37.117-07:00</updated><title type='text'>netcat one line webserver</title><content type='html'>Modified from the wikipedia article. Sets up a webserver on the local box (using only the netcat command) and serves a single file (called myfile) to all clients.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;while true;do ( echo -e &amp;quot;HTTP/1.0 200 Ok\n\r&amp;quot;; cat myfile; ) &amp;#124; nc -l 8080 ;done&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5375895879443967248?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5375895879443967248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5375895879443967248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5375895879443967248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5375895879443967248'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/netcat-one-line-webserver.html' title='netcat one line webserver'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3472447463721086572</id><published>2010-03-03T07:42:00.000-08:00</published><updated>2010-03-03T07:43:33.836-08:00</updated><title type='text'>Samtools C example</title><content type='html'>A simple samtools C api example. This program reads the bam file provided in the first argument and dumps the contents:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;   &lt;br /&gt;#include &amp;quot;bam.h&amp;quot;&lt;br /&gt;#include &amp;quot;sam.h&amp;quot;&lt;br /&gt; &lt;br /&gt;int main(int argc, char *argv[]) {&lt;br /&gt; &lt;br /&gt;  samfile_t *fp_in = NULL;&lt;br /&gt;  bam1_t *b=NULL;&lt;br /&gt;&lt;br /&gt;  fp_in = samopen(argv[1], &amp;quot;rb&amp;quot;, 0);&lt;br /&gt;&lt;br /&gt;  if(NULL == fp_in) {&lt;br /&gt;     printf(&amp;quot;Could not open file\n&amp;quot;);&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  b = bam_init1();&lt;br /&gt;  int pos=0;&lt;br /&gt;  int lastpos=0;&lt;br /&gt;&lt;br /&gt;  while(samread(fp_in, b) &amp;gt; 0) {&lt;br /&gt;    lastpos = pos;&lt;br /&gt;    pos = b-&amp;gt;core.pos;&lt;br /&gt;         &lt;br /&gt;    if(pos != lastpos) {&lt;br /&gt;      printf(&amp;quot;tid  : %d\n&amp;quot;,b-&amp;gt;core.tid);&lt;br /&gt;      printf(&amp;quot;pos  : %d\n&amp;quot;,b-&amp;gt;core.pos);&lt;br /&gt;      char *name  = bam1_qname(b);&lt;br /&gt;      char *qual  = bam1_qual(b);&lt;br /&gt;&lt;br /&gt;      int n=0;&lt;br /&gt;      char *qseq = (char *) malloc(b-&amp;gt;core.l_qseq+1);&lt;br /&gt;      char *s   = bam1_seq(b);&lt;br /&gt;      for(n=0;n&amp;lt;(b-&amp;gt;core.l_qseq);n++) {&lt;br /&gt;        char v = bam1_seqi(s,n);&lt;br /&gt;        qseq[n] = bam_nt16_rev_table[v];&lt;br /&gt;      }&lt;br /&gt;      qseq[n] = 0;&lt;br /&gt;&lt;br /&gt;      printf(&amp;quot;name : %s\n&amp;quot;,name);&lt;br /&gt;      printf(&amp;quot;qseq : %s\n&amp;quot;,qseq);&lt;br /&gt;      //printf(&amp;quot;s cigar: %s\n&amp;quot;,cigar);&lt;br /&gt;&lt;br /&gt;      printf(&amp;quot;qual :&amp;quot;);&lt;br /&gt;      for(n=0;n&amp;lt;(b-&amp;gt;core.l_qseq);n++) {&lt;br /&gt;        printf(&amp;quot; %d&amp;quot;,qual[n]);&lt;br /&gt;      }&lt;br /&gt;      printf(&amp;quot;\n&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;    bam_destroy1(b);&lt;br /&gt;    b = bam_init1();&lt;br /&gt;  }&lt;br /&gt;  bam_destroy1(b);&lt;br /&gt;&lt;br /&gt;  samclose(fp_in);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3472447463721086572?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3472447463721086572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3472447463721086572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3472447463721086572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3472447463721086572'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/samtools-c-example.html' title='Samtools C example'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5628628293715798054</id><published>2010-03-01T06:34:00.000-08:00</published><updated>2010-03-01T06:36:25.961-08:00</updated><title type='text'>Print contents of all files prefixing lines with filename</title><content type='html'>Print contents of all files (in this case all files starting with features.2d_table.* but not ending with png) prefixing the lines of the file with the filename:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;find . -name &amp;quot;features.2d_table.*&amp;quot; &amp;#124; grep -v png &amp;#124; xargs  awk '{print substr(FILENAME,3) &amp;quot; &amp;quot; $0}' &amp;gt; bigtable&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5628628293715798054?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5628628293715798054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5628628293715798054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5628628293715798054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5628628293715798054'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/03/print-contents-of-all-files-prefixing.html' title='Print contents of all files prefixing lines with filename'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7999145344037788977</id><published>2010-02-24T01:47:00.000-08:00</published><updated>2010-02-24T01:48:04.090-08:00</updated><title type='text'>Change underscores in filenames to dots on a whole directory</title><content type='html'>Change underscores in filenames to dots on a whole directory:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;for i in *;do mv $i `echo $i &amp;#124; sed -e 's/_/./g'`; done&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7999145344037788977?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7999145344037788977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7999145344037788977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7999145344037788977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7999145344037788977'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/change-underscores-in-filenames-to-dots.html' title='Change underscores in filenames to dots on a whole directory'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5422283971720688574</id><published>2010-02-19T16:08:00.000-08:00</published><updated>2011-09-30T16:23:12.633-07:00</updated><title type='text'>Simple SDL example in C++</title><content type='html'>&lt;h1&gt;This blog post has moved &lt;a href="http://41j.com/blog/2011/09/simple-sdl-example-in-c/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5422283971720688574?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5422283971720688574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5422283971720688574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5422283971720688574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5422283971720688574'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/simple-sdl-example-in-c.html' title='Simple SDL example in C++'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1081708367217898100</id><published>2010-02-16T05:45:00.001-08:00</published><updated>2010-02-16T05:47:37.658-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='cli'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>Find and delete</title><content type='html'>Someone didn't appreciate the existence of queueing systems like PBS and rolled their own queueing system that is supposed to take care of removing dead jobs from an app server. So I had to look for the old files that were causing the problem and see if I could delete them. Thankfully this is really easy with a simple find command.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt; find ./ -type f -mtime +10 &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Switching the -type to d will do the same for directories. Unfortunately there is no clever hack for beating people who do this kind of thing over the internet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1081708367217898100?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1081708367217898100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1081708367217898100' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1081708367217898100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1081708367217898100'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/find-and-delete.html' title='Find and delete'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6940001606112361490</id><published>2010-02-13T17:51:00.000-08:00</published><updated>2010-02-14T14:16:12.774-08:00</updated><title type='text'>n900 gnu screen in debian delete key doesn't work</title><content type='html'>See title. Seems to be a long standing bug in the upstream Debian package or something: https://bugs.maemo.org/show_bug.cgi?id=3071 . Here's my complete screenrc which also fixes a problem with the enter key in vim and changes the default escape key of screen from ctrl-A to ctrl-B put this in ~/.screenrc&lt;br /&gt;&lt;br /&gt;bindkey -a -k fe stuff ^M&lt;br /&gt;bindkey -d ^@ stuff ^?&lt;br /&gt;escape ^Bb&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6940001606112361490?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6940001606112361490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6940001606112361490' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6940001606112361490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6940001606112361490'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/n900-gnu-screen-in-debian-delete-key.html' title='n900 gnu screen in debian delete key doesn&apos;t work'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3707634669586520678</id><published>2010-02-05T11:45:00.000-08:00</published><updated>2010-02-05T11:47:27.392-08:00</updated><title type='text'>CppUnit disable exception handing</title><content type='html'>By default C++ unit catches exceptions, this can make debugging a lot harder (as it often doesn't give you much information about the exception that was thrown or which line number it was thrown on). To disable the exception catching you need to remove the default protector:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;// Normal test runner&lt;br /&gt;CppUnit::TextUi::TestRunner runner;&lt;br /&gt;&lt;br /&gt;// disable exceptions&lt;br /&gt;runner.eventManager().popProtector();&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3707634669586520678?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3707634669586520678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3707634669586520678' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3707634669586520678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3707634669586520678'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/cppunit-disable-exception-handing.html' title='CppUnit disable exception handing'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6710797017773101897</id><published>2010-02-03T07:43:00.000-08:00</published><updated>2010-02-03T11:00:28.310-08:00</updated><title type='text'>Saving a process running in the foreground</title><content type='html'>From here:&lt;br /&gt;&lt;br /&gt;http://nickloman.wordpress.com/2010/02/03/saving-a-process-running-in-the-foreground/&lt;br /&gt;&lt;br /&gt;Basically:&lt;br /&gt;&lt;br /&gt;ctrl-Z&lt;br /&gt;bg&lt;br /&gt;disown –h PID&lt;br /&gt;&lt;br /&gt;neat!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6710797017773101897?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6710797017773101897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6710797017773101897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6710797017773101897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6710797017773101897'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/02/saving-process-running-in-foreground.html' title='Saving a process running in the foreground'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3943642052894096746</id><published>2010-01-29T03:27:00.000-08:00</published><updated>2010-01-29T03:28:54.083-08:00</updated><title type='text'>count all files matching some weird spec and piping though grep and stuff</title><content type='html'>You could probably do all this with find, but piping though grep a) makes me happy and is exciting b) is a bit more flexible:&lt;br /&gt;&lt;br /&gt;find . -atime +30 | grep somethinginfilename | xargs ls -l | awk '{print $5}' | awk 'BEGIN{n=0}{n += $1}END{print n/1024/1024/1024}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3943642052894096746?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3943642052894096746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3943642052894096746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3943642052894096746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3943642052894096746'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/count-all-files-matching-some-weird.html' title='count all files matching some weird spec and piping though grep and stuff'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2454821719826031995</id><published>2010-01-26T05:44:00.000-08:00</published><updated>2010-01-27T04:29:20.106-08:00</updated><title type='text'>Switching from tcsh to bash when you can't change your shell in /etc/passwd or whereever...</title><content type='html'>Just add bash to your tcsh startup script. Edit ~/.cshrc and at the end add a single line saying: bash&lt;br /&gt;&lt;br /&gt;When you exit you'll still have to exit twice if you do this a better option might be:&lt;br /&gt;&lt;br /&gt;exec bash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2454821719826031995?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2454821719826031995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2454821719826031995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2454821719826031995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2454821719826031995'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/switching-from-tcsh-to-bash-when-you.html' title='Switching from tcsh to bash when you can&apos;t change your shell in /etc/passwd or whereever...'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7658124655543173937</id><published>2010-01-17T04:14:00.000-08:00</published><updated>2010-01-17T04:27:14.369-08:00</updated><title type='text'>Using gnu screens tab like functionality</title><content type='html'>&lt;span style="font-family: courier new;font-family:courier new;" &gt;gnu screen is a cool tool, I normally use it for persisting shell sessions running over ssh when moving between workstations or sites. However screen also has tab like functionality which I've been looking at using after fire up screen and then use the follow to create and navigate between tabs:&lt;br /&gt;&lt;br /&gt;Ctrl+a c: create a window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a n: next window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a p: previous window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a ": list all windows&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a A: name a window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a k: close (kill) a window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ctrl+a number: jump to a window&lt;br /&gt;&lt;br /&gt;What's even better is that screen has console based cut and paste! Here's how you use it:&lt;br /&gt;&lt;br /&gt;Ctrl+a [: enter copy mode (scrollback)&lt;br /&gt;&lt;br /&gt;In copy mode, you can use the cursor keys (or vi navigation keys if you like) to move around. Press space to begin a selection and space again to end it.&lt;br /&gt;&lt;br /&gt;Ctrl+a ]: paste text from buffer.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7658124655543173937?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7658124655543173937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7658124655543173937' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7658124655543173937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7658124655543173937'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/using-gnu-screens-tab-like.html' title='Using gnu screens tab like functionality'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8390651108117400286</id><published>2010-01-15T05:01:00.000-08:00</published><updated>2011-09-30T16:04:03.050-07:00</updated><title type='text'>mplayer recursive play all files in directory</title><content type='html'>&lt;h1&gt;This blog post has moved &lt;a href="http://41j.com/blog/2011/09/mplayer-recursive-play-all-files-in-directory/"&gt;HERE&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8390651108117400286?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8390651108117400286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8390651108117400286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8390651108117400286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8390651108117400286'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/mplayer-recursive-play-all-files-in.html' title='mplayer recursive play all files in directory'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6574276321822456521</id><published>2010-01-07T03:14:00.000-08:00</published><updated>2010-01-07T03:15:15.842-08:00</updated><title type='text'>Simple python parallelisation example</title><content type='html'>&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#!/usr/bin/python&lt;br /&gt;&lt;br /&gt;import pp&lt;br /&gt;&lt;br /&gt;def add_one(n):&lt;br /&gt;  return n+1&lt;br /&gt;&lt;br /&gt;job_server = pp.Server()&lt;br /&gt;&lt;br /&gt;args1 = (1,)&lt;br /&gt;args2 = (2,)&lt;br /&gt;args3 = (3,)&lt;br /&gt;&lt;br /&gt;f1 = job_server.submit(add_one, args1)&lt;br /&gt;f2 = job_server.submit(add_one, args2)&lt;br /&gt;f3 = job_server.submit(add_one, args3)&lt;br /&gt;&lt;br /&gt;r1 = f1()&lt;br /&gt;r2 = f2()&lt;br /&gt;r3 = f3()&lt;br /&gt;&lt;br /&gt;print &amp;quot;r1 is &amp;quot; + str(r1)&lt;br /&gt;print &amp;quot;r2 is &amp;quot; + str(r2)&lt;br /&gt;print &amp;quot;r3 is &amp;quot; + str(r3)&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6574276321822456521?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6574276321822456521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6574276321822456521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6574276321822456521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6574276321822456521'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/simple-python-parallelisation-example.html' title='Simple python parallelisation example'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6015741392351529728</id><published>2010-01-02T09:00:00.000-08:00</published><updated>2010-01-02T09:03:38.146-08:00</updated><title type='text'>Annotating a Proxmark 3 mifare classic trace</title><content type='html'>Proxmark 3s hi14areader command seems to initialise a card and send a request for block 0 using key A. It does this repeatedly a few times. I've annotated a trace from a mifare classic card.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt; +      0:    :     52                                    # No idea, part of anti-collision from Koning thesis...&lt;br /&gt; +     68:   0: TAG 04  00                                # No idea, part of anti-collision from Koning thesis...&lt;br /&gt; +    -68:    :     93  20                                # Card UID request (READER)&lt;br /&gt; +    136:   0: TAG eb  5c  96  69  48                    # Card UID&lt;br /&gt; +   -136:    :     93  70  eb  5c  96  69  48  15  d4    # 93 70 followed by UID, followed by 2 CRC bytes (READER)&lt;br /&gt; +    212:   0: TAG 08  b6  dd                            # No idea, part of anti-collision from Koning thesis...&lt;br /&gt; +   -212:    :     60  00  f5  7b                        # Authentication request. 60 means auth with key A. (61 means key B). Use block 00. Last 2 bytes CRC (READER)&lt;br /&gt; +    337:   0: TAG a0  f4  b9  78                        # No idea                      *  mifarecrack tries to parse data from here 1&lt;br /&gt; +   -337:    :     52                                    # No idea - All starts again!  *  mifarecrack tries to parse data from here 2&lt;br /&gt; +      0:    :     52                                    # No idea                      *  mifarecrack tries to parse data from here 3&lt;br /&gt; +    405:   0: TAG 04  00                                # No idea&lt;br /&gt; +   -405:    :     93  20                                # Card UID request (READER)&lt;br /&gt; +    481:   0: TAG eb  5c  96  69  48                    # Card ID&lt;br /&gt; +   -481:    :     93  70  eb  5c  96  69  48  15  d4    # Reader sends UID again&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6015741392351529728?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6015741392351529728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6015741392351529728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6015741392351529728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6015741392351529728'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2010/01/annotating-proxmark-3-mifare-classic.html' title='Annotating a Proxmark 3 mifare classic trace'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7050080951000740335</id><published>2009-12-31T11:43:00.000-08:00</published><updated>2011-09-30T16:29:51.646-07:00</updated><title type='text'>Getting started with proxmark 3 (Proxmark III)</title><content type='html'>&lt;h1&gt;This blog post has moved &lt;a href="http://41j.com/blog/2011/09/getting-started-with-proxmark-3-proxmark-iii/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7050080951000740335?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7050080951000740335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7050080951000740335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7050080951000740335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7050080951000740335'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/12/getting-started-with-proxmark-3.html' title='Getting started with proxmark 3 (Proxmark III)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3803893398744700012</id><published>2009-12-04T05:57:00.000-08:00</published><updated>2009-12-04T06:55:53.813-08:00</updated><title type='text'>returning by reference faster than returning by value?</title><content type='html'>Is returning by reference faster than returning by value? It's always been my assumption that returning by value can in many cases be optimized away. However to test this assumption I wrote a couple of small tests:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;By value:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;vector&amp;lt;size_t&amp;gt; test() {&lt;br /&gt;  vector&amp;lt;size_t&amp;gt; t;&lt;br /&gt;&lt;br /&gt;  for(size_t n=0;n&amp;lt;100;n++) {&lt;br /&gt;    t.push_back(rand());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return t;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  size_t sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;10000000;n++){&lt;br /&gt;    vector&amp;lt;size_t&amp;gt; t = test();&lt;br /&gt;    for(size_t n=0;n&amp;lt;t.size();n++) {&lt;br /&gt;      sum = sum + t[n];&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; &lt;br /&gt;&lt;br /&gt;By reference:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void test(vector&amp;lt;size_t&amp;gt; &amp;amp;t) {&lt;br /&gt;  for(size_t n=0;n&amp;lt;100;n++) {&lt;br /&gt;    t.push_back(rand());&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  size_t sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;10000000;n++){&lt;br /&gt;    vector&amp;lt;size_t&amp;gt; t;&lt;br /&gt;    test(t);&lt;br /&gt;    for(size_t n=0;n&amp;lt;t.size();n++) {&lt;br /&gt;      sum = sum + t[n];&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here are my timings on an Intel Core2Duo:&lt;br /&gt;&lt;br /&gt;By value:&lt;br /&gt;real 0m34.122s&lt;br /&gt;user 0m33.219s&lt;br /&gt;sys 0m0.436s&lt;br /&gt;&lt;br /&gt;By reference:&lt;br /&gt;real 0m34.147s&lt;br /&gt;user 0m33.308s&lt;br /&gt;sys 0m0.512s&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So in this case the user times seem to be more or less the same. What's happening is the return value being optimized out as expected? Is there something else I should take in to account in my test?&lt;br /&gt;&lt;br /&gt;i686-apple-darwin10-g++-4.2.1 was used.&lt;br /&gt;&lt;br /&gt;http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/&lt;br /&gt;&lt;br /&gt;Also interesting comment on gcc mailing list:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Your subject isn't quite right.  It should be &amp;quot;Returning by reference faster than returning by value&amp;quot;.                                                                                                                                      &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;C++ has RVO (&amp;quot;return value optimization&amp;quot;).                                                                                                                                                                                                  &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;RVO is part of C++, just as the elide constructors is a part of C++.                                                                                                                                                                        &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;Also note:  you get RVO even if you are -O0.  It really is part of the C++ language, even for non-optimized compiling.                                                                                                                      &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;So your two tests as given should have the about the same performance, since the two tests are basically doing the same thing.  And, indeed, they do have about the same performance.  As expected.                                         &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;Read carefully the constraints upon when RVO can be applied.  (I don't have a URL handy.  You'll have to use your Google-fu, or read the ISO 14882 standard.)                                                                               &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;In situations where RVO cannot be applied, then for non-trivial data types, an output reference parameter will (likely) be faster.                                                                                                          &lt;br /&gt;                                                                                                                                                                                                                                            &lt;br /&gt;A lot of STL and Boost rely upon RVO for their template magic to be highly performant.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3803893398744700012?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3803893398744700012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3803893398744700012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3803893398744700012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3803893398744700012'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/12/returning-by-reference-faster-than.html' title='returning by reference faster than returning by value?'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3012225857176594249</id><published>2009-12-02T04:10:00.001-08:00</published><updated>2009-12-02T04:11:15.094-08:00</updated><title type='text'>Reverting an svn commit</title><content type='html'>To revert an svn commit do something like:&lt;br /&gt;&lt;br /&gt;svn merge -r 4552:4551 svn+ssh://svn/path_to_svn_location&lt;br /&gt;svn commit&lt;br /&gt;&lt;br /&gt;Where 4552 is the last commit and 4551 is the one before.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3012225857176594249?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3012225857176594249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3012225857176594249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3012225857176594249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3012225857176594249'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/12/reverting-svn-commit.html' title='Reverting an svn commit'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4984457375618903594</id><published>2009-12-01T05:58:00.000-08:00</published><updated>2009-12-01T06:00:12.456-08:00</updated><title type='text'>Simple quicksort implementation</title><content type='html'>A simple C++ quicksort implementation. This version is not in place and therefore requires O(n) extra space...&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;math.h&amp;quot;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;template&amp;lt;class value_type&amp;gt;&lt;br /&gt;void quick_sort(vector&amp;lt;value_type&amp;gt; &amp;amp;values,size_t start,size_t end,size_t pivot) {&lt;br /&gt;&lt;br /&gt;  vector&amp;lt;value_type&amp;gt; less;&lt;br /&gt;  vector&amp;lt;value_type&amp;gt; greater;&lt;br /&gt;&lt;br /&gt;  for(size_t n=start;n&amp;lt;end;n++) {&lt;br /&gt;    if(n != pivot)&lt;br /&gt;    if(values[n] &amp;lt; values[pivot]) {&lt;br /&gt;      less.push_back(values[n]);&lt;br /&gt;    } else {&lt;br /&gt;      greater.push_back(values[n]);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  value_type pivot_temp = values[pivot];&lt;br /&gt;  for(size_t n=0;n&amp;lt;less.size();n++) {&lt;br /&gt;    values[n+start] = less[n];&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  values[start+less.size()] = pivot_temp;&lt;br /&gt;&lt;br /&gt;  for(size_t n=0;n&amp;lt;greater.size();n++) {&lt;br /&gt;    values[n+start+less.size()+1] = greater[n];&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  if(less.size()    &amp;gt; 1) { quick_sort(values,start      ,start+less.size(),start+(less.size()/2)); }&lt;br /&gt;  if(greater.size() &amp;gt; 1) { quick_sort(values,less.size(),end              ,less.size()+(end/2)  ); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;  vector&amp;lt;size_t&amp;gt; values;&lt;br /&gt;&lt;br /&gt;  for(size_t n=0;n&amp;lt;10;n++) {&lt;br /&gt;    values.push_back(rand());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;start values...&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(size_t n=0;n&amp;lt;values.size();n++) {&lt;br /&gt;    cout &amp;lt;&amp;lt; &amp;quot;val[&amp;quot; &amp;lt;&amp;lt; n &amp;lt;&amp;lt; &amp;quot;]: &amp;quot; &amp;lt;&amp;lt; values[n] &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  quick_sort(values,0,values.size(),5);&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;sorted values...&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(size_t n=0;n&amp;lt;values.size();n++) {&lt;br /&gt;    cout &amp;lt;&amp;lt; values[n] &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4984457375618903594?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4984457375618903594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4984457375618903594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4984457375618903594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4984457375618903594'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/12/simple-quicksort-implementation.html' title='Simple quicksort implementation'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7991828212895512161</id><published>2009-11-24T12:40:00.000-08:00</published><updated>2009-11-24T12:44:43.440-08:00</updated><title type='text'>Templates v subclasses v.2</title><content type='html'>A slightly more complicated test similar to the previous post. In this case the templated version doesn't have such a huge advantage.&lt;br /&gt;&lt;br /&gt;Subclassed version:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class mybaseclass {&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    virtual int get_i() = 0;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class myclass : public mybaseclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    myclass(int in) {&lt;br /&gt;      i=in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      i++;&lt;br /&gt;      return i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class otherclass : public mybaseclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    otherclass(int in) {&lt;br /&gt;      i = in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      return i*i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  myclass *c = new myclass(2);&lt;br /&gt;&lt;br /&gt;  double sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;2000000000;n++) {&lt;br /&gt;&lt;br /&gt;    mybaseclass *cc = c;&lt;br /&gt;&lt;br /&gt;    sum += (static_cast&amp;lt;double&amp;gt;(cc-&amp;gt;get_i())/2.2);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;  delete c;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Templated version:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;template&amp;lt;class t&amp;gt;&lt;br /&gt;class myclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    myclass(int in) {&lt;br /&gt;      i=in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    inline int get_i() {&lt;br /&gt;      i++;&lt;br /&gt;      return i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;template&amp;lt;class t&amp;gt;&lt;br /&gt;class otherclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    otherclass(int in) {&lt;br /&gt;      i = in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    inline int get_i() {&lt;br /&gt;      return i*i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  myclass&amp;lt;int&amp;gt; *c = new myclass&amp;lt;int&amp;gt;(2);&lt;br /&gt;&lt;br /&gt;  double sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;2000000000;n++) {&lt;br /&gt;&lt;br /&gt;    sum += (static_cast&amp;lt;double&amp;gt;(c-&amp;gt;get_i())/2.2);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;  delete c;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;$ g++ small_classed.cpp -O3;time ./a.out &lt;br /&gt;9.09091e+17&lt;br /&gt;&lt;br /&gt;real 0m21.151s&lt;br /&gt;user 0m20.909s&lt;br /&gt;sys 0m0.072s&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ g++ small_templateclassed.cpp -O3;time ./a.out &lt;br /&gt;9.09091e+17&lt;br /&gt;&lt;br /&gt;real 0m20.736s&lt;br /&gt;user 0m20.527s&lt;br /&gt;sys 0m0.064s&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7991828212895512161?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7991828212895512161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7991828212895512161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7991828212895512161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7991828212895512161'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/templates-v-subclasses-v2.html' title='Templates v subclasses v.2'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7076216920730926925</id><published>2009-11-24T11:30:00.000-08:00</published><updated>2009-11-24T12:58:08.478-08:00</updated><title type='text'>Are templates faster than subclasses?</title><content type='html'>Are template classes faster than using a derived class? Intuition would tell me that the template class should be faster. However to test if this is the case I wrote the following small programs:&lt;br /&gt;&lt;br /&gt;Subclassed version:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class mybaseclass {&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    virtual int get_i() = 0;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class myclass : public mybaseclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    myclass(int in) {&lt;br /&gt;      i=in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      return i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class otherclass : public mybaseclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    otherclass(int in) {&lt;br /&gt;      i = in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      return i*i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  myclass *c = new myclass(2);&lt;br /&gt;  long int sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;2000000000;n++) {&lt;br /&gt;    mybaseclass *cc = c;&lt;br /&gt;&lt;br /&gt;    sum += cc-&amp;gt;get_i();&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;  delete c;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Templated version:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;template&amp;lt;class t&amp;gt;&lt;br /&gt;class myclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    myclass(int in) {&lt;br /&gt;      i=in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      return i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;template&amp;lt;class t&amp;gt;&lt;br /&gt;class otherclass {&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    otherclass(int in) {&lt;br /&gt;      i = in;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int get_i() {&lt;br /&gt;      return i*i;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  int i;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  myclass&amp;lt;int&amp;gt; *c = new myclass&amp;lt;int&amp;gt;(2);&lt;br /&gt;&lt;br /&gt;  long int sum=0;&lt;br /&gt;  for(size_t n=0;n&amp;lt;2000000000;n++) {&lt;br /&gt;&lt;br /&gt;    sum += c-&amp;gt;get_i();&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; sum &amp;lt;&amp;lt; endl;&lt;br /&gt;  delete c;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;$g++ small_templateclassed.cpp -O3;time ./a.out &lt;br /&gt;4000000000&lt;br /&gt;&lt;br /&gt;real 0m0.008s&lt;br /&gt;user 0m0.000s&lt;br /&gt;sys 0m0.001s&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ g++ small_classed.cpp -O3;time ./a.out &lt;br /&gt;4000000000&lt;br /&gt;&lt;br /&gt;real 0m5.908s&lt;br /&gt;user 0m5.853s&lt;br /&gt;sys 0m0.018s&lt;br /&gt;&lt;br /&gt;My first effort was IO bound, but in this case it appears that templatized code is substantially faster.&lt;br /&gt;&lt;br /&gt;Nabble thread is &lt;A HREF="http://old.nabble.com/template-classes-faster-than-derived-classes--to26502122.html"&gt;here&lt;/A&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7076216920730926925?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7076216920730926925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7076216920730926925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7076216920730926925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7076216920730926925'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/are-templates-faster-than-subclasses.html' title='Are templates faster than subclasses?'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7625620111854553732</id><published>2009-11-20T02:07:00.000-08:00</published><updated>2009-11-20T02:10:06.495-08:00</updated><title type='text'>Renicing synology nfsd so it has priority over other services</title><content type='html'>We needed nfs to have priority over other services on a synology DS509+. To do this we reniced the nfsd process. Synologies are basically just linux boxes. So enable ssh on the synology and ssh to it (ssh synology -lroot) use your normal admin password for the password. Then edit /usr/syno/etc/rc.d/S83nfsd.sh. Where it currently reads:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                /sbin/portmap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                /usr/sbin/nfsd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                /usr/sbin/mountd -p 892&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        stop)&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;change it to read:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                /usr/sbin/nfsd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                /usr/sbin/mountd -p 892&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                renice -10 `pidof nfsd`&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        stop)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7625620111854553732?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7625620111854553732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7625620111854553732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7625620111854553732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7625620111854553732'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/renicing-synology-nfsd-so-it-has.html' title='Renicing synology nfsd so it has priority over other services'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8500541062707765471</id><published>2009-11-16T17:44:00.000-08:00</published><updated>2009-12-23T10:04:45.130-08:00</updated><title type='text'>Commands used to install golang</title><content type='html'>&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;br /&gt;Commands I used to install Go language (golang) on Ubuntu amd64:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install mercurial bison gcc libc6-dev ed make&lt;br /&gt;cd ~&lt;br /&gt;export GOROOT=$HOME/go&lt;br /&gt;export GOARCH=amd64&lt;br /&gt;export GOOS=linux&lt;br /&gt;mkdir $HOME/gobin&lt;br /&gt;export GOBIN=$HOME/gobin&lt;br /&gt;export PATH=$PATH:$GOBIN&lt;br /&gt;hg clone -r release https://go.googlecode.com/hg/ $GOROOT&lt;br /&gt;cd $GOROOT/src&lt;br /&gt;./all.bash&lt;span style="font-family: Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;To compile something make a test program e.g.:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;package main&lt;br /&gt;&lt;br /&gt;import "fmt"&lt;br /&gt;&lt;br /&gt;func main() {&lt;br /&gt;       fmt.Printf("hello, world\n")&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;and compile with:&lt;br /&gt;&lt;br /&gt;8g test.go ;8l test.8 ;./8.out&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8500541062707765471?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8500541062707765471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8500541062707765471' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8500541062707765471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8500541062707765471'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/commands-used-to-install-golang.html' title='Commands used to install golang'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-290008384667171777</id><published>2009-11-16T03:55:00.000-08:00</published><updated>2009-11-30T02:40:36.965-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lostandfound'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Version</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Probably did this before - but administered lost and found computers has made me need this info again.&lt;br /&gt;&lt;br /&gt;Version of linux.&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;cat /proc/version&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Gives you:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Linux version 2.6.28-15-generic (buildd@rothera) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #52-Ubuntu SMP Wed Sep 9 10:49:34 UTC 2009&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then you need the release info for the distribution.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;lsb_release -a&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Gives you:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;No LSB modules are available.&lt;br /&gt;Distributor ID: Ubuntu&lt;br /&gt;Description:    Ubuntu 9.04&lt;br /&gt;Release:        9.04&lt;br /&gt;Codename:       jaunty&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And of course uname -a. Which is a start. Would love to hear other tips on determining the state of a box that has previously been abandoned.&lt;br /&gt;&lt;br /&gt;Update: Naming of the actual machine and shit as well.&lt;br /&gt;&lt;br /&gt;Running hostname should give you the name of the actual machine. Not entirely sure how this works when you have multiple "machines" kinda running off the same physical machine.&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;user@machine:~$ hostname&lt;br /&gt;machine-name&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can then check this the other way round: &lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;user@machine:~$ host name.domain.tld&lt;br /&gt;ip address .in-addr.arpa domain name pointer name.domain.tld&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-290008384667171777?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/290008384667171777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=290008384667171777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/290008384667171777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/290008384667171777'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/version.html' title='Version'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5596000371793825845</id><published>2009-11-15T16:31:00.001-08:00</published><updated>2009-11-15T16:31:48.621-08:00</updated><title type='text'>list installed packages on debian and uninstall those not correctly removed.</title><content type='html'>dpkg --get-selections&lt;br /&gt;&lt;br /&gt;Will give you a list of packages currently installed on a debian system (possibly works for Ubuntu too?). You may see a few which are listed as "deinstall". They've not uninstalled correctly. To uninstall them use this command I found on the debian mailing lists to purge them:&lt;br /&gt;&lt;br /&gt;dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg -P&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5596000371793825845?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5596000371793825845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5596000371793825845' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5596000371793825845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5596000371793825845'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/list-installed-packages-on-debian-and.html' title='list installed packages on debian and uninstall those not correctly removed.'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4827632395947457573</id><published>2009-11-13T07:49:00.000-08:00</published><updated>2009-11-13T07:53:45.640-08:00</updated><title type='text'>Turning a Ubuntu install into a Window terminal server dumb terminal</title><content type='html'>I've written a quick script to term a clean Ubuntu (I'm using 9.04 netbook remix) into a dumb terminal to connect to a windows terminal server.&lt;br /&gt;&lt;br /&gt;You can use it like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wget http://sgenomics.org/~new/term.tar&lt;br /&gt;tar xvf term.tar&lt;br /&gt;sudo ./termsvr MYTERMINALSERVERNAME MYDOMAINNAME&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Under the hood, the script looks like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;if [ $# -ne 2 ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  echo "Usage: `basename $0` &lt;terminal&gt; &lt;domain&gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  exit 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;apt-get -y --force-yes remove gnome*&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;apt-get update&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;apt-get install rdesktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;cp ./rc.local /etc/rc.local&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;sed "s/\*SERVERNAME\*/$1/" ./xinitrc        &gt; ./xinitrc.fixed0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;sed "s/\*DOMAINNAME\*/$2/" ./xinitrc.fixed0 &gt; ./xinitrc.fixed1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;cp ./xinitrc.fixed1 /etc/X11/xinit/xinitrc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where xinitrc contains:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# /etc/X11/xinit/xinitrc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# global xinitrc file, used by all X sessions started by xinit (startx)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;while [ true ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  rdesktop -f *SERVERNAME* -d *DOMAINNAME* -u "" -k en-gb&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# invoke global X session script&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;. /etc/X11/Xsession&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and rc.local contains:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#!/bin/sh -e&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# rc.local&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# This script is executed at the end of each multiuser runlevel.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Make sure that the script will "exit 0" on success or any other&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# value on error.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# In order to enable or disable this script just change the execution&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# bits.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# By default this script does nothing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;startx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;exit 0&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4827632395947457573?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4827632395947457573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4827632395947457573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4827632395947457573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4827632395947457573'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/turning-ubuntu-install-into-window.html' title='Turning a Ubuntu install into a Window terminal server dumb terminal'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6484843563991454305</id><published>2009-11-13T05:38:00.000-08:00</published><updated>2009-11-13T05:41:17.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>Upgrading eclipse on Ubuntu</title><content type='html'>After totally borking my eclipse install I seriously suggest just removing every mention of the damned thing before installing the new version. By removing I mean move to a new dir in /tmp/ of course. &lt;br /&gt;&lt;br /&gt;Things to look out for:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/home/user/.eclipse&lt;br /&gt;/home/user/.mozilla/eclipse&lt;br /&gt;/foo/bar/eclipse&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Seriously this should be a lot easier. Anyway - the other thing to attempt is exporting your old software update sites list and then importing this into the new install. This should save an ungodly amount of time reinstalling plugins - which vastly outweighs the amount of time installing takes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6484843563991454305?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6484843563991454305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6484843563991454305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6484843563991454305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6484843563991454305'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/upgrading-eclipse-on-ubuntu.html' title='Upgrading eclipse on Ubuntu'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6229830999641458922</id><published>2009-11-11T10:08:00.000-08:00</published><updated>2009-11-11T12:01:36.678-08:00</updated><title type='text'>strings in the n900 firmware</title><content type='html'>The n900 isn't out yet, but it's firmware is! I ran strings over it and looked at the longer, more interesting strings as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;strings RX-51_2009SE_1.2009.42-11_PR_F5_MR0_ARM.bin | awk '{if(length($0) &gt; 50) print $0}' | more&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some interesting finds:&lt;br /&gt;&lt;br /&gt;Uses glibc, good to know...&lt;span style="font-family:courier new;"&gt; GLIBC_2.4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;"Major hack here, this needs to be spawned from a proper class"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Always good to know. :)&lt;br /&gt;&lt;br /&gt;Skype:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;usr/share/locale/fr_FR/LC_MESSAGES/skype-ui.mo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lots of these:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;TMS320C6x COFF Linker Unix v6.0.7 Copyright (c) 1996-2006 Texas Instrument&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;''C:/users/Prasad/Nokia/CHK_100_V_H264AVC_D_BP_OMAP3430_1_Q&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;5320C6x COFF Linker Unix v6.0.7 Copyright (c) 1996-2006 Texas Instrumentl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Looks like they are making extensive use of the DSP on the OMAP3430. I guess for accelerating graphics etc. This is good news in terms of functionality, should make the whole experience smoother. But bad news for open source zealots as there's no open source TMS320C6x compiler.&lt;br /&gt;&lt;br /&gt;Some familiar apps:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;usr/share/doc/osso-fm-transmitter-l10n-cscz/changelog.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/chess_startup.desktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/mahjong_startup.desktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/osso_lmarbles.desktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/osso_pdfviewer.desktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/osso_calculator.desktop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/usr/share/applications/hildon/osso_rss_feed_reader.desktop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What does it use prolog for?!?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;usr/share/doc/swi-prolog/changeD&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No IPv6?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;8Removing IPv6 stuff because it is no longer found in fremantle BUT only ifR&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;echo "Welcome to your upstart powered internet tablet."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Upstart powered!!&lt;br /&gt;&lt;br /&gt;Custom bootloader:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;INokia OMAP Loader v1.4.13 (Oct  5 2009) running on %s %s (%s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Wonder if this is the same bootloader they use on the n97...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;%s: Checksum mismatch (stored 0x%04x, calc. 0x%04x). Who cares, right?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Yea! Who cares!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Yup, there it is. Stand by for some Linux pleasure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's right bitches! Bring on the pleasure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6229830999641458922?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6229830999641458922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6229830999641458922' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6229830999641458922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6229830999641458922'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/strings-in-n900-firmware.html' title='strings in the n900 firmware'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-9051544683568483274</id><published>2009-11-09T03:03:00.000-08:00</published><updated>2009-11-09T03:04:33.461-08:00</updated><title type='text'>Make directory if it doesn't exist return true so you can use it in a make file</title><content type='html'>[ -d /opt/foo/bin ] || mkdir -p /opt/foo/bin&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-9051544683568483274?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/9051544683568483274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=9051544683568483274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/9051544683568483274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/9051544683568483274'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/make-directory-if-it-doesnt-exist.html' title='Make directory if it doesn&apos;t exist return true so you can use it in a make file'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5820301813333385372</id><published>2009-11-08T06:14:00.000-08:00</published><updated>2009-11-08T06:15:41.785-08:00</updated><title type='text'>Routertech AR7RD ppp interface not coming up</title><content type='html'>The ppp0 interface on my RouterTech router wasn't coming up on reboot, I have no idea why. To get it to come up I telneted in to the router (login as root, with normal admin password). Then executed the following:&lt;br /&gt;&lt;br /&gt;/etc/ppp/ip-up&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5820301813333385372?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5820301813333385372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5820301813333385372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5820301813333385372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5820301813333385372'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/11/routertech-ar7rd-ppp-interface-not.html' title='Routertech AR7RD ppp interface not coming up'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-9049240993398592544</id><published>2009-10-12T06:20:00.000-07:00</published><updated>2009-10-12T06:22:30.744-07:00</updated><title type='text'>vector bounds checking in GCC</title><content type='html'>&lt;p style="margin: 0px 0px 16px;"&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;i&gt;Robbed from somewhere on the internet. I can't try this is my application because my libraries are not compiled with GLIBCXX_DEBUG but I believe this option should enable bounds checking on stl vectors etc. Here as a note for future use:&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px 0px 16px;"&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;i&gt;Pedantic&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt; debug mode checks not only for errors, but also for usages that rely on GNU extensions and that, while correct, may not be portable to other compilers. In pedantic mode, for example, constructing an &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Courier;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;std::string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt; with a null pointer will result in an abort, not an exception. Pedantic debug mode is not the default. To enable pedantic debug mode, compile your program with &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;i&gt;both&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Courier;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;-D_GLIBCXX_DEBUG&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt; and &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Courier;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;-D_GLIBCXX_DEBUG_PEDANTIC&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px 0px 16px;"&gt;Robbed from here: http://lists.apple.com/archives/xcode-users/2006/Feb/msg00209.html&lt;br /&gt;&lt;span class="Apple-style-span"   style="font-family:Times;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-9049240993398592544?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/9049240993398592544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=9049240993398592544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/9049240993398592544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/9049240993398592544'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/vector-bounds-checking-in-gcc.html' title='vector bounds checking in GCC'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3871556091765398659</id><published>2009-10-04T12:25:00.000-07:00</published><updated>2009-10-04T12:30:01.510-07:00</updated><title type='text'>Submit a bunch of jobs to SGE using a file as a template</title><content type='html'>This script takes a filename from the third whitespace separated field of each file of the file "work-to-do" it uses this as the argument of a command (at /home/user/stuff/bin/stuff). The second argument of this command is the directory of the first argument. The third is a name generated from the current date. These commands are generated and then submitted to an SGE queue using qsub (the queue is called myqueueq). As always probably useless to anyone but me.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;awk '{print &amp;quot;cd /home/user/stuff;./bin/stuff &amp;quot;$3&amp;quot; `dirname &amp;quot;$3&amp;quot;` auto-`date +%Y-%m-%dT$H-%M-%S`&amp;quot;}' work-to-do &amp;gt; sgecommands&lt;br /&gt;&lt;br /&gt;awk '{print &amp;quot;echo \&amp;quot;&amp;quot; $0 &amp;quot;\&amp;quot; &amp;gt; /tmp/regen_run;qsub -q myqueueq /tmp/regen_run&amp;quot;}' sgecommands&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3871556091765398659?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3871556091765398659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3871556091765398659' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3871556091765398659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3871556091765398659'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/submit-bunch-of-jobs-to-sge-using-file.html' title='Submit a bunch of jobs to SGE using a file as a template'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1469626480166689759</id><published>2009-10-03T13:22:00.000-07:00</published><updated>2009-10-03T13:23:03.905-07:00</updated><title type='text'>Windows 95/98/Me registry kludging</title><content type='html'>There is a neat trick that puts Windows 9x back into setup. This lets you resetup all your drivers and can be useful in recovering a dead system (for example one that will not boot into Windows normally). It also keeps all your application settings.&lt;br /&gt;Basicly what you do is merge a registry file called "SYSTEM.1ST" which is stored in the root of the C: drive ontop of your registry. To do this do the following:&lt;br /&gt;&lt;br /&gt;Reset the computer, when it says "Starting Windows..." press F5.&lt;br /&gt;You should be presented with a C:\&gt; prompt type:&lt;br /&gt;&lt;br /&gt;attrib -h -r -s C:\SYSTEM.1ST&lt;br /&gt;regedit /L:C:\SYSTEM.1ST /E C:\1ST.REG&lt;br /&gt;regedit C:\1ST.REG&lt;br /&gt;&lt;br /&gt;next time you boot Windows you will be presented with the setup screen. Your serial number sould already be displayed and you should just be able to click through most of the options.&lt;br /&gt;&lt;br /&gt;If your registry is completely corrupt then you may want to just copy  C:\SYSTEM.1ST over C:\WINDOWS\SYSTEM.DAT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1469626480166689759?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1469626480166689759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1469626480166689759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1469626480166689759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1469626480166689759'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/windows-9598me-registry-kludging.html' title='Windows 95/98/Me registry kludging'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3452761584839032441</id><published>2009-10-03T13:12:00.000-07:00</published><updated>2009-10-03T13:14:42.531-07:00</updated><title type='text'>Misc RM Connect 2.x fixes</title><content type='html'>Is anybody still stupid enough to use RM Connect? I hope not but in the event that they are here are a random collection of bug fixes:&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; No packages install&lt;br /&gt;&lt;/h2&gt; &lt;u&gt; Symptoms&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;No packages install on any workstations, even clean builds. No error is displayed at all.&lt;br /&gt;&lt;br /&gt;&lt;u&gt; Solution&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;Last time I encountered this it was due to the Nimda virus messing up Share permissions on our network. Check that the "Propagate" share on your PDC has the correct permissions. The share should be located at D:\RMVA\Manage\pkgctrl and permissions should be (as for all RM based shares) Everyone/Full Control. File permissions should be "Propagator/Full Control".&lt;br /&gt;&lt;br /&gt;If this problems has been caused by Nimda trashing you file permissions you will probably find that many other shares have been distroyed as well. I've written some scripts that will reset the share permissions to there correct values, please contact at: help@asknav.com if you would like more information.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; Users exceed quota due to large Internet History folders&lt;br /&gt;&lt;/h2&gt; &lt;u&gt; Symptoms&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;Users (on a 200/300 station network) come to you on an almost daily basis saying that their file area is full and they can't logon, but when they look in their file area they can't find anything to delete. When you you examine their file area it's AppData is huge, and cookies/History information is using up their quota.&lt;br /&gt;&lt;br /&gt; &lt;u&gt; Solution&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;I've written a small program, which you run from the login script of all users, to solve this problem. Basicly it will delete everything in the Internet folder of a user as they login, this should keep the filearea down to a reasonable size.&lt;br /&gt;&lt;br /&gt;The fix is available from the link below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ecs.soton.ac.uk.wstub.archive.org/%7Enew299/asknav/rm/delHist2.exe"&gt; delHist2.exe &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; I remove NetBEUI from a client and it continues to work, but I get an error from licence manager when I bootup &lt;/h2&gt; You want to get rid of NetBEUI, good idea! NetBEUI produces far too much network traffic, and is not recommended for use on networks larger than 30/40 computers.&lt;br /&gt;&lt;br /&gt;The problem you are getting is caused by the fact that RM licence manager is configured by default to use NetBEUI to check for licences. The good news is however that RM licence manager can be configured to use TCP/IP to do this. I've created a package to do this and it can be downloaded from the link below. To install the package on your network simply unzip the folder and copy it to D:\RMVA\manage\packages\32bitWin or the share \\PDCNAME\manage\packages\32bitWin. Then allocate it to all your workstations using application wizard.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ecs.soton.ac.uk.wstub.archive.org/%7Enew299/asknav/rm/remNetB.zip"&gt; remNetB.zip &lt;/a&gt;   &lt;img src="http://www.prtracker.com/cgi-bin/count3.exe?30,new299@ecs.soton.ac.uk" ismap="ismap" width="1" border="0" height="1" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; Licence Manager doesn't work even on a clean build&lt;br /&gt;&lt;/h2&gt;&lt;br /&gt;Well, it sounds like licence manager is broken on the server. The simplest thing to do is reset it, and add some new licences. Licence manager is really a tool for you to keep track of licencing, so if you are having problems you can add as many licences as you want.&lt;br /&gt;&lt;br /&gt;Step 1: Stop the "RM Licence Manager" service on all of your servers.&lt;br /&gt;Step 2: Delete the file called "C:\WINNT\rmlicman.lic" or "C:\WINNT\System32\rmlicman.lic".&lt;br /&gt;Step 3: Start the "RM Licence Manager" service on all of yout servers.&lt;br /&gt;Step 4: Run the "RM Licence Manager" program from Admin Tools on the start menu, it may take some time to startup. Add as many licences as you want to each of your servers.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; I'm running Sophos with file Protector, but everytime a user logs in it reinstalls itself, but I've got the correct exculsions setup&lt;br /&gt;&lt;/h2&gt; &lt;u&gt; Solution&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;(Quick and Dirty tobe updated soon)&lt;br /&gt;&lt;br /&gt; Your problem is that File Protector recovers the registry from a backup (taken when a package is allocated or when you "Backup key files") when the system boots up.&lt;br /&gt;&lt;br /&gt;The easiest way to solve this is to stop File Protector from replacing the registry at boot. The downside is that any changes that a user makes could stick (which includes, if they know how to do it, disabling File protector).&lt;br /&gt;&lt;br /&gt;OK what you need to do is edit a batch file in the "FileProt" package. This is located at: D:\RMVA\Manage\packages\32BitWin\FileProt on your PDC. Or mapped to L:\Packages\32BitWin\FileProt on Admin accounts. You need to edit the file in the STATION\HDS directory called recover.bat load it into notepad. Find the lines under "rem System.Dat" and alter them so they read:&lt;br /&gt;&lt;br /&gt;rem System.Dat&lt;br /&gt;rem c:\windows\command\attrib -r -h -s c:\Windows\System.DAT&lt;br /&gt;rem c:\windows\command\attrib -r -h c:\BackUp\System.da0&lt;br /&gt;rem copy c:\BackUp\System.da0 c:\Windows\System.DAT &gt;&gt; %logfile%&lt;br /&gt;rem c:\windows\command\attrib +r +h +s c:\Windows\System.DAT&lt;br /&gt;rem c:\windows\command\attrib +r +h c:\BackUp\System.da0&lt;br /&gt;&lt;br /&gt;rem User.Dat&lt;br /&gt;rem c:\windows\command\attrib -r -h -s c:\Windows\User.DAT&lt;br /&gt;rem c:\windows\command\attrib -r -h c:\BackUp\User.da0&lt;br /&gt;rem copy c:\BackUp\User.da0 c:\Windows\User.DAT &gt;&gt; %logfile%&lt;br /&gt;rem c:\windows\command\attrib +r +h +s c:\Windows\User.DAT&lt;br /&gt;rem c:\windows\command\attrib +r +h c:\BackUp\User.da0&lt;br /&gt;&lt;br /&gt;Instead of:&lt;br /&gt;&lt;br /&gt;rem System.Dat&lt;br /&gt;c:\windows\command\attrib -r -h -s c:\Windows\System.DAT&lt;br /&gt;c:\windows\command\attrib -r -h c:\BackUp\System.da0&lt;br /&gt;copy c:\BackUp\System.da0 c:\Windows\System.DAT &gt;&gt; %logfile%&lt;br /&gt;c:\windows\command\attrib +r +h +s c:\Windows\System.DAT&lt;br /&gt;c:\windows\command\attrib +r +h c:\BackUp\System.da0&lt;br /&gt;&lt;br /&gt;rem User.Dat&lt;br /&gt;c:\windows\command\attrib -r -h -s c:\Windows\User.DAT&lt;br /&gt;c:\windows\command\attrib -r -h c:\BackUp\User.da0&lt;br /&gt;copy c:\BackUp\User.da0 c:\Windows\User.DAT &gt;&gt; %logfile%&lt;br /&gt;c:\windows\command\attrib +r +h +s c:\Windows\User.DAT&lt;br /&gt;c:\windows\command\attrib +r +h c:\BackUp\User.da0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The run Application wizard and allocate "FileProt", choose to re-allocate to workstations already setup.&lt;br /&gt;&lt;br /&gt;Registry changes should new stick and Sophos should install itself only once.&lt;br /&gt;&lt;br /&gt;If you still have problems make sure the follow exclusions are set in file protector:&lt;br /&gt;&lt;br /&gt;C:\InterChk.chk&lt;br /&gt;C:\Program Files\Sophos Sweep&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3452761584839032441?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3452761584839032441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3452761584839032441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3452761584839032441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3452761584839032441'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/misc-rm-connect-2x-fixes.html' title='Misc RM Connect 2.x fixes'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7323645549841168731</id><published>2009-10-03T13:10:00.000-07:00</published><updated>2009-10-03T13:15:45.488-07:00</updated><title type='text'>Windows NT/2000 password recovery</title><content type='html'>&lt;h2 style="font-weight: normal; font-family: arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style="font-weight: normal; font-family: arial;"&gt;&lt;span style="font-size:100%;"&gt;I've found two options for cracking Windows 2000 passwords (this probably still works for XP and maybe even Vista).&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;  The first is to buy LockSmith and NTRecover from Wininternal, these cost a hell of a lot (about 200quid I think). They will however almost definitely work as the people who write them really know their stuff.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;The second (cheaper option) is to use a free program that's available on the web (http://home.eunet.no/~pnordahl/ntpasswd/). I've saved many systems using this but comes with no guarantees.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;The required files are available on the above website, with local copies below. Download them into a directory on your computer and then from the commandline do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;C:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;CD C:\&lt;/span&gt;&lt;download style="font-family: arial;"&gt;&lt;br /&gt;rawrite2&lt;br /&gt;&lt;br /&gt;When prompted for the disk image source file name enter "bd010114.bin" the target drive will of course be A:. Insert a disc and the program should create you a bootable floppy which is able to reset the Administrator password.&lt;br /&gt;&lt;br /&gt;When you boot from this disc on the workstation you are cracking you should be able to accept the defaults for most of the options. You probably won't need to probe for SCSI devices, and you need to answer yes when prompted to write the SAM.&lt;br /&gt;&lt;a href="http://www.ecs.soton.ac.uk.wstub.archive.org/%7Enew299/asknav/winnt/bd010114.bin"&gt; bd010114.bin&lt;br /&gt;&lt;/a&gt; &lt;a href="http://www.ecs.soton.ac.uk.wstub.archive.org/%7Enew299/asknav/winnt/rawrite2.exe"&gt; rawrite2.exe &lt;/a&gt;&lt;/download&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7323645549841168731?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7323645549841168731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7323645549841168731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7323645549841168731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7323645549841168731'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/windows-nt2000-password-recovery.html' title='Windows NT/2000 password recovery'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8412500239597254167</id><published>2009-10-03T13:08:00.000-07:00</published><updated>2009-10-03T13:09:19.815-07:00</updated><title type='text'>Internet Explorer and Acrobat print incorrectly. But Word and notepad do.</title><content type='html'>&lt;u&gt;Symptoms&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;You can print from Microsoft Word and notepad correctly, but when you try printing from Internet explorer you get an error message similar to:&lt;br /&gt;&lt;br /&gt;Line: 539&lt;br /&gt;Char: 2&lt;br /&gt;Error: Invalid argument.&lt;br /&gt;Code: 0 URL: res://C:\WINDOWS\SYSTEM\SHDOCLC.DLL/preview.dlg&lt;br /&gt;&lt;br /&gt;You may also (or possibly only) find that documents in Adobe Acrobat don't print correctly (words run into each other etc). The printer you're trying to print to is an HP printer.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;br /&gt;These errors most commonly occur with HP printers, usually they are down to the PCL 6 driver that is supplied with the printer. Your best option is to download a PCL 5e, or PS driver from the &lt;a herf="http://www.hp.com/cposupport/software.html"&gt;HP website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Appariently the Internet Explorer problem can also be caused by a faultly DLL (although I haven't come across this), details are available at: &lt;a href="http://support.microsoft.com/support/kb/articles/Q293/1/76.ASP"&gt;http://support.microsoft.com/support/kb/articles/Q293/1/76.ASP&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8412500239597254167?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8412500239597254167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8412500239597254167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8412500239597254167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8412500239597254167'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/internet-explorer-and-acrobat-print.html' title='Internet Explorer and Acrobat print incorrectly. But Word and notepad do.'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5413105201255897782</id><published>2009-10-03T13:04:00.000-07:00</published><updated>2009-10-03T13:20:50.035-07:00</updated><title type='text'>Network configuration for older brother (1260/1660) printers/Emulex configuration</title><content type='html'>I just rediscovered the internet archive backup of a website I had back in the 2000 odd. Most of the stuff from there is old and no longer relevant but may just be of some use to someone.&lt;br /&gt;&lt;br /&gt;Network configuration for older brother (1260/1660) printers/Emulex configuration&lt;br /&gt;&lt;br /&gt;Step 0 resets the card, you can probably skip this for a new card.&lt;br /&gt;&lt;br /&gt;0. Remove the Emulex NetJet card from the printer.&lt;br /&gt;0.1 Set Jumper JX1 to the 1-2 position (nearest the connector).&lt;br /&gt;0.2 Put the card back in the printer and switch it on for 30 seconds.&lt;br /&gt;0.3 Switch the printer off and remove the card.&lt;br /&gt;0.4 Set JX1 to 2-3 and put the card back in the printer.&lt;br /&gt;0.5 Switch the printer on.&lt;br /&gt;1. Make a note of the MAC address of the printer (writen on the back of the NetJet card).&lt;br /&gt;2. At a cmd prompt on the workstation type:&lt;br /&gt;"arp -s ipaddress mac" for example: "arp -s 192.168.3.50 00-00-c9-09-22-67". Telnet to the printer&lt;br /&gt;4. Enter the default password which is "access"&lt;br /&gt;5. Type "su", when prompted for a password type "system"&lt;br /&gt;6. You should now have a "Server&gt;&gt;" prompt.&lt;br /&gt;7. Type "define subnet yoursubnet" to set the subnet.&lt;br /&gt;8. Type "define node ip your_ip" to set the ip address. for example "define node ip 192.168.3.50"&lt;br /&gt;9. Type "logout".&lt;br /&gt;10. You should now be able to ping the printer from any workstation on the network.&lt;br /&gt;11. You'll need to setup an LPR port on the server to connect to the printer, under Windows NT4/2000 use generic LPR.&lt;br /&gt;12. The queue name will be "PASSTHRU", and protocol should be LPR not RAW.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5413105201255897782?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5413105201255897782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5413105201255897782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5413105201255897782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5413105201255897782'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/network-configuration-for-older-brother.html' title='Network configuration for older brother (1260/1660) printers/Emulex configuration'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7556394905687353281</id><published>2009-10-03T12:59:00.000-07:00</published><updated>2009-10-03T13:01:37.096-07:00</updated><title type='text'>A short script to move files out of the way retaining full path</title><content type='html'>Find all files named *.fast4 under the current directory. Create replicate the path under ./obsolete and copy the file to the associated location. This script creates the required commands in a file called "moveobsolete" which you can then check over and execute.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;find . -name "*.fast4" &amp;gt; obsoletefiles&lt;br /&gt;awk '{print "mkdir -p ./obsolete/`dirname "$1"`; mv " $0 " ./obsolete/" $0}' obsoletefiles &amp;gt; moveobsolete&lt;br /&gt;chmod 777 moveobsolete&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7556394905687353281?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7556394905687353281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7556394905687353281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7556394905687353281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7556394905687353281'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/10/short-script-to-move-files-out-of-way.html' title='A short script to move files out of the way retaining full path'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-557938952840100762</id><published>2009-09-27T15:00:00.000-07:00</published><updated>2009-09-27T15:01:43.939-07:00</updated><title type='text'>Rename files matching given spec to incrementing filenames</title><content type='html'>This one liner renames all files starting with shred_ to shred_0.tif, shred_1.tif etc.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;ls shred_* &amp;#124; awk 'BEGIN{n=0;}{print &amp;quot;mv &amp;quot; $0 &amp;quot; shred_&amp;quot; n &amp;quot;.tif&amp;quot;; n++;}' &amp;#124; sh&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-557938952840100762?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/557938952840100762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=557938952840100762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/557938952840100762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/557938952840100762'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/rename-files-matching-given-spec-to.html' title='Rename files matching given spec to incrementing filenames'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7587732938405243122</id><published>2009-09-23T14:43:00.000-07:00</published><updated>2009-09-23T14:45:20.519-07:00</updated><title type='text'>My .mailcap</title><content type='html'>Used with mutt to view gifs and jpegs as ascii graphics!!!! requires aview package on ubuntu/debian:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;image/gif; asciiview '%s'&lt;br /&gt;image/png; asciiview '%s'&lt;br /&gt;image/jpg; asciiview '%s'&lt;br /&gt;image/jpeg; asciiview '%s'&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Robbed off some random place on the internets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7587732938405243122?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7587732938405243122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7587732938405243122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7587732938405243122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7587732938405243122'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/my-mailcap.html' title='My .mailcap'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3888071786813027548</id><published>2009-09-22T08:55:00.000-07:00</published><updated>2009-09-22T08:56:48.731-07:00</updated><title type='text'>Simple pysam example</title><content type='html'>This python code uses pysam to parse a bam file and print out all the alignment contained therein.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import pysam&lt;br /&gt;&lt;br /&gt;# Open our sam file&lt;br /&gt;samfile = pysam.Samfile()&lt;br /&gt;samfile.open( &amp;quot;sim.bam&amp;quot;, &amp;quot;rb&amp;quot; )&lt;br /&gt;&lt;br /&gt;# Grab an alignment from the sam file&lt;br /&gt;&lt;br /&gt;def m_fetch_callback( alignment ):&lt;br /&gt;  print str(alignment)&lt;br /&gt;&lt;br /&gt;num_targets = samfile.getNumTargets()&lt;br /&gt;&lt;br /&gt;for n in xrange(num_targets):&lt;br /&gt;  samfile.fetch(samfile.getTarget(n),m_fetch_callback)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3888071786813027548?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3888071786813027548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3888071786813027548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3888071786813027548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3888071786813027548'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/simple-pysam-example.html' title='Simple pysam example'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8846525425296240702</id><published>2009-09-18T04:00:00.000-07:00</published><updated>2009-09-18T06:42:52.270-07:00</updated><title type='text'>Simple zlib file reading example</title><content type='html'>This C++ example can read from both compressed and compressed files. It will read from testfile.gz (which can either be compressed or uncompressed) and write the contents to the standard output (screen).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;zlib.h&amp;quot;&lt;br /&gt;&lt;br /&gt;#if defined(MSDOS) &amp;#124;&amp;#124; defined(OS2) &amp;#124;&amp;#124; defined(WIN32) &amp;#124;&amp;#124; defined(__CYGWIN__)&lt;br /&gt;#  include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;#  include &amp;lt;io.h&amp;gt;&lt;br /&gt;#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)&lt;br /&gt;#else&lt;br /&gt;#  define SET_BINARY_MODE(file)&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;&lt;br /&gt;  gzFile f = gzopen(&amp;quot;testfile.gz&amp;quot;,&amp;quot;rb&amp;quot;);&lt;br /&gt;&lt;br /&gt;  char buffer[1001];&lt;br /&gt;&lt;br /&gt;  for(;!gzeof(f);) {&lt;br /&gt;&lt;br /&gt;    int e = gzread(f,buffer,1000);&lt;br /&gt;    buffer[1000] = 0;&lt;br /&gt;    cout &amp;lt;&amp;lt; buffer &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  gzclose(f);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Compile with g++ testprog.cpp -lz -o testprog&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8846525425296240702?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8846525425296240702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8846525425296240702' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8846525425296240702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8846525425296240702'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/simple-zlib-file-reading-example.html' title='Simple zlib file reading example'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8450571497242922024</id><published>2009-09-18T03:27:00.000-07:00</published><updated>2009-09-18T03:29:36.031-07:00</updated><title type='text'>Count files matching a given type/find spec</title><content type='html'>Count file size in bytes of all files matching *fast4 modified in the last 90 days.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;x=`find . -atime 90 -name \*fast4 -ls &amp;#124; awk '{print $7 &amp;quot; +&amp;quot;}' &amp;#124; xargs echo`; echo &amp;quot;$x 0&amp;quot; &amp;#124; bc&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8450571497242922024?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8450571497242922024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8450571497242922024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8450571497242922024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8450571497242922024'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/count-files-matching-given-typefind.html' title='Count files matching a given type/find spec'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6769688449267806800</id><published>2009-09-18T03:26:00.000-07:00</published><updated>2009-09-18T03:27:28.760-07:00</updated><title type='text'>examine irssi scrollback</title><content type='html'>I always find this a pain to lookup. But to scrollback in irssi: esc then p, forward esc then n.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6769688449267806800?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6769688449267806800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6769688449267806800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6769688449267806800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6769688449267806800'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/examine-irssi-scrollback.html' title='examine irssi scrollback'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6399368742486778952</id><published>2009-09-09T15:45:00.001-07:00</published><updated>2009-09-09T15:50:15.158-07:00</updated><title type='text'>iWorks '09 Keynote hangs loading a ppt file potentially losing all your work</title><content type='html'>I had a problem. I'd been working all day on a presentation which I hadn't saved (yea I know). Then I tried to load a powerpoint file and Keynote just hung trying to load the file. If I couldn't get it to unhang I would have lost a days work as Keynote doesn't autosave. The solution is to attach gdb to the Keynote and get it to jump out of whichever loop it's stuck in. Like so:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;news-macbook:MacOS new$ ps -ef | grep Keynote&lt;br /&gt; 501 13290    82   0   1:22.74 ??        46:51.60 /Applications/iWork '09/Keynote.app/Contents/MacOS/Keynote -psn_0_1552763&lt;br /&gt;news-macbook:MacOS new$ grep -p 13290&lt;br /&gt;grep: invalid option -- p&lt;br /&gt;Usage: grep [OPTION]... PATTERN [FILE]...&lt;br /&gt;Try `grep --help' for more information.&lt;br /&gt;news-macbook:MacOS new$ gdb -p 13290&lt;br /&gt;GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009)&lt;br /&gt;Copyright 2004 Free Software Foundation, Inc.&lt;br /&gt;GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;Type "show copying" to see the conditions.&lt;br /&gt;There is absolutely no warranty for GDB.  Type "show warranty" for details.&lt;br /&gt;This GDB was configured as "x86_64-apple-darwin".&lt;br /&gt;/Applications/iWork '09/Keynote.app/Contents/MacOS/13290: No such file or directory&lt;br /&gt;Attaching to process 13290.&lt;br /&gt;Reading symbols for shared libraries . done&lt;br /&gt;Reading symbols for shared libraries ................................................................................................................................................................................................................................ done&lt;br /&gt;0x942ed26d in ___CFBasicHashFindBucket1 ()&lt;br /&gt;(gdb) bt&lt;br /&gt;#0  0x942ed26d in ___CFBasicHashFindBucket1 ()&lt;br /&gt;#1  0x942edd5b in CFBasicHashFindBucket ()&lt;br /&gt;#2  0x942edcd4 in -[NSClassicMapTable objectForKey:] ()&lt;br /&gt;#3  0x942edca8 in NSMapGet ()&lt;br /&gt;#4  0x008dcf77 in -[ADReference reference] ()&lt;br /&gt;#5  0x008db594 in -[ADNode firstChildWithName:xmlNamespace:objcClass:resolveReference:] ()&lt;br /&gt;#6  0x008db3d2 in -[ADNode firstChildWith:resolveReference:] ()&lt;br /&gt;#7  0x008db369 in -[ADNode firstChildWith:] ()&lt;br /&gt;#8  0x009036b6 in -[ADSStyleSheet(ADInternal) parentSheet] ()&lt;br /&gt;#9  0x00903f22 in -[ADSStyleSheet(Private) recursiveStyleWithIdentifier:] ()&lt;br /&gt;#10 0x00903613 in -[ADSStyleSheet ensureOwnStyleWithIdentifierExists:] ()&lt;br /&gt;#11 0x005f50a7 in +[PIOGraphicStyleMapper mapMasterStylesFromPptSlide:toStyleSheet:withState:] ()&lt;br /&gt;#12 0x005fbe13 in -[PIOMasterSlideMapper mapMasterStyles] ()&lt;br /&gt;#13 0x005fbf9d in -[PIOMasterSlideMapper map] ()&lt;br /&gt;#14 0x00610ea9 in -[PIOThemeMapper mapMaster:includingGraphics:] ()&lt;br /&gt;#15 0x00610f94 in -[PIOThemeMapper mapMaster:] ()&lt;br /&gt;#16 0x006111b1 in -[PIOThemeMapper mapMasters] ()&lt;br /&gt;#17 0x00611285 in -[PIOThemeMapper map] ()&lt;br /&gt;#18 0x005f28c1 in -[PIODocMapper(Private) mapThemes] ()&lt;br /&gt;#19 0x005f238b in -[PIODocMapper map] ()&lt;br /&gt;#20 0x005f9467 in -[PIOImporter readFromFile:binaryDirectory:templatePath:localizer:] ()&lt;br /&gt;#21 0x0022e0e2 in ?? ()&lt;br /&gt;#22 0x0022e2d0 in ?? ()&lt;br /&gt;#23 0x0022f789 in ?? ()&lt;br /&gt;#24 0x0022ecea in ?? ()&lt;br /&gt;#25 0x000a8c5f in ?? ()&lt;br /&gt;#26 0x000a875f in ?? ()&lt;br /&gt;#27 0x96c08769 in -[NSDocument initWithContentsOfURL:ofType:error:] ()&lt;br /&gt;#28 0x96c0830d in -[NSDocumentController makeDocumentWithContentsOfURL:ofType:error:] ()&lt;br /&gt;#29 0x000163ed in ?? ()&lt;br /&gt;#30 0x00096fb4 in ?? ()&lt;br /&gt;#31 0x02ddac2e in -[SFAppApplicationDelegate(Private) pOpenDocumentWithContentsOfFile:] ()&lt;br /&gt;#32 0x02dd822d in -[SFAppApplicationDelegate application:openFiles:] ()&lt;br /&gt;#33 0x001f7f55 in ?? ()&lt;br /&gt;#34 0x96c0637d in -[NSApplication(NSAppleEventHandling) _handleAEOpenDocumentsForURLs:] ()&lt;br /&gt;#35 0x96b44104 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()&lt;br /&gt;#36 0x9432346c in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()&lt;br /&gt;#37 0x94323230 in _NSAppleEventManagerGenericHandler ()&lt;br /&gt;#38 0x90905de6 in aeDispatchAppleEvent ()&lt;br /&gt;#39 0x90905ce5 in dispatchEventAndSendReply ()&lt;br /&gt;#40 0x90905bf2 in aeProcessAppleEvent ()&lt;br /&gt;#41 0x9061a381 in AEProcessAppleEvent ()&lt;br /&gt;#42 0x969bddd6 in _DPSNextEvent ()&lt;br /&gt;#43 0x969bd40e in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()&lt;br /&gt;#44 0x9697f5fb in -[NSApplication run] ()&lt;br /&gt;#45 0x0000f13f in ?? ()&lt;br /&gt;#46 0x0000f0b8 in ?? ()&lt;br /&gt;#47 0x0000ee50 in ?? ()&lt;br /&gt;#48 0x0005cc79 in ?? ()&lt;br /&gt;(gdb) ret&lt;br /&gt;Make selected stack frame return now? (y or n) y&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Keep 'ret'ing until you reach 'readFromFile'. At this point type 'c'. Keynote will then tell you it couldn't open the file and you will be able to save your existing document.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6399368742486778952?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6399368742486778952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6399368742486778952' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6399368742486778952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6399368742486778952'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/iworks-09-keynote-hangs-loading-ppt.html' title='iWorks &apos;09 Keynote hangs loading a ppt file potentially losing all your work'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1396346021215829175</id><published>2009-09-03T06:31:00.000-07:00</published><updated>2009-09-03T06:34:03.737-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sendmail'/><category scheme='http://www.blogger.com/atom/ns#' term='hate'/><category scheme='http://www.blogger.com/atom/ns#' term='postfix'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Postfix won't start</title><content type='html'>Just noticed I wasn't receiving system mail for the last few weeks. Coming back after holiday. Anyway, one of the few services not to restart after the computer had been switched off in my absence was postfix. &lt;br /&gt;&lt;br /&gt;Couldn't for the life of me work out the problem, it was complaining about not finding the host. Therefore I had a look in /etc/hosts and commented out the line below:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#&lt;br /&gt;# hosts         This file describes a number of hostname-to-address&lt;br /&gt;#               mappings for the TCP/IP subsystem.  It is mostly&lt;br /&gt;#               used at boot time, when no name servers are running.&lt;br /&gt;#               On small systems, this file can be used instead of a&lt;br /&gt;#               &amp;quot;named&amp;quot; name server.&lt;br /&gt;# Syntax:&lt;br /&gt;#&lt;br /&gt;# IP-Address  Full-Qualified-Hostname  Short-Hostname&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;127.0.0.1       localhost&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# special IPv6 addresses&lt;br /&gt;#::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;&lt;br /&gt;fe00::0         ipv6-localnet&lt;br /&gt;&lt;br /&gt;ff00::0         ipv6-mcastprefix&lt;br /&gt;ff02::1         ipv6-allnodes&lt;br /&gt;ff02::2         ipv6-allrouters&lt;br /&gt;ff02::3         ipv6-allhosts&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The one about IPv6. Dunno what that was about - but it works now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1396346021215829175?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1396346021215829175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1396346021215829175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1396346021215829175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1396346021215829175'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/09/postfix-wont-start.html' title='Postfix won&apos;t start'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6758216874873570774</id><published>2009-08-28T04:30:00.001-07:00</published><updated>2011-10-03T14:40:37.468-07:00</updated><title type='text'>Program for calculating E</title><content type='html'>&lt;h1&gt;This post is now &lt;a href="http://41j.com/blog/2011/10/program-for-calculating-e/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6758216874873570774?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6758216874873570774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6758216874873570774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6758216874873570774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6758216874873570774'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/program-for-calculating-e.html' title='Program for calculating E'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8082887827736378610</id><published>2009-08-24T16:09:00.001-07:00</published><updated>2009-08-24T16:11:09.098-07:00</updated><title type='text'>Remove any linefeed from line which did not end in capital or special character (vim)</title><content type='html'>Remove any linefeed from line which did not end in capital or one of ./?&lt;&gt;:'&lt;br /&gt;&lt;br /&gt;Like so:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;%s/\([^./?&amp;lt;&amp;gt;":'A-Z]\)\n/\1/g&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8082887827736378610?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8082887827736378610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8082887827736378610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8082887827736378610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8082887827736378610'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/remove-any-linefeed-from-line-which-did.html' title='Remove any linefeed from line which did not end in capital or special character (vim)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8131446533728855972</id><published>2009-08-19T07:00:00.000-07:00</published><updated>2009-08-19T07:07:12.175-07:00</updated><title type='text'>Twitter botnet/remote access</title><content type='html'>Be the envy of your friends! Remote control your PC via twitter! Add the following code to cron to send all tweets with CMD in them to the shell.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;curl twitter.com/new299 &amp;#124; html2text &amp;#124; grep &amp;quot;CMD&amp;quot; &amp;#124; awk '{$1=&amp;quot;&amp;quot;;$0=substr($0,2)}1' &amp;#124; sh&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8131446533728855972?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8131446533728855972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8131446533728855972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8131446533728855972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8131446533728855972'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/twitter-botnetremote-access.html' title='Twitter botnet/remote access'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5986016874572592753</id><published>2009-08-19T03:43:00.000-07:00</published><updated>2011-09-30T16:20:57.634-07:00</updated><title type='text'>Simulate dataset with samtools, align with Bowtie, BWA, MAQ and pileup</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/09/simulate-dataset-with-samtools-align-with-bowtie-bwa-maq-and-pileup/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5986016874572592753?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5986016874572592753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5986016874572592753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5986016874572592753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5986016874572592753'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/attempt-to-use-bowtie-on-simulared.html' title='Simulate dataset with samtools, align with Bowtie, BWA, MAQ and pileup'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1499890275990692991</id><published>2009-08-12T07:22:00.000-07:00</published><updated>2009-08-12T07:24:57.502-07:00</updated><title type='text'>Reset author to filename on a bunch of pdf files</title><content type='html'>This script will reset the author to metadata on all files in the current directory to be the same as the filename of the file. It will write new files to a sub directory (which should already exist) called fixed.&lt;br /&gt;&lt;br /&gt;Quick hacky script to so that papers are index more sensibility on my Sony Reader.  &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;for i in *.pdf&lt;br /&gt;do&lt;br /&gt;        echo $i&lt;br /&gt;        echo &amp;quot;InfoKey: Author&amp;quot; &amp;gt; data.txt&lt;br /&gt;        echo &amp;quot;InfoValue: &amp;quot; $i &amp;gt;&amp;gt; data.txt&lt;br /&gt;        cat data.txt&lt;br /&gt;        pdftk ./$i update_info data.txt output ./fixed/$i&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1499890275990692991?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1499890275990692991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1499890275990692991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1499890275990692991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1499890275990692991'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/reset-author-to-filename-on-bunch-of.html' title='Reset author to filename on a bunch of pdf files'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1792712388411328861</id><published>2009-08-06T03:20:00.000-07:00</published><updated>2011-10-03T14:38:39.889-07:00</updated><title type='text'>ö (O with umlaut) on Mac OS X</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/01/o-o-with-umlaut-on-mac-os-x/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1792712388411328861?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1792712388411328861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1792712388411328861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1792712388411328861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1792712388411328861'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/o-o-with-umlaut-on-mac-os-x.html' title='ö (O with umlaut) on Mac OS X'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5573374724831897092</id><published>2009-08-05T08:43:00.000-07:00</published><updated>2009-08-05T08:45:01.571-07:00</updated><title type='text'>Running samtools pileup on some aligned reads</title><content type='html'>samtools needs a sorted file for pileup.. doesn't give you an error if it isn't sorted so watch out!&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;./samtools faidx phi.fa&lt;br /&gt;./samtools import ./phi.fa.fai /scratch/nava/lane7.phi.sam /scratch/nava/lane7.phi.bam&lt;br /&gt;./samtools sort /scratch/nava/lane7.phi.bam /scratch/nava/lane7.phi.bam.sort&lt;br /&gt;./samtools pileup -f ./phi.fa /scratch/nava/lane7.phi.bam.sort.bam &amp;gt; pile&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5573374724831897092?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5573374724831897092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5573374724831897092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5573374724831897092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5573374724831897092'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/running-samtools-pileup-on-some-aligned.html' title='Running samtools pileup on some aligned reads'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4498979830207198504</id><published>2009-08-05T06:30:00.000-07:00</published><updated>2009-08-05T06:31:00.954-07:00</updated><title type='text'>vim/vi inverted replace</title><content type='html'>Replace any character that isn't the ^ character with nothing:&lt;br /&gt;&lt;br /&gt;%s/[^^]//g&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4498979830207198504?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4498979830207198504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4498979830207198504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4498979830207198504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4498979830207198504'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/vimvi-inverted-replace.html' title='vim/vi inverted replace'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-721555775042672512</id><published>2009-08-01T06:28:00.000-07:00</published><updated>2009-08-01T06:29:43.321-07:00</updated><title type='text'>n810 g++ installation (os 2008.1 diablo)</title><content type='html'>Install the following repositories by editing /etc/apt/sources.list.d/hildon-application-manager.list&lt;br /&gt;&lt;br /&gt;add the following:&lt;br /&gt;&lt;br /&gt;deb http://repository.maemo.org/ diablo sdk/free sdk/non-free tools/free tools/non-free&lt;br /&gt;deb http://repository.maemo.org/extras/ diablo free non-free&lt;br /&gt;deb http://repository.maemo.org/extras-devel/ diablo free non-free&lt;br /&gt;&lt;br /&gt;apt-get update&lt;br /&gt;apt-get install g++&lt;br /&gt;&lt;br /&gt;done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-721555775042672512?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/721555775042672512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=721555775042672512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/721555775042672512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/721555775042672512'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/08/n810-g-installation-os-20081-diablo.html' title='n810 g++ installation (os 2008.1 diablo)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8364445044485368845</id><published>2009-07-28T06:35:00.000-07:00</published><updated>2009-07-28T06:42:30.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='openmoko'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Openmoko DNS settings</title><content type='html'>After several promising starts, I seem to have networking working reasonably reliably now. This is all available in the wiki on the site - so this is really just to remind me what the settings are for the resolv.conf after my office network moved to openDNS recently.&lt;br /&gt;&lt;br /&gt;Home (wireless config) &lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;echo nameserver 208.67.222.222&lt;br /&gt;echo nameserver 208.67.220.220&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Work (usb to computer)&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;search my-work.domain&lt;br /&gt;nameserver 10.1.1.11&lt;br /&gt;nameserver 10.1.1.12&lt;br /&gt;nameserver 10.1.1.11&lt;br /&gt;nameserver 10.1.1.12&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;No idea as yet how to automagically set these. Though this should get better. The network setup at work isn't helping though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8364445044485368845?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8364445044485368845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8364445044485368845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8364445044485368845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8364445044485368845'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/07/openmoko-dns-settings.html' title='Openmoko DNS settings'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-8234738202671738229</id><published>2009-07-17T03:46:00.000-07:00</published><updated>2009-07-17T03:52:29.656-07:00</updated><title type='text'>Quick bash script (check zero sized file) for reference</title><content type='html'>This is a quick bash script I wrote. Pasting it here for reference. It reads a bunch of ipar intensity files processes them with swift, and calibrates them with the swift calibrator. It checks if the file is zero sized (that's because I was updating a set of files some of which had failed). The:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;   if [ ! -s /scratch/user/"$lane"_"$tile".fastq.pf.calibrated ]&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;That checks that a file /is/ zero sized. And only runs swift if it is.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;sourcedir=/ADIRECTORY&lt;br /&gt;&lt;br /&gt;for lane in {1..8}&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;for tile in {1..100}&lt;br /&gt;do&lt;br /&gt; if [ ! -s /scratch/user/"$lane"_"$tile".fastq.pf.calibrated ]&lt;br /&gt;   then&lt;br /&gt;   nice cp "$sourcedir"/s_"$lane"_*0"$tile"_int.txt.p.gz /scratch/user/input.gz&lt;br /&gt;   nice gzip -d /scratch/user/input.gz&lt;br /&gt;   nice ./ipar2gapipelineint /scratch/user/input "$sourcedir"/s_"$lane"_*0"$tile"_pos.txt /scratch/user/gaint&lt;br /&gt;   nice ./swift --purity_threshold 0.56 --intfile /scratch/user/gaint --ref ./phi.fa --optical_duplicates_distance 6 --optical_duplicates_mismatches 8 --fastq /scratch/user/"$lane"_"$tile".fastq --phasing_window 10 --phasing_iterations 3 --align_every 50&lt;br /&gt;   nice ./QualityCalibration/quality_remap --in /scratch/user/"$lane"_"$tile".fastq.pf --mapfile ./QualityCalibration/firecrest_1_3_2_fixedtable --out /scratch/nava/"$lane"_"$tile".fastq.pf.calibrated&lt;br /&gt;   rm /scratch/user/input&lt;br /&gt;   rm /scratch/user/gaint&lt;br /&gt;   rm /scratch/user/*.fastq.pf&lt;br /&gt;   rm /scratch/user/*.fastq.nonpf&lt;br /&gt; fi&lt;br /&gt;done&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-8234738202671738229?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/8234738202671738229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=8234738202671738229' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8234738202671738229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/8234738202671738229'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/07/this-is-quick-bash-script-i-wrote.html' title='Quick bash script (check zero sized file) for reference'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4549467556433248261</id><published>2009-06-10T04:42:00.000-07:00</published><updated>2011-10-03T14:31:39.841-07:00</updated><title type='text'>Palm Pre uses glibc and has busybox</title><content type='html'>&lt;h1&gt;This post has moved &lt;a href="http://41j.com/blog/2011/10/palm-pre-notes/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4549467556433248261?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4549467556433248261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4549467556433248261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4549467556433248261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4549467556433248261'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/06/palm-pre-uses-glibc.html' title='Palm Pre uses glibc and has busybox'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3798181309940399047</id><published>2009-05-17T10:03:00.000-07:00</published><updated>2009-05-17T10:06:47.630-07:00</updated><title type='text'>Making a C++ object printable to standard output</title><content type='html'>You want to make a C++ object printable to the standard output. For example you have an object call ScoredSequence and you want do be able to do: ScoredSequence s("BLAHBLAH"); cout &lt;&lt; s; You need to add a &lt;&lt; operator to ScoredSequence, for example:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;class ScoredSequence {&lt;br /&gt;public:&lt;br /&gt;&lt;br /&gt;  ScoredSequence(string s) : sequence(s) {&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  string get_sequence() {&lt;br /&gt;    return s;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /// \brief Extractor which prints the whole sequence.&lt;br /&gt;  inline friend std::ostream&amp;amp; operator&amp;lt;&amp;lt;(std::ostream&amp;amp; out, const ScoredSequence&amp;amp; s) {&lt;br /&gt;    out &amp;lt;&amp;lt; s.get_sequence();&lt;br /&gt;    return out;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;private:&lt;br /&gt;  string sequence;&lt;br /&gt;};&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3798181309940399047?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3798181309940399047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3798181309940399047' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3798181309940399047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3798181309940399047'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/05/making-c-object-printable-to-standard.html' title='Making a C++ object printable to standard output'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1093937973174822641</id><published>2009-05-12T06:13:00.001-07:00</published><updated>2009-05-12T06:13:47.714-07:00</updated><title type='text'>delete all linefeeds from a file</title><content type='html'>like this:&lt;br /&gt;&lt;br /&gt;tr -d "\n" &lt; gaps2 &gt; nogaps&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1093937973174822641?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1093937973174822641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1093937973174822641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1093937973174822641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1093937973174822641'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/05/delete-all-linefeeds-from-file.html' title='delete all linefeeds from a file'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2216424666857506690</id><published>2009-05-07T01:31:00.000-07:00</published><updated>2009-05-07T01:37:27.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freerunner'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Connect to Freerunner Android from Opensuse</title><content type='html'>Plug in the freerunner, and yast2 should prompt you to configure a new network device of type usb. Follow the instructions, and configure using ifup (Not network manager) and use a static IP address for the freerunner. Assign it to 192.168.0.200.&lt;br /&gt;&lt;br /&gt;The adb program is available here: http://people.openmoko.org/sean_mcneil/adb&lt;br /&gt;&lt;br /&gt;Download it and put it somewhere and make it executable.&lt;br /&gt;&lt;br /&gt;Then save this set of commands as a bash script with a name like connect or whatever.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;$/usr/local/share/adb kill-server&lt;br /&gt;$ADBHOST=192.168.0.202 /usr/local/share/adb devices&lt;br /&gt;$/usr/local/share/adb shell&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Make this executable and then run it. It should drop you automatically into the shell interface on your freerunner.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2216424666857506690?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2216424666857506690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2216424666857506690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2216424666857506690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2216424666857506690'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/05/connect-to-freerunner-android-from.html' title='Connect to Freerunner Android from Opensuse'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5516737981215647564</id><published>2009-04-30T09:26:00.000-07:00</published><updated>2009-04-30T09:29:12.803-07:00</updated><title type='text'>Multi column table in latex</title><content type='html'>You want a table the spans across pages and raps in 2 columns. You need supertabular and to stick everything in a \twocolumn. Do it:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\pagebreak&lt;br /&gt;\twocolumn&lt;br /&gt;\begin{supertabular}{ &amp;#124;l&amp;#124;c&amp;#124;l&amp;#124; }&lt;br /&gt;\hline&lt;br /&gt;stuff1 &amp;amp; stuff2 &amp;amp; stuff3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;\hline&lt;br /&gt;\end{supertabular}&lt;br /&gt;\onecolumn&lt;br /&gt;\pagebreak&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5516737981215647564?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5516737981215647564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5516737981215647564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5516737981215647564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5516737981215647564'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/04/multi-column-table-in-latex.html' title='Multi column table in latex'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3801974132766574840</id><published>2009-04-17T05:28:00.000-07:00</published><updated>2009-04-17T05:32:09.873-07:00</updated><title type='text'>latex "File ignored" not found on nfs ( isilon )</title><content type='html'>You are unable to compile latex files (i.e. latex myreport.tex) on an nfs drive but they compile correctly from the local disk. You receive errors such as "File ignored" or "no found". In my case this occurred when using an Isilon. The solution is to switch file ID size from 64bit to 32bit on the isilon configuration. "File Sharing"-&gt;NFS-&gt;"Edit Settings" on the Isilon web configuration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3801974132766574840?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3801974132766574840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3801974132766574840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3801974132766574840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3801974132766574840'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/04/latex-file-ignored-not-found-on-nfs.html' title='latex &quot;File ignored&quot; not found on nfs ( isilon )'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4446356384544908457</id><published>2009-04-03T08:44:00.000-07:00</published><updated>2009-04-03T09:49:38.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resizing'/><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Growing a VM</title><content type='html'>I started a VM with the default 8Gb for a linux install. I have successfully added additional HDD to the VM but eventually I hit a problem that required editing the actual size of the main disk. I used the vmware-vdiskmanager (-x 12Gb Kubuntu.vmdk) to successfully resize the VM disk. Then I booted the VM into a gparted image using the ISO as a CD (option in the VMware server). This worked fine. I then edited the partition. First increase the size of the swap. Then shift it to the right and then make it smaller again, before resizing the main partition. Click apply changes and then wait. Or in my case head up to the terrace and enjoy beer and "Schnittchen". The KDE session does appear borked after all this. It complains about some DCOP setting not running. I tried changing permissions on the tmp dir and following general advice on the internet - however moving .kde to .kde_old solved the problem for me. The partition is now showing up as 12 gigs and all the files seem to be okay.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4446356384544908457?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4446356384544908457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4446356384544908457' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4446356384544908457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4446356384544908457'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/04/growing-vm.html' title='Growing a VM'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4843656462916686375</id><published>2009-03-07T10:29:00.000-08:00</published><updated>2011-09-28T13:01:27.948-07:00</updated><title type='text'>Aluminium Mac Keyboard disassembly</title><content type='html'>This post has been moved &lt;a href="http://41j.com/blog/?p=212"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4843656462916686375?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4843656462916686375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4843656462916686375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4843656462916686375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4843656462916686375'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/03/aluminium-mac-keyboard-disassembly.html' title='Aluminium Mac Keyboard disassembly'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3777507771805824330</id><published>2009-03-06T15:14:00.000-08:00</published><updated>2009-03-06T15:27:58.240-08:00</updated><title type='text'>avr-gcc read I/O on single port with AT90USB162</title><content type='html'>I want to repeatedly read from and write to a single port on a AT90USB162. This is to implement a key matrix scanner and pins will be repeated reconfigured as input or output. I ran in to trouble, reads seems to overlap as if they were being cached.&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;For example, I have pins 1 and 2 shorted.&lt;br&gt;&lt;br /&gt;pin 1 is set as an output. pin 2 an input.&lt;br&gt;&lt;br /&gt;pin 2 is set to pullup.&lt;br&gt;&lt;br /&gt;I output logic 0 on pin 1.&lt;br&gt;&lt;br /&gt;I read the value from pin 2 and store the result in a variable VAL1.&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Now I set pin 1 as a input (and pullup).&lt;br&gt;&lt;br /&gt;I set another pin, say pin 3 to logic 0 (not shorted to anything).&lt;br&gt;&lt;br /&gt;I output logic 0 on pin 3.&lt;br&gt;&lt;br /&gt;I read the value from pin 2 in to a variable VAL2.&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Now logically VAL1 should be 0 and VAL2 1. However that doesn't seem to be the case. If I do this I often read 1 for both VAL1 and VAL2. Removing the second read however makes VAL1 revert to it's correct value, EVEN THOUGH BOTH READS SHOULD BE INDEPENDENT!! I've not seen this with the AT90USBKey so it's a bit odd.&lt;br&gt;&lt;br&gt;&lt;br /&gt;The solution I've found is to place a delay loop after the port configuration but before the read, in my code:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;inline unsigned char get_scan(unsigned char pin) {&lt;br /&gt;&lt;br /&gt;  unsigned char p = 1 &amp;lt;&amp;lt; pin;&lt;br /&gt;&lt;br /&gt;  DDR = 0x00 ^ p;&lt;br /&gt;  PORTD = 0xFF ^ p;&lt;br /&gt;&lt;br /&gt;  for(volatile int i=0;i&amp;lt;100;i++);&lt;br /&gt;&lt;br /&gt;  return ~p &amp;amp; PIND;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The volatile is important, if you omit that it doesn't work. I guess the compiler optimizes it out. (volatile tells the compiler some other external code could change this variable so explicitly check it where ever it's referenced).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3777507771805824330?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3777507771805824330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3777507771805824330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3777507771805824330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3777507771805824330'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/03/avr-gcc-read-io-on-single-port-with.html' title='avr-gcc read I/O on single port with AT90USB162'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-6129060903187931656</id><published>2009-03-04T12:47:00.000-08:00</published><updated>2009-03-05T03:59:06.183-08:00</updated><title type='text'>jvterm: text based cut and based</title><content type='html'>&lt;br&gt;I've been trying to rid myself of the mouse. The final thing holding me back is cut and paste for terminal applications. Turns out that most Linux terminal programs don't have any support for keyboard based cut and paste. And in fact the only mainstream terminal app I've seen it in the The OS X Tiger Terminal.app (it seems to have been removed from later versions).&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Anyway, after some hunting I found a Linux terminal program that does text based cut and paste. It's called jvterm. The downside is that though it's an X11 application it's not really designed to run in concert with X. It only works full screen and you can't alt-tab between it and X applications. Anyway, I couldn't find the documentation for text based selection so here's typically how you might use it:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Press Shift twice to enter selection mode&lt;br&gt;&lt;br /&gt;Use the cursor keys to move to the start of the selection region&lt;br&gt;&lt;br /&gt;Press Shift again&lt;br&gt;&lt;br /&gt;Move to the end of the selection region (text will be highlighted)&lt;br&gt;&lt;br /&gt;Press space&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The text will now be on the clipboard. To paste it press Shift Twice and then Enter.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;This is a really neat feature, and I hope it finds its way in to other terminal applications.&lt;br&gt;&lt;br /&gt;&lt;img src="http://seehuhn.de/media/images/jvterm3-0964.png"&gt;&lt;br /&gt;&lt;br /&gt;(protip: Read the man page. I found this out from guessing, but it's actually in the man page).&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AHHH! You can do something similar with &lt;a href="https://mindloot.net/paste/werkzeug/gnu-screen-select-copy-paste/"&gt;screen&lt;/a&gt; but how do I get it to share the X clipboard?!?&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There's a urxvt (rxvt-unicode) perl script for this!&lt;br /&gt;&lt;br /&gt;I found it in google cache and have copied it here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sgenomics.org/mediawiki/index.php/Image:Mark-and-yank"&gt;HERE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To use it press alt-y to activate. Move using vi style keystrokes (hjkl) then press space to start selection and space to end. The text appears on you x buffer via xclip! Neato!&lt;br /&gt;&lt;br /&gt;To install the script copy it to ~/.urxvt The copy the following in to you ~/.Xdefaults:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;URxvt.keysym.M-y: perl:mark-and-yank:activate_mark_mode&lt;br /&gt;URxvt.keysym.M-u: perl:mark-and-yank:activate_mark_url_mode&lt;br /&gt;URxvt.perl-lib: /home/new/.urxvt/&lt;br /&gt;URxvt.perl-ext-common: tabbed,mark-and-yank&lt;br /&gt;URxvt.urlLauncher: firefox&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-6129060903187931656?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/6129060903187931656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=6129060903187931656' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6129060903187931656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/6129060903187931656'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/03/jvterm-text-based-cut-and-based.html' title='jvterm: text based cut and based'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5801966147865376416</id><published>2009-03-01T11:25:00.000-08:00</published><updated>2009-03-01T11:31:00.200-08:00</updated><title type='text'>Gaussian and Binomial distributions</title><content type='html'>I'm most probably being entirely stupid here...&lt;br /&gt;&lt;br /&gt;I've been trying to understand the Gaussian distribution and it's relation to the Binomial distribution. I've kind of decided that the Gaussian distribution is a continuous representation of the Binomial distribution. Is this correct?&lt;br /&gt;&lt;br /&gt;Anyway, here is some C++ which creates a binomial distribution by adding n random values (-1,0 or 1) to a fixed initial value. I think for this as a kind of 2D random walk. Here's the code:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;&lt;br /&gt;  vector&amp;lt;size_t&amp;gt; space(100,0);&lt;br /&gt;&lt;br /&gt;  size_t tries=1000000;&lt;br /&gt;  size_t offset=50;&lt;br /&gt;  for(size_t n=0;n&amp;lt;tries;n++) {&lt;br /&gt;&lt;br /&gt;    size_t moves=1000;&lt;br /&gt;&lt;br /&gt;    int final=50;&lt;br /&gt;    for(size_t t=0;t&amp;lt;moves;t++) {&lt;br /&gt;      int val = rand()%3;&lt;br /&gt;      val -= 1;&lt;br /&gt;&lt;br /&gt;      final +=val;&lt;br /&gt;    }&lt;br /&gt;    space[final]++;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  for(int n=0;n&amp;lt;space.size();n++) {&lt;br /&gt;    cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; space[n] &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here's the gnuplot generated from the output: &lt;br /&gt;&lt;br /&gt;&lt;img src="http://sgenomics.org/mediawiki/upload/b/bc/Plot.png"&gt;&lt;br /&gt;&lt;br /&gt;If you have any pointer on the link between Binomial and Gaussian distributions explained in a way a computer scientist can understand please add them below.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5801966147865376416?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5801966147865376416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5801966147865376416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5801966147865376416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5801966147865376416'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/03/gaussian-and-binomial-distributions.html' title='Gaussian and Binomial distributions'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-7377233830989270876</id><published>2009-02-28T16:09:00.000-08:00</published><updated>2011-09-30T16:27:12.151-07:00</updated><title type='text'>Simple XY plot with gnuplot</title><content type='html'>&lt;h1&gt;This blog post has moved &lt;a href="http://41j.com/blog/2011/09/simple-xy-plot-with-gnuplot/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-7377233830989270876?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/7377233830989270876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=7377233830989270876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7377233830989270876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/7377233830989270876'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/simple-xy-plot-with-gnuplot.html' title='Simple XY plot with gnuplot'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-2108187235443295549</id><published>2009-02-22T12:55:00.000-08:00</published><updated>2009-02-22T15:44:08.614-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file-handling'/><title type='text'>LaCie NAS Drive</title><content type='html'>I recently purchased a NAS ethernet drive from LaCie. They are pretty cheap these days - about a hundred quid. I'm sick of finding out that I downloaded a particular file to my laptop rather than my desktop or whatever and this seemed like a good solution. It works flawlessly on the MacBook through the LaCie provided software. Less so, with the openSuSe. &lt;br /&gt;&lt;br /&gt;I ended up installing everything in yast2 that even tangentically mentioned samba or netbios. I then opened up my firewall to the fullest extent possible, sacrificed two virgins, restarted netbios and samba a couple of times and lo and behold it worked. I then switched the firewall back on with samba and netbios selected as allowed services for the external zone and it seems happy enough with that. No real lesson learned here, just black magic. This is really just a note for other to let them know that it could in theory work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-2108187235443295549?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/2108187235443295549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=2108187235443295549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2108187235443295549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/2108187235443295549'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/lacie-nas-drive.html' title='LaCie NAS Drive'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4506286170143939294</id><published>2009-02-14T13:15:00.000-08:00</published><updated>2009-02-14T14:14:17.499-08:00</updated><title type='text'>Mirroring a mediawiki to another server</title><content type='html'>&lt;p&gt;There are lots of good guides on the interwebs on how to do this but I wanted to get a few notes down so I remember my preferred/installed method. These instructions are for Debian/Ubuntu and assume the target server doesn't have an existing mediawiki or mysql installation. All this needs to be done as root.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. Install mediawiki on the target server, install the same version.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. Delete /var/lib/mediawiki1.7 on the target server.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3. Dump the mysql permissions database on the source server: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;mysqldump -u root -pYOURPASSWORD --opt mysql &amp;gt; ~/mysql.sql&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;4. Copy that file over to the target file. Import it using the following command.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;mysql -pYOURPASSWORD -h 127.0.0.1 mysql &amp;lt; ~/mysql.sql&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;5. Setup a cron job on the source host to dump the mediawiki sql database every night. Type crontab -e to edit the crontab and add the following line:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;0 0 * * * mysqldump -u root -pYOURPASSWORD --opt wikidb &amp;gt; ~/wikidb.sql&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;6. On the target host, add cron jobs to copy across the database dump, the mediawiki config/uploaded files and to import the mediawiki database. Again do crontab -e and add the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;0 5 * * *  rsync -oglpvtr root@SOURCEHOST:/var/lib/mediawiki1.7 /var/lib &amp;gt; ~/backups/SOURCEHOST_mediawiki.log&lt;br /&gt;0 5 * * *  rsync -vtr root@SOURCEHOST:/root/wikidb.sql ~/wikidb.sql&lt;br /&gt;0 6 * * *  mysql -pYOURPASSWORD -h 127.0.0.1 wikidb &amp;lt; ~/wikidb.sql&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Protip: you'll need your ssh keys setup so you can do passwordless authentication.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4506286170143939294?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4506286170143939294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4506286170143939294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4506286170143939294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4506286170143939294'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/mirroring-mediawiki-to-another-server.html' title='Mirroring a mediawiki to another server'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1569831284590257756</id><published>2009-02-14T13:10:00.001-08:00</published><updated>2009-02-14T13:13:18.135-08:00</updated><title type='text'>The Viterbi algorithm</title><content type='html'>For your viewing pleasure I present an implementation of the Viterbi algorithm. I implemented this to help me understand the algorithm as presented in "Biological Sequence Analysis" by Durbin et al. The code solves the "occasionally dishonest casino, part 2". The example displays the output as copied from the book as well as it's own calculation so you can verify the results.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sgenomics.org/mediawiki/upload/4/43/Viterbi.tar.gz"&gt;&lt;br /&gt;Code here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1569831284590257756?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1569831284590257756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1569831284590257756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1569831284590257756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1569831284590257756'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/viterbi-algorithm.html' title='The Viterbi algorithm'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-4213367854766014007</id><published>2009-02-04T03:34:00.000-08:00</published><updated>2011-09-30T16:32:57.319-07:00</updated><title type='text'>tkz-graph example (A latex graph drawing package)</title><content type='html'>&lt;h1&gt;This blog post has moved &lt;a href="http://41j.com/blog/2011/09/tkz-graph-example-a-latex-graph-drawing-package/"&gt;here&lt;/a&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-4213367854766014007?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/4213367854766014007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=4213367854766014007' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4213367854766014007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/4213367854766014007'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/tkz-graph-example-latex-graph-drawing.html' title='tkz-graph example (A latex graph drawing package)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3131140737918762887</id><published>2009-02-04T02:58:00.001-08:00</published><updated>2009-02-04T03:14:26.255-08:00</updated><title type='text'>PGF and tkz-graph installation in Ubuntu</title><content type='html'>Ubuntu likes to keep it's texlive packages at least a year out of date, so if you want to install tkz-graph you need to install it and pgf manually. Create a directory called texmf in your home directory (mkdir ~/texmf). Create a subdirectory called tex (mkdir ~/texmf/tex). Create subdirectories of this called generic and latex. From the pgf tarball copy pgf-2.00/generic into the generic subdirectory. Copy pgf-2.00/latex to the latex subdirectory (you now have ~/texmf/generic/pgf and ~/texmf/latex/pgf. Download the tkz-graph style (tkz-graph.sty) and copy it to ~/texmf/latex. I copied it to ~/texmf/latex/prof I don't think that matters... Next "sudo texhash". That should do it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3131140737918762887?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3131140737918762887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3131140737918762887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3131140737918762887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3131140737918762887'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/pgf-and-tkf-graph-installation-in.html' title='PGF and tkz-graph installation in Ubuntu'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5130973903135787211</id><published>2009-02-03T07:55:00.001-08:00</published><updated>2009-02-03T07:56:36.032-08:00</updated><title type='text'>Download a bunch of papers from a journal</title><content type='html'>Say you want to download a bunch of pdf files from a webpage. You want to do this remotely over ssh so those cool firefox extensions are our of the question. Use wget. For example:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;tsocks wget -r -l1 -t1 -N -A.pdf -erobots=off http://www.springerlink.com/content/x49g43t85772/ &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Does the job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5130973903135787211?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5130973903135787211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5130973903135787211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5130973903135787211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5130973903135787211'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/download-bunch-of-papers-from-journal.html' title='Download a bunch of papers from a journal'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-3950613810100116437</id><published>2009-02-03T05:30:00.000-08:00</published><updated>2009-02-03T05:33:08.136-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='phonefail'/><category scheme='http://www.blogger.com/atom/ns#' term='gsm'/><category scheme='http://www.blogger.com/atom/ns#' term='openmoko'/><title type='text'>Openmoko freerunner with vodafone DE sim card</title><content type='html'>Just a note to mention for anyone curious that I managed to get a 3G german vodafone sim working with OM 2008.12 by flashing the gsm firmware to moko10. Whilst the wiki advises using shr I found it didn't make any difference. Still have to test this with 3 cards from the UK but hopefully some of them will work now too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-3950613810100116437?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/3950613810100116437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=3950613810100116437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3950613810100116437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/3950613810100116437'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/openmoko-freerunner-with-vodafone-de.html' title='Openmoko freerunner with vodafone DE sim card'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5310283495485617932</id><published>2009-02-03T05:21:00.000-08:00</published><updated>2009-02-03T05:27:45.767-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='keyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='silc'/><title type='text'>Silc client won~t accept the / (backslash) key</title><content type='html'>I use silc as a replacement for things like irc. Most of the time I think its great. It provides secure and simple encryption and allows me to waste time instead of actually working. Well that last bit is a tad unfair as I learn a lot of things on there.&lt;br /&gt;&lt;br /&gt;Anyways, for the last while, it has been impossible for me to enter the backslash character in a session. This is regardless of the keyboard layout on the client computer, the OS and was a seemingly random error. Today I erased the .silc/silc.conf file and restarted the silc client. Success - I am now able to connect to the server once again. The most infuriating aspect of this is that the error occured during a running session. When I copied urls into that session none of the slash characters would be displayed on the screen. Which was funny at first but very annoying once I restarted silc only to discover that I couldn't now type /connect. Which was funny for about 30 seconds. So there you go. If you are ever in the situation where you can't enter the slash key in a silc client just remove the configuration file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5310283495485617932?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5310283495485617932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5310283495485617932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5310283495485617932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5310283495485617932'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/silc-client-wont-accept-backslash-key.html' title='Silc client won~t accept the / (backslash) key'/><author><name>nobodycares</name><uri>http://www.blogger.com/profile/11853586434250627276</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-5988656041066011085</id><published>2009-02-03T02:14:00.000-08:00</published><updated>2009-02-14T13:14:42.650-08:00</updated><title type='text'>Replacing a string in vim to fix an dxf file</title><content type='html'>I have an DXF file that has entries that look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;LCD.1&lt;br /&gt;70&lt;br /&gt;64&lt;br /&gt;62&lt;br /&gt;150&lt;br /&gt;6&lt;br /&gt;CONTINUOUS&lt;br /&gt;0&lt;br /&gt;LAYER&lt;br /&gt;2&lt;br /&gt;LCDMOUNT.1&lt;br /&gt;70&lt;br /&gt;64&lt;br /&gt;62&lt;br /&gt;252&lt;br /&gt;6&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Autocad doesn't like this file... I have no idea what created it. After much screwing around I've discovered that it doesn't like the "."s in the entity (or whatever they're called) names. Load the file in vim and use the following regexp to get rid of the dots.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;%s/\([A-Z]\)\.\([0-9]\+\)/\1\2/g&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fixed file looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;LCD1&lt;br /&gt;70&lt;br /&gt;64&lt;br /&gt;62&lt;br /&gt;150&lt;br /&gt;6&lt;br /&gt;CONTINUOUS&lt;br /&gt;0&lt;br /&gt;LAYER&lt;br /&gt;2&lt;br /&gt;LCDMOUNT1&lt;br /&gt;70&lt;br /&gt;64&lt;br /&gt;62&lt;br /&gt;252&lt;br /&gt;6&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;FYI, the \( \) are delimiters in the search sequence. \1 and \2 reference back to these.&lt;br /&gt;&lt;br /&gt;Addition: The file in question was produced by a program called "Camera 3D" or "3D Camera" or something... Just in case anyone else has the same problem with this code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-5988656041066011085?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/5988656041066011085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=5988656041066011085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5988656041066011085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/5988656041066011085'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/02/replacing-string-in-vim-to-fix-dxf-file.html' title='Replacing a string in vim to fix an dxf file'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-399726703363684195</id><published>2009-01-26T07:49:00.000-08:00</published><updated>2009-01-26T07:57:55.420-08:00</updated><title type='text'>Merging in Subversion</title><content type='html'>Merging in subversion doesn't work like you'd think it'd work. You don't say "take this branch and apply all the changes to trunk". No... you say "calculate the differences between this branch and and older revision then apply these changes to trunk". That's very different. Because of this you need to note the revision at which you're branch was made and use this when merging. Here's a quick example:&lt;br /&gt;&lt;br /&gt;Make a branch:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;svn copy trunk ./branches/nw3&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;NOTE THE REVISION NUMBER (basenum) AND LEAVE A USEFUL LOG COMMENT. OK, now make edits commit them etc on the branch. At some point you want to merge the changes in to trunk (run this while in the trunk directory):&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;svn merge -r basenum:currentrev https://swiftng.svn.sourceforge.net/svnroot/swiftng/trunk&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Where basenum is the revision number at which the branch was made and currentrev is the current revision.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-399726703363684195?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/399726703363684195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=399726703363684195' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/399726703363684195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/399726703363684195'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/01/merging-in-subversion.html' title='Merging in Subversion'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8717593967327947380.post-1507137055397263136</id><published>2009-01-18T15:34:00.000-08:00</published><updated>2011-09-28T13:09:49.289-07:00</updated><title type='text'>Beagleboard GPIO Input (driverless)</title><content type='html'>&lt;H1&gt;This blog post has moved &lt;a href="http://41j.com/blog/?p=223"&gt;HERE&lt;/a&gt;&lt;/H1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8717593967327947380-1507137055397263136?l=linuxjunk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxjunk.blogspot.com/feeds/1507137055397263136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8717593967327947380&amp;postID=1507137055397263136' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1507137055397263136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8717593967327947380/posts/default/1507137055397263136'/><link rel='alternate' type='text/html' href='http://linuxjunk.blogspot.com/2009/01/beagleboard-gpio-input-driverless.html' title='Beagleboard GPIO Input (driverless)'/><author><name>new</name><uri>http://www.blogger.com/profile/12129570461272996080</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry></feed>
