<?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:blogger='http://schemas.google.com/blogger/2008' 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-5236804648000183067</id><updated>2024-09-02T00:03:07.907-07:00</updated><title type='text'>oh, unix</title><subtitle type='html'>how did I do that thing again?</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5236804648000183067.post-1486700492923852869</id><published>2011-06-27T07:22:00.000-07:00</published><updated>2011-06-27T07:22:33.340-07:00</updated><title type='text'>Cat to or from clipboard in Terminal</title><content type='html'>On a Mac, &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;man pbcopy&lt;/span&gt; or &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pbpaste&lt;/span&gt; to see how to redirect into or out of your pasteboard/clipboard. With pbpaste, &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;-Prefer txt&lt;/span&gt; can be useful to ensure ascii output.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cat file.txt | pbcopy&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pbpaste -Prefer txt &amp;gt; out.txt&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Yay.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/1486700492923852869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ohunix.blogspot.com/2011/06/cat-to-or-from-clipboard-in-terminal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/1486700492923852869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/1486700492923852869'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/2011/06/cat-to-or-from-clipboard-in-terminal.html' title='Cat to or from clipboard in Terminal'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5236804648000183067.post-391489253836399176</id><published>2011-06-21T15:10:00.000-07:00</published><updated>2011-06-27T07:07:34.103-07:00</updated><title type='text'>Rotate tablet PC screen with a single button in Ubuntu 11.04</title><content type='html'>Someone asked me for help on tablet screen rotation in Ubuntu for an older (2006) Lenovo X60 tablet PC - in particular, the desire was to make it as simple as possible to flip the screen 180 degrees since on this model, for right-handers, a flipped screen is more comfortable ergonomically for....tableting. Simplicity suggested a big noticeable blue button on the Unity 11.04 Launcher (the slide out bar on the left). Being new to Unity myself, there were a couple of quirks to figure out.&lt;br /&gt;
&lt;br /&gt;
My goal was to add a button to the launcher that would fire off a shell script. The script relies on xrandr (for screen rotation) and xsetwacom (for the stylus to map correctly to the rotated screen). They&#39;re easy to use after some manpage-skimming and they don&#39;t require elevated privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/1038968.js?file=screen-rotate.sh&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
Now, how to add it to the Unity launcher bar? Either you can create a .desktop file from scratch or you can use the menu option for creating a launcher, and repurpose the .desktop to point to your script. Here&#39;s the one I used, which also points to a serviceable picture of a generic monitor icon, courtesy of Gnome.&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/1039022.js?file=screen-rotate.desktop&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
After dragging it to the launcher and a re-login, the button does the intended trick.&lt;br /&gt;
&lt;br /&gt;
And here are a couple of&amp;nbsp;&lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1675299&quot;&gt;useful&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1700605&quot;&gt;links&lt;/a&gt;&amp;nbsp;to ubuntuforums.org posts that told me everything I needed to know to rush out the above tidbits.</content><link rel='replies' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/391489253836399176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ohunix.blogspot.com/2011/06/rotate-tablet-pc-screen-with-single.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/391489253836399176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/391489253836399176'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/2011/06/rotate-tablet-pc-screen-with-single.html' title='Rotate tablet PC screen with a single button in Ubuntu 11.04'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5236804648000183067.post-965859136013811916</id><published>2011-06-02T16:36:00.000-07:00</published><updated>2011-06-02T16:43:59.067-07:00</updated><title type='text'>Keeping your idle ssh connection alive (the wrong way)</title><content type='html'>Need to keep an ssh connection alive? Maybe you&#39;re doing it wrong - use &lt;a href=&quot;http://en.wikipedia.org/wiki/Nohup&quot;&gt;nohup&lt;/a&gt;. Can&#39;t? Got some weird corner case that needs a living ssh connection with some process doing something in the foreground? You could always use expect/pexpect. But that&#39;s too much trouble! This python script is a quick and dirty way of doing it wrong:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #ce00a5; font-family: Menlo; font-size: 11px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #ce00a5; font-family: Menlo; font-size: 11px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp;time&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;p1&quot; style=&quot;color: #ce00a5; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;import&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp;sys&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;color: #ce00a5; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;def&lt;/span&gt;&amp;nbsp;infinite():&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;i =&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;while&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p4&quot; style=&quot;color: #e50000; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&quot;been asleep for &quot;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;, i ,&lt;/span&gt;&quot;hours&quot;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;time.sleep(&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;60&lt;/span&gt;&amp;nbsp;*&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;60&lt;/span&gt;)&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;i +=&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;def&lt;/span&gt;&amp;nbsp;sleeper(minutes):&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;print&lt;/span&gt;&amp;nbsp;time.strftime(&lt;span class=&quot;s4&quot; style=&quot;color: #e50000;&quot;&gt;&quot;%a, %d %b %Y %I:%M:%S +0000&quot;&lt;/span&gt;, time.localtime())&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;time.sleep(minutes *&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;60&lt;/span&gt;)&lt;/div&gt;&lt;div class=&quot;p5&quot; style=&quot;color: #3800e2; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&#39;awaking&#39;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;print&lt;/span&gt;&amp;nbsp;time.strftime(&lt;span class=&quot;s4&quot; style=&quot;color: #e50000;&quot;&gt;&quot;%a, %d %b %Y %I:%M:%S +0000&quot;&lt;/span&gt;, time.localtime())&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;def&lt;/span&gt;&amp;nbsp;main():&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;if&lt;/span&gt;&amp;nbsp;len(sys.argv) !=&amp;nbsp;&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;2&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;print&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s4&quot; style=&quot;color: #e50000;&quot;&gt;&quot;fail!&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;if&lt;/span&gt;&amp;nbsp;sys.argv[&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;1&lt;/span&gt;] ==&amp;nbsp;&lt;span class=&quot;s4&quot; style=&quot;color: #e50000;&quot;&gt;&quot;infinite&quot;&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;infinite()&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sleeper(int(sys.argv[&lt;span class=&quot;s3&quot; style=&quot;color: #3800e2;&quot;&gt;1&lt;/span&gt;]))&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #ce00a5;&quot;&gt;if&lt;/span&gt;&amp;nbsp;__name__ ==&lt;span class=&quot;s4&quot; style=&quot;color: #e50000;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;main()&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;Usage:&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;python keepawake.py 60&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;Sleeps for 60 minutes&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;python keepawake.py infinite&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;sleeps until you Ctrl+C&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;/span&gt;If you&#39;re using this often (why?! You&#39;re doing it wrong!) then of course just throw in an alias within your .bashrc:&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p2&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;alias keepawake=&#39;python ~/path/to/keepawake.py&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
And now you can call:&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;keepawake 60&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;keepawake infinite&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;whenever your heart desires.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/965859136013811916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ohunix.blogspot.com/2011/06/keeping-your-idle-ssh-connection-alive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/965859136013811916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/965859136013811916'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/2011/06/keeping-your-idle-ssh-connection-alive.html' title='Keeping your idle ssh connection alive (the wrong way)'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5236804648000183067.post-1999579280443587469</id><published>2011-06-02T16:13:00.000-07:00</published><updated>2011-06-27T07:32:18.141-07:00</updated><title type='text'>Get colors from Terminal, and pasting into vim from other programs</title><content type='html'>In seeking an answer to copying terminal output with ANSI-style colors, thanks goes to &lt;a href=&quot;http://superuser.com/questions/229022/copy-colored-output-from-mac-os-x-terminal&quot;&gt;this&lt;/a&gt; question. I wanted to get colored output from Mac OS X&#39;s Terminal, and the easiest way was to print to a pdf and copy from there.&lt;br /&gt;
&lt;br /&gt;
Also, here&#39;s the right way to paste into vim from an external source (such as a &lt;a href=&quot;http://ohunix.blogspot.com/2011/06/usable-parenthesis-matching-in-vim.html&quot;&gt;gist&lt;/a&gt;) because I seem to forget this (since I&#39;m usually pasting from vim into vim). To avoid vim&#39;s auto-indenting or auto-commenting as the lines are written from the pastebuffer into vim, to enter paste mode just&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:set paste&lt;/span&gt;&lt;br /&gt;
and then, back in insert mode, Ctrl+v or Command+v or whatever suits your fancy. Once you&#39;re done,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:set nopaste&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;You&#39;ve now sidestepped all that pesky smart indentation/commenting.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/1999579280443587469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ohunix.blogspot.com/2011/06/get-colors-from-terminal-and-pasting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/1999579280443587469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/1999579280443587469'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/2011/06/get-colors-from-terminal-and-pasting.html' title='Get colors from Terminal, and pasting into vim from other programs'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5236804648000183067.post-4568077880942172051</id><published>2011-06-02T15:40:00.000-07:00</published><updated>2011-06-27T07:23:19.329-07:00</updated><title type='text'>Usable parenthesis matching in vim</title><content type='html'>I&#39;ll post my messy hodgepodge vim configuration below but the only part worth highlighting (no pun intended) is the following trick for making vim not do terribly confusing parenthesis matching:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #00c700; font-family: Monaco; font-size: 12px;&quot;&gt;&lt;span class=&quot;s2&quot; style=&quot;color: #acb200;&quot;&gt;&amp;nbsp; &amp;nbsp;hi&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;MatchParen&amp;nbsp;&lt;/span&gt;cterm&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #e900d8;&quot;&gt;bold&amp;nbsp;&lt;/span&gt;ctermbg&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;color: #e900d8;&quot;&gt;none&amp;nbsp;&lt;/span&gt;ctermfg&lt;span class=&quot;s3&quot; style=&quot;color: black;&quot;&gt;=red&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Serviceable&amp;nbsp;explanation &lt;a href=&quot;http://design.liberta.co.za/articles/customizing-disabling-vim-matching-parenthesis-highlighting/&quot;&gt;here&lt;/a&gt;. It&#39;s pretty self explanatory though: this changes the foreground (and background if you so choose - yellow is serviceable) of the matched parenthesis to something a little more distinctive so you don&#39;t lose track of where your cursor is. Default matching always makes me confused whenever I&#39;m navigating around, especially in&amp;nbsp;parenthesis-heavy code. And I guess it&#39;s nice that you can just use color names like white or green, even though that bugs me, because I have no idea if it will support, say, fuchsia... or glaucous. (I think it probably just supports basic 256-color&amp;nbsp;palette&amp;nbsp;names, but feel free to comment with a link to the specification or vim source)&lt;br /&gt;
&lt;br /&gt;
And for posterity, my whole vimrc, with some comments mixed in:&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/1048929.js?file=gistfile1.vim&quot;&gt;&lt;/script&gt;&lt;br /&gt;
More vim tips to come in the next post.</content><link rel='replies' type='application/atom+xml' href='http://ohunix.blogspot.com/feeds/4568077880942172051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ohunix.blogspot.com/2011/06/usable-parenthesis-matching-in-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/4568077880942172051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5236804648000183067/posts/default/4568077880942172051'/><link rel='alternate' type='text/html' href='http://ohunix.blogspot.com/2011/06/usable-parenthesis-matching-in-vim.html' title='Usable parenthesis matching in vim'/><author><name>mark</name><uri>http://www.blogger.com/profile/16857708549339482907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>