<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <id>http://auxbuss.com/</id>
  <title>Auxbuss</title>
  <updated>2012-01-20T00:00:00Z</updated>
  <link rel="alternate" href="http://auxbuss.com/" />
  
  <author>
    <name>Marc Cooper</name>
    <uri>http://auxbuss.com</uri>
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/auxbuss" /><feedburner:info uri="auxbuss" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <id>tag:auxbuss.com,2012-01-20:/blog/posts/2012_01_20_tmux_copy_paste_with_clipboard/</id>
    <title type="html">how to copy and paste between a tmux buffer and the X the clipboard</title>
    <published>2012-01-20T00:00:00Z</published>
    <updated>2012-01-20T00:00:00Z</updated>
    <link rel="alternate" href="http://feedproxy.google.com/~r/auxbuss/~3/t86Wj79J5G8/" />
    <content type="html">&lt;p&gt;tmux does not provide a native way to copy and paste between its buffers
and other applications. Here are two lines to add to &lt;code&gt;tmux.conf&lt;/code&gt; that provide
these missing features. Note that &lt;code&gt;xclip&lt;/code&gt; must be installed for this to work.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux show-buffer | xclip -i"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;How you access the data from the X clipboard will depend on your set-up.
Commonly, in vim you use &lt;code&gt;"*p&lt;/code&gt;, and elsewhere, clicking the middle mouse
button usually works effectively.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/auxbuss/~4/t86Wj79J5G8" height="1" width="1"/&gt;</content>
    <summary type="html">tmux does not provide a native way to copy and paste between its buffers and other applications. Here are two lines to `tmux.conf` that provide these missing features.</summary>
  <feedburner:origLink>http://auxbuss.com/blog/posts/2012_01_20_tmux_copy_paste_with_clipboard/</feedburner:origLink></entry>
  <entry>
    <id>tag:auxbuss.com,2011-07-12:/blog/posts/2011_07_12_setting_no_atime/</id>
    <title type="html">improving disk performance by setting noatime</title>
    <published>2011-07-11T23:00:00Z</published>
    <updated>2011-07-11T23:00:00Z</updated>
    <link rel="alternate" href="http://feedproxy.google.com/~r/auxbuss/~3/XlctV4uxGNE/" />
    <content type="html">&lt;p&gt;Every time a file is accessed, its inode is updated;
this is called the file’s &lt;code&gt;atime.&lt;/code&gt; There are similar times recorded
when the file is modified (&lt;code&gt;mtime&lt;/code&gt;), and created (&lt;code&gt;ctime&lt;/code&gt;). But since
&lt;code&gt;atime&lt;/code&gt; is written every time a file is read, depending on the
behaviour of the system this may have a measurable impact
on performance.&lt;/p&gt;

&lt;p&gt;Nevertheless, note that some application do make use of atime, but
they are in the minority.&lt;/p&gt;

&lt;p&gt;You can configure the behaviour of the inode update in &lt;code&gt;/etc/fstab&lt;/code&gt;
via the following settings, see &lt;code&gt;man mount&lt;/code&gt; for more detail: &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;atime&lt;/code&gt;: update on access&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;noatime&lt;/code&gt;: do not update&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;relatime&lt;/code&gt;: update atime if it is older than mtime&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Through Linux 2.6.29, atime was the default.
As of 2.6.30 (9 June 2009), relatime is the default.&lt;/p&gt;

&lt;p&gt;You can reset this mount option without restarting the system:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# sudo vim /etc/fstab
dev/sda1 / ext3    defaults,noatime        1 1
# sudo mount -o remount /
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To check: &lt;code&gt;$ mount&lt;/code&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/auxbuss/~4/XlctV4uxGNE" height="1" width="1"/&gt;</content>
    <summary type="html">Every time a file is accessed its inode is updated. Depending on the behaviour of the system, setting its mount option to `noatime` may have a measurable impact on performance.</summary>
  <feedburner:origLink>http://auxbuss.com/blog/posts/2011_07_12_setting_no_atime/</feedburner:origLink></entry>
  <entry>
    <id>tag:auxbuss.com,2011-06-28:/blog/posts/2011_06_28_ssl_session_caching_on_nginx/</id>
    <title type="html">SSL session caching in nginx</title>
    <published>2011-06-27T23:00:00Z</published>
    <updated>2011-07-12T23:00:00Z</updated>
    <link rel="alternate" href="http://feedproxy.google.com/~r/auxbuss/~3/ZWzq1c4ob7M/" />
    <content type="html">&lt;p&gt;Sessions in SSL/TLS have been around since SSL v2. They allow multiple
connections to use the same key data to calculate encryption keys for the
connection instead of performing a full negotiation to determined the
encryption keys. Since they are reusing data previously exchanged securely,
a secure connection can be established very quickly. The alternative is to
perform the full negotiation for every connection, which is a costly process.&lt;/p&gt;

&lt;p&gt;To activate the SSL session cache in nginx, add the following to your &lt;code&gt;nginx.conf&lt;/code&gt;:&lt;/p&gt;

&lt;pre class="syntax"&gt;&lt;code class="language-nginx"&gt;    &lt;span class="k"&gt;worker_processes&lt;/span&gt;  &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    
    &lt;span class="k"&gt;http&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;ssl_session_cache&lt;/span&gt;    &lt;span class="s"&gt;shared:SSL:10m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;ssl_session_timeout&lt;/span&gt;  &lt;span class="mi"&gt;10m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;ssl_ciphers&lt;/span&gt; &lt;span class="s"&gt;ALL:!kEDH!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This creates a shared cache (shared by all the worker processes) of 10Mb.
1Mb holds approximately 4,000 sessions. The default cache timeout is
five minutes, here it’s been increased to ten minutes.&lt;/p&gt;

&lt;p&gt;Note that when you have multiple processors available you should use them
by increasing the &lt;code&gt;worker_processes&lt;/code&gt; parameter to a value not less than
the available cores. The SSL handshake is a processor intensive task, so
utilising the processors is beneficial.&lt;/p&gt;

&lt;p&gt;To reduce the number of handshakes further, increase &lt;code&gt;keepalive_timeout&lt;/code&gt;.
This allows multiple requests per connection.&lt;/p&gt;

&lt;pre class="syntax"&gt;&lt;code class="language-nginx"&gt;    &lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;listen&lt;/span&gt;               &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;server_name&lt;/span&gt;          &lt;span class="s"&gt;www.nginx.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;keepalive_timeout&lt;/span&gt;    &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once you have this configured, you can test that it is working by running the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    $ gnutls-cli -V -r HOSTNAME |grep 'Session ID'
    - Session ID: 90:5B:99:E5:...
    - Session ID: 90:5B:99:E5:...
    - Session ID: 90:5B:99:E5:...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Providing all three Session IDs are the same, then SSL session caching is operational.&lt;/p&gt;

&lt;h3 id="a-final-note-about-using-a-faster-cipher"&gt;A final note about using a faster cipher&lt;/h3&gt;

&lt;p&gt;Finally, note the following line from above:&lt;/p&gt;

&lt;pre class="syntax"&gt;&lt;code class="language-nginx"&gt;    &lt;span class="k"&gt;ssl_ciphers&lt;/span&gt; &lt;span class="s"&gt;ALL:!kEDH!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is the nginx default with the addition of &lt;code&gt;!kEDH&lt;/code&gt;. This removes the slow DHE-RSA-AES256-SHA cipher
from being selected. You can see the list of supported ciphers on you server via:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    $ openssl ciphers
    DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:
    EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DES-CBC3-MD5:DHE-RSA-AES128-SHA:
    DHE-DSS-AES128-SHA:AES128-SHA:RC2-CBC-MD5:RC4-SHA:RC4-MD5:RC4-MD5:
    EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:DES-CBC-MD5:
    EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:
    EXP-RC2-CBC-MD5:EXP-RC2-CBC-MD5:EXP-RC4-MD5:EXP-RC4-MD5
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can check whiich cipher your site is using via:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    $ openssl s_client -host YOUR_HOSTNAME -port 443
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With the nginx defaults you will see the DHE-RSA-AES256-SHA ciper being used:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and after the faster AES256-SHA cipher:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    New, TLSv1/SSLv3, Cipher is AES256-SHA
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id="references"&gt;References&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://nginx.org/en/docs/http/configuring_https_servers.html"&gt;Configuring HTTPS servers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://my.opera.com/yngve/blog/2011/06/23/popular-but-sluggish-secure-server-popularity-might-not-be-the-reason"&gt;Popular, but sluggish secure server? Popularity might not be the reason&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://hezmatt.org/~mpalmer/blog/general/ssl_session_caching_in_nginx.html"&gt;SSL Session Caching (in nginx)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://wiki.nginx.org/HttpSslModule"&gt;HttpSslModule&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://matt.io/technobabble/hivemind_devops_alert:_nginx_does_not_suck_at_ssl/ur"&gt;hivemind devops alert: nginx does not suck at ssl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;img src="http://feeds.feedburner.com/~r/auxbuss/~4/ZWzq1c4ob7M" height="1" width="1"/&gt;</content>
    <summary type="html">Sessions in SSL/TLS have been around since SSL v2. They allow multiple connections to use the same key data to calculate encryption keys for the connection instead of performing a full negotiation to determined the encryption keys. Since they are reusing data previously exchanged securely, a secure connection can be established very quickly. The alternative is to perform the full negotiation for every connection, which is a costly process.</summary>
  <feedburner:origLink>http://auxbuss.com/blog/posts/2011_06_28_ssl_session_caching_on_nginx/</feedburner:origLink></entry>
  <entry>
    <id>tag:auxbuss.com,2011-06-25:/blog/posts/2011_06_25_git_resetting_a_remote_repository/</id>
    <title type="html">git - resetting a remote repository</title>
    <published>2011-06-24T23:00:00Z</published>
    <updated>2011-06-24T23:00:00Z</updated>
    <link rel="alternate" href="http://feedproxy.google.com/~r/auxbuss/~3/FJpwcB6y7ec/" />
    <content type="html">&lt;p&gt;It can sometimes be useful to remove the commit history for a project
that is under git. and basically make the latest state be the first
commit. An example use case might be when uploading to github.&lt;/p&gt;

&lt;p&gt;However, if other folk are using the bare repo, then you need to let
them know what you are doing.&lt;/p&gt;

&lt;p&gt;The process is not at all complex. But first, ensure you have a backup
copy of your project somewhere safe.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code&gt;cd project_directory&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;mv .git/config ~/saved_git_config&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;rm -rf .git&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git commit -m 'Initial commit'&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;mv ~/saved_git_config .git/config&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git push --force origin master&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you instead, or also, want to push to github (or somewhere else) then do
something like this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code&gt;git remote add github git@github.com:github_user_name/github_project_name.git&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git config branch.master.merge refs/heads/master&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;git push -u github master&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;img src="http://feeds.feedburner.com/~r/auxbuss/~4/FJpwcB6y7ec" height="1" width="1"/&gt;</content>
    <summary type="html">It can sometimes be useful to remove the commit history for a project that is under git. and basically make the latest state be the first commit. An example use case might be when uploading to github.</summary>
  <feedburner:origLink>http://auxbuss.com/blog/posts/2011_06_25_git_resetting_a_remote_repository/</feedburner:origLink></entry>
</feed>

