<?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-3516653391373273766</id><updated>2026-07-25T14:05:47.829+06:00</updated><category term="linux"/><category term="ubuntu"/><category term="java"/><category term="python"/><category term="git"/><category term="c++"/><category term="emacs"/><category term="heap"/><category term="maven"/><category term="php"/><category term="post"/><category term="vim"/><category term="программирование"/><category term="bash"/><category term="django"/><category term="eclipse"/><category term="get"/><category term="hotkeys"/><category term="jdk"/><category term="productivity"/><category term="terminal"/><category term="timestamp"/><category term="K750i"/><category term="Scorpions"/><category term="appengine"/><category term="apt-get"/><category term="aptitude"/><category term="backup"/><category term="bom"/><category term="boost"/><category term="brightness"/><category term="caching"/><category term="checksum"/><category term="chrome"/><category term="compress"/><category term="ctags"/><category term="deadlock"/><category term="dependencies"/><category term="dm5"/><category term="editor"/><category term="environment"/><category term="errors"/><category term="gmail"/><category term="groups"/><category term="gui"/><category term="gunzip"/><category term="hamster"/><category term="http"/><category term="https"/><category term="java xml"/><category term="javascript"/><category term="jdk6"/><category term="jetty"/><category term="json"/><category term="kernel"/><category term="lifehack"/><category term="links"/><category term="log4j"/><category term="meld"/><category term="memory"/><category term="mounting"/><category term="mutex"/><category term="ports"/><category term="postgresql"/><category term="ps"/><category term="pydev"/><category term="rescuetime"/><category term="snippets"/><category term="sqlite"/><category term="static"/><category term="sudo"/><category term="sync"/><category term="tags"/><category term="tcpflow"/><category term="timetracking"/><category term="tools"/><category term="tutorials"/><category term="ubuntu. howto"/><category term="uml"/><category term="uncompress"/><category term="unity"/><category term="unix"/><category term="usb"/><category term="utf-8"/><category term="web"/><category term="xml"/><category term="автомобили"/><category term="гаи"/><category term="губернатор"/><category term="привет"/><title type='text'>How-tos, snippets and tutorials.</title><subtitle type='html'>Here I share my experience.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>147</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3516653391373273766.post-3036228612939513294</id><published>2012-04-23T16:54:00.002+07:00</published><updated>2012-04-23T16:54:16.916+07:00</updated><title type='text'>Best /etc/hosts ever</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
127.0.0.1&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;localhost&lt;br /&gt;
&lt;br /&gt;
# Distracting sites&lt;br /&gt;
127.0.0.1 vkontakte.ru&lt;br /&gt;
127.0.0.1 vk.com&lt;br /&gt;
127.0.0.1 facebook.com&lt;br /&gt;
127.0.0.1 fb.me&lt;br /&gt;
127.0.0.1 mamba.ru&lt;br /&gt;
127.0.0.1 plus.google.com&lt;br /&gt;
127.0.0.1 twitter.com&lt;br /&gt;
127.0.0.1 odnoklassniki.ru&lt;br /&gt;
127.0.0.1 moikrug.ru&lt;br /&gt;
127.0.0.1 linkedin.com&lt;br /&gt;
&lt;br /&gt;
127.0.0.1 youtube.com&lt;br /&gt;
127.0.0.1 habrahabr.ru&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/3036228612939513294/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2012/04/best-etchosts-ever.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3036228612939513294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3036228612939513294'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2012/04/best-etchosts-ever.html' title='Best /etc/hosts ever'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-4396792287816457962</id><published>2012-04-19T18:20:00.002+07:00</published><updated>2012-04-19T18:20:40.794+07:00</updated><title type='text'>How to set a bookmark in Emacs?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;background-color: white; padding-top: 0.5em; text-align: -webkit-auto;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 1em;&quot;&gt;&lt;code&gt;‘C-x r m’&lt;/code&gt;&amp;nbsp;– set a bookmark at the current location (e.g. in a file)&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 1em;&quot;&gt;&lt;code&gt;‘C-x r b’&lt;/code&gt;&amp;nbsp;– jump to a bookmark&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 1em;&quot;&gt;&lt;code&gt;‘C-x r l’&lt;/code&gt;&amp;nbsp;– list your bookmarks&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 1em;&quot;&gt;&lt;code&gt;‘M-x bookmark-delete’&lt;/code&gt;&amp;nbsp;– delete a bookmark by name&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background: transparent !important; border-color: none !important; display: none; left: 0; margin: 0 !important; opacity: 1 !important; overflow: visible !important; padding: 0 !important; position: absolute !important; text-align: left !important; top: 0; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/4396792287816457962/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2012/04/how-to-set-bookmark-in-emacs.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4396792287816457962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4396792287816457962'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2012/04/how-to-set-bookmark-in-emacs.html' title='How to set a bookmark in Emacs?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-1781763377818308411</id><published>2012-04-18T19:19:00.002+07:00</published><updated>2012-04-20T16:02:59.358+07:00</updated><title type='text'>How to configure clean Debian machine for Ruby development</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
# apt-get update&lt;br /&gt;
# sudo apt-get install emacs wget ruby-full ruby-dev build-essential libpq-dev sudo&amp;nbsp;libsqlite3-dev apache2&lt;br /&gt;
# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.22.tgz&lt;br /&gt;
#&amp;nbsp;tar xzf rubygems-1.8.22.tgz&lt;br /&gt;
#&amp;nbsp;cd rubygems-1.8.22&lt;br /&gt;
#&amp;nbsp;sudo ruby setup.rb&lt;br /&gt;
# gem install rails&lt;br /&gt;
# adduser gennad&lt;br /&gt;
&lt;br /&gt;
# apt-get install -y libcurl4-openssl-dev &amp;nbsp;zlib1g-dev apache2-prefork-dev libapr1-dev libaprutil1-dev&lt;br /&gt;
# gem install passenger&lt;br /&gt;
#&amp;nbsp;passenger-install-apache2-module&lt;br /&gt;
# rails new myapp&lt;br /&gt;
echo &quot;gem &#39;therubyracer&#39;&quot; &amp;gt;&amp;gt; myapp/Gemfile&lt;br /&gt;
cd myapp&lt;br /&gt;
bundle install&lt;br /&gt;
&lt;br /&gt;
# emacs /etc/sudoers &amp;nbsp;# edit sudoers t include gennad user there&lt;br /&gt;
# su gennad&lt;br /&gt;
&lt;br /&gt;
# emacs config/environments/production.rb&lt;br /&gt;
...&lt;br /&gt;
config.assets.compile = true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/1781763377818308411/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2012/04/how-to-configure-clean-debian-machine.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1781763377818308411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1781763377818308411'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2012/04/how-to-configure-clean-debian-machine.html' title='How to configure clean Debian machine for Ruby development'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-4492797380462847583</id><published>2011-11-15T17:49:00.001+07:00</published><updated>2011-11-15T17:49:57.506+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ctags"/><category scheme="http://www.blogger.com/atom/ns#" term="tags"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>How to generate tags for any project for navigating in VIM?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
$ ctags -R&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background: transparent !important; border-color: none !important; display: none; left: 0; margin: 0 !important; opacity: 1 !important; overflow: visible !important; padding: 0 !important; position: absolute !important; text-align: left !important; top: 0; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/4492797380462847583/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/11/how-to-generate-tags-for-any-project.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4492797380462847583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4492797380462847583'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/11/how-to-generate-tags-for-any-project.html' title='How to generate tags for any project for navigating in VIM?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-2183135036153449420</id><published>2011-11-09T16:54:00.003+07:00</published><updated>2011-11-09T16:54:34.062+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jdk"/><category scheme="http://www.blogger.com/atom/ns#" term="jdk6"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>How to install jdk 6 on Ubuntu 11.10</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
$ sudo add-apt-repository ppa:ferramroberto/java&lt;br /&gt;
$ sudo apt-get update&lt;br /&gt;
$ sudo apt-get install sun-java6-jdk sun-java6-plugin&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background: transparent !important; border-color: none !important; display: none; left: 0; margin: 0 !important; opacity: 1 !important; overflow: visible !important; padding: 0 !important; position: absolute !important; text-align: left !important; top: 0; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/2183135036153449420/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/11/how-to-install-jdk-6-on-ubuntu-1110.html#comment-form' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2183135036153449420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2183135036153449420'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/11/how-to-install-jdk-6-on-ubuntu-1110.html' title='How to install jdk 6 on Ubuntu 11.10'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516653391373273766.post-5705998966490914460</id><published>2011-11-08T16:00:00.001+07:00</published><updated>2011-11-08T18:58:23.362+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>PostgreSQL cheatsheet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
sudo apt-get install postgresql&lt;br /&gt;
# Install a pgadmin gui&lt;br /&gt;
$ sudo apt-get install pgadmin3&lt;br /&gt;
&lt;br /&gt;
# Set a password to &quot;postgres&quot; database&lt;br /&gt;
\password postgres&lt;br /&gt;
&lt;br /&gt;
# Create database&lt;br /&gt;
$ sudo -u postgres createdb mydb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create yourself a superuser database account&lt;br /&gt;
$ sudo -u postgres createuser --superuser $USER&lt;br /&gt;
$ sudo -u postgres psql&lt;br /&gt;
&lt;br /&gt;
# Next change your password&lt;br /&gt;
$ psql&lt;br /&gt;
\password $USER&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create a db with the same name as your login name&lt;br /&gt;
createdb $USER&lt;br /&gt;
&lt;br /&gt;
# To create additional databases:&lt;br /&gt;
create database somedbname;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# To restart the server&lt;br /&gt;
$ sudo /etc/init.d/postgresql restart&lt;br /&gt;
&lt;br /&gt;
# To show created table&lt;br /&gt;
\d tablename&lt;br /&gt;
&lt;br /&gt;
# To show all tables&lt;br /&gt;
\d&lt;br /&gt;
&lt;br /&gt;
# Quit&lt;br /&gt;
\q&lt;br /&gt;
&lt;br /&gt;
# Help&lt;br /&gt;
\h AND \?&lt;br /&gt;
&lt;br /&gt;
# Import sql from file&lt;br /&gt;
\i filename&lt;br /&gt;
&lt;br /&gt;
# Show query buffer&lt;br /&gt;
\p&lt;br /&gt;
&lt;br /&gt;
# Show databases&lt;br /&gt;
\l&lt;br /&gt;
&lt;br /&gt;
# Show db permissions&lt;br /&gt;
\z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/5705998966490914460/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/11/postgresql-cheatlist.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/5705998966490914460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/5705998966490914460'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/11/postgresql-cheatlist.html' title='PostgreSQL cheatsheet'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-1516559880246880484</id><published>2011-11-01T16:30:00.001+07:00</published><updated>2011-11-01T16:31:00.157+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="rescuetime"/><title type='text'>Hot to install rescuetime Linux uploader in Ubuntu 11.10</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
1. Download rescuetime linux uploader from &lt;a href=&quot;https://launchpad.net/rescuetime-linux-uploader&quot;&gt;here&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
2. Extract archive and go to the location in terminal&lt;/div&gt;
&lt;div&gt;
Next:&lt;/div&gt;
&lt;div&gt;
$ python setup.py build&lt;/div&gt;
&lt;div&gt;
$ sudo python setup.py install&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Next you should be able to start it with&lt;/div&gt;
&lt;div&gt;
$ rescuetime_linux_uploader&lt;/div&gt;
&lt;div&gt;
I prefer to add it to startup applications.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;-chrome-auto-translate-plugin-dialog&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;&quot;&gt;
&lt;div style=&quot;-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;&quot;&gt;
&lt;div class=&quot;translate&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;additional&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img onclick=&quot;document.location.href=&#39;http://translate.google.com/&#39;;&quot; src=&quot;http://www.google.com/uds/css/small-logo.png&quot; style=&quot;-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/1516559880246880484/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/11/hot-to-install-rescuetime-linux.html#comment-form' title='Комментарии: 2'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1516559880246880484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1516559880246880484'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/11/hot-to-install-rescuetime-linux.html' title='Hot to install rescuetime Linux uploader in Ubuntu 11.10'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516653391373273766.post-7414091478997172896</id><published>2011-10-29T16:03:00.000+07:00</published><updated>2011-10-29T16:03:03.535+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="sync"/><title type='text'>How to sync open tabs and search engines in Chrome</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
1) Visit chrome://flags/&lt;br /&gt;
2) Enable syncing search engines and open tabs&lt;br /&gt;
3) Go to chrome://settings/personal, click Advanced&lt;br /&gt;
4) Make sure the new options are selected&lt;br /&gt;
5) Use the same search engine shortcuts everywhere!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/7414091478997172896/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/10/how-to-sync-open-tabs-and-search.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/7414091478997172896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/7414091478997172896'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/10/how-to-sync-open-tabs-and-search.html' title='How to sync open tabs and search engines in Chrome'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-3505642385174388874</id><published>2011-10-20T23:50:00.000+07:00</published><updated>2011-10-21T01:47:41.027+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hamster"/><category scheme="http://www.blogger.com/atom/ns#" term="timetracking"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="unity"/><title type='text'>How to install hamster indicator for timetracking in Ubuntu Unity?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;% sudo add-apt-repository ppa:albertomilone/hamster-indicator
% sudo apt-get update
% sudo apt-get install hamster-indicator&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;% gconftool-2 --set &quot;/apps/hamster-indicator/show_label&quot; --type bool &quot;true&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;% gconftool-2 --set &quot;/apps/hamster-indicator/label_length&quot; --type int &quot;20&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;# Optionl - icon glow&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;% gconftool-2 --set &quot;/apps/hamster-indicator/icon_glow&quot; --type bool &quot;true&quot;&lt;/code&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;linux-code&quot;&gt;&lt;code&gt;After that, add &lt;/code&gt;&lt;code&gt;&quot;hamster-indicator&quot; to startup applications.&lt;/code&gt;&lt;code&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/3505642385174388874/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/10/how-to-install-hamster-indicator-for.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3505642385174388874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3505642385174388874'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/10/how-to-install-hamster-indicator-for.html' title='How to install hamster indicator for timetracking in Ubuntu Unity?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-1305503986817432544</id><published>2011-10-10T02:12:00.000+07:00</published><updated>2011-10-10T02:12:03.755+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>50 советов по экономии времени для пользователей Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1&gt;
&lt;/h1&gt;
&lt;strong&gt;&lt;/strong&gt;
1. Укоротите время показа меню загрузки&lt;br /&gt;
Если вы сыты по горло ожиданием начала загрузки вашей любимой 
операционной системы, откройте в текстовом редакторе 
&quot;/boot/grub/menu.lst&quot;, найдите строчку, начинающуюся со слова &quot;timeout&quot; и
 просто уменьшите число справа. Это число - количество секунд, в течение
 которых система меню будет ждать перед началом загрузки операционной 
системы по умолчанию (значения 0 и 1 не рекомендуются).&lt;br /&gt;
&lt;br /&gt;
2. Отслеживайте производительность загрузки&lt;br /&gt;
Bootchart - одна из лучших утилит для проверки производительности 
системы. После установки и перезагрузки bootchart создаст комплексный 
график всего, что запускается и потребляет ресурсы во время загрузки 
вашей системы, и помещает изображения графика в директорию 
/var/log/bootgraph.&lt;br /&gt;
&lt;br /&gt;
3. Ускорьте загрузку&lt;br /&gt;
Когда появится загрузочное меню (вы должны были нажать &quot;Ecs&quot;), выберите 
опции загрузки по умолчанию и нажмите &quot;e&quot;. Переместите курсор на 
строчку, начинающуюся со слова &quot;kernel&quot;, и снова нажмит &quot;e&quot;. Сейчас вы 
редактируете параметры загрузки, и вам нужно нажать пробел и добавить 
слово &quot;profile&quot;. Нажмите &quot;Enter&quot; и &quot;b&quot;, чтобы загрузиться. Доступ к 
диску в процессе последовательной загрузки сейчас будет профилированным и
 она станет быстрее, чем раньше.&lt;br /&gt;
&lt;br /&gt;
4. Урежьте нежелательные службы&lt;br /&gt;
Стандартная установленная Ubuntu отличается предусмотрительностью по 
отношению к фоновым службам. К примеру, утилиты для bluetooth будут 
работать, даже если у вас нет соответствующего оборудования. Отключите 
не нужные вам службы, открыв окно &quot;Службы&quot; (Services) в меню 
&quot;Система&quot;-&amp;gt;&quot;Администрирование&quot; (System-&amp;gt;Administration). Будьте 
внимательны и не отключите службы, которыми вы пользуетесь.&lt;br /&gt;
&lt;br /&gt;
5. Отслеживайте использование процессора&lt;br /&gt;
Вы можете думать, что программы для мониторинга процессора - это чисто 
для гиков, пытающихся выжать ещё несколько лишних циклов из своих 
разогнанных процессоров. Но это не правда. Дискретный монитор процессора
 - лучший способ определить непредсказуемый процесс, который замедляет 
работу всей системы. Щёлкните правой кнопкой мыши на панели рабочего 
стола и выберите &quot;Системный монитор&quot; (System Monitor). Для KDE есть 
похожий апплет.&lt;br /&gt;
&lt;br /&gt;
6. Управляйте процессами&lt;br /&gt;
Если вы определите процесс, который использует больше процессорных 
циклов, чем реально должен, вам нужно остановить его, чтобы высвободить 
эти циклы. Сохраните всю работу и запустите менеджер процессов Ubuntu. 
Это часть инструментария системного мониторинга, он может быть открыт 
через меню &quot;Система&quot;-&amp;gt;&quot;Администрирование&quot; 
(System-&amp;gt;Administration).&lt;br /&gt;
&lt;br /&gt;
7. Будьте внимательны друг к другу&lt;br /&gt;
Если вы используете системный монитор для управления текущими задачами, 
вы могли бы заметить колонку &quot;nice&quot;. &quot;Nice&quot; это обычно приоритет задачи,
 который ранжируется от -20 до 19. Если у вас выполняется &quot;тяжёлая&quot; для 
процессора задача, такая, как, например, трёхмерные вычисления, 
увеличение значения &quot;nice&quot; уменьшит её приоритет и поможет вашей системе
 быть более отзывчивой. (Здесь игра слов: nice - &quot;отзывчивый&quot;, 
&quot;внимательный&quot; и responsive - &quot;отзывчивый&quot; - прим.пер.)&lt;br /&gt;
Рабочий стол GNOME&lt;br /&gt;
&lt;br /&gt;
8. Включите автоматический вход в систему&lt;br /&gt;
Многие из нас являются единственными пользователями своих компьютеров, 
так что ввод имени пользователя и пароля каждый раз перед тем как 
попасть в систему выглядит бессмысленным. Вы можете настроить 
автоматический вход в систему для основного пользователя, выбрав &quot;Окно 
входа&quot; (Login Window) в меню &quot;Система&quot;-&amp;gt;&quot;Администрирование&quot; 
(System-&amp;gt;Adminisration). Переключитесь на страницу &quot;Безопасность&quot; 
(Security), включите &quot;Автоматический вход&quot; (Automatic Login) и выберите 
пользователя.&lt;br /&gt;
&lt;br /&gt;
9. Упростите меню&lt;br /&gt;
Чем больше приложений вы устанавливаете, тем более громоздким становится
 меню запуска. Но вы можете включить в него наиболее часто используемые 
приложения, нажав правой кнопкой мыши на пиктограмму, которая прячет 
меню, и выбрав пункт &quot;Редактировать меню&quot; (Edit Menus). Появившееся 
приложение позволит вам включить или отключить пункты меню.&lt;br /&gt;
&lt;br /&gt;
10. Удалите задержку перед появлением меню&lt;br /&gt;
Гуру HCI (Human-computer interaction, человеко-компьютерное 
взаимодействие - прим.пер.) настаивают на том, что между щелчком по меню
 и его появлением должна быть задержка, но если она вас раздражает, вы 
можете избавиться от неё. Откройте терминал и напечатайте &quot;nano 
~/.gtkrc-2.0&quot;, затем добавьте единственную строчку 
&quot;gtk-menu-popup-delay=0&quot;, сохраните результат, нажав &quot;Ecs&quot; и &quot;Y&quot;. После 
перезапуска приложения вы обнаружите, что меню работает ультрабыстро.&lt;br /&gt;
&lt;br /&gt;
11. Добавьте больше рабочих столов&lt;br /&gt;
Рабочие столы - одна из лучших вещей в Linux: это прекрасный способ 
расположить ваши приложения в разных виртуальных экранах. По умолчанию 
Ubuntu устанавливает только два рабочих стола, но вы можете 
отрегулировать их количество, щёлкнув правой кнопкой мыши по 
переключателю рабочих столов в правом нижнем углу экрана и открыв окно 
&quot;Настройки&quot; (Preferences).&lt;br /&gt;
&lt;br /&gt;
12. Используйте рабочие столы эффективнее&lt;br /&gt;
Используйте сочетание &quot;Ctrl&quot; и клавиши курсора &quot;влево&quot; или &quot;вправо&quot;, 
чтобы переключаться между смежными рабочими столами. И если вы будете 
удерживать при этом &quot;Shift&quot;, то активное окно также переместится на 
новый рабочий стол. Есть ещё один способ: нажмите правую кнопку мыши на 
верхней границе любого окна, чтобы открыть контекстное меню и из него 
выбрать, на какой рабочий стол передвинуть окно.&lt;br /&gt;
&lt;br /&gt;
13. Не запускайте всё сразу&lt;br /&gt;
Среднестатистическая Ubuntu в начале работы запускает множество разных 
программ, включая системные службы. Вы можете удалить те из них, которые
 вам не нужны, в окне &quot;Сеансы&quot; (Sessions) в меню &quot;Настройки&quot; 
(Preferences). Если вы не используете, к примеру, поиск, выключите 
&quot;Треккер&quot; (Tracker). Другие возможные кандидаты на отключение - 
Bluetooth, Evolution Alarm Notifier и апплет Print Queue.&lt;br /&gt;
&lt;br /&gt;
14. Запомните текущий сеанс&lt;br /&gt;
Ещё одной хорошей особенностью менеджера настроек является возможность 
сконфигурировать ваш компьютер так, чтобы он запомнил приложения, 
которые вы запускали перед выключением машины. Это отличный способ 
быстро погрузиться в свою рабочую среду. Чтобы сделать это, просто 
переключитесь на страницу &quot;Параметры сеанса&quot; (Session Options) и 
включите опцию &quot;Автоматически запоминать&quot; (Automatically Remember).&lt;br /&gt;
&lt;br /&gt;
15. Тонкая настройка рабочего стола Gnome&lt;br /&gt;
Клавишные комбинации для приложений спрятаны в &quot;гномовском&quot; аналоге 
редактора реестра в Windows. Его вы можете запустить из командной 
строки, напечатав &quot;gconf-editor&quot;. Но будьте осторожны: изменённые здесь 
настройки могут угробить весь рабочий стол. Если такое случится, 
восстановить его первоначальное состояние можно удалив директории .gconf
 и .gconfd в домашней директории.&lt;br /&gt;
&lt;br /&gt;
16. Запускайте приложения с помощью клавиатурных комбинаций&lt;br /&gt;
Одной из настроек, спрятанных в Gconf, является возможность запускать 
приложения с помощью клавиатурных комбинаций. Перейдите в 
apps-&amp;gt;metacity-&amp;gt;key_binding_commands, дважды щёлкните по одной из 
строк &quot;command_&quot;и введите команду запуска приложения, которое вам нужно.
 Чтобы установить клавишу запуска, дважды щёлкните по той же строчке в 
apps-&amp;gt;metacity-&amp;gt;global_keybindings и нажмите клавишу. Удерживание 
комбинации Ctrl+Shift+Alt и этой клавиши запустит приложение.&lt;br /&gt;
&lt;br /&gt;
17. Используйте индексированный поиск&lt;br /&gt;
Ubuntu поставляется с превосходными утилитами для поиска по содержанию 
файлов и электронных писем, но они по умолчанию отключены. В меню 
&quot;Настройки&quot; (Preferences) откройте окно &quot;Поиск и индексирование&quot; (Search
 and Indexing) и включите оба параметра - &quot;индексирование&quot; и &quot;слежение&quot;.
 После того как ваши файлы будут проиндексированы, вы сможете искать по 
ним, используя утилиту Tracker Search Tool в меню 
&quot;Приложения&quot;-&amp;gt;&quot;Стандартные&quot; (Applications-&amp;gt;Accessories).&lt;br /&gt;
&lt;br /&gt;
18. Переключитесь на более быстрый менеджер рабочего стола&lt;br /&gt;
Ubuntu по умолчанию использует рабочий стол Gnome, и это хорошее 
решение, потому что он мощен, функционален и популярен. Но он не 
модернизирован и не особенно рационален. Более быстрой альтернативой 
Gnome является XCFE - основа Xubuntu. Установить его вы можете через 
менеджер пакетов Synaptic, если поищете мета-пакет &quot;xubuntu-desktop&quot;.&lt;br /&gt;
Рабочий стол KDE&lt;br /&gt;
&lt;br /&gt;
19. Переключитесь на KDE&lt;br /&gt;
Если ни Gnome, ни XCFE не помогают вам увеличить производительность 
труда, попробуйте KDE. Это самая гибконастраиваемая графическая среда в 
Linux и часто отличается от других своим подходом к поиску и управлению 
файлами. В версии 4 чрезвычайно сильно улучшено окружение. KDE может 
быть установлен с помощью поиска &quot;kubuntu-desktop&quot; в Synaptic.&lt;br /&gt;
&lt;br /&gt;
20. Настройте автоматический вход в систему в KDE&lt;br /&gt;
Если вы предпочитаете Kubuntu или рабочий стол KDE, то чтобы включить 
автоматический вход в систему, вам нужно использовать другую 
конфигурационную панель. Откройте приложение &quot;Системные настройки KDE&quot; 
(KDE&#39;s System Settings), перейдите на страницу &quot;Дополнительно&quot; и 
откройте &quot;Менеджер учётных записей&quot; (Login Manager). Введите пароль 
суперпользователя и переключитесь на страницу &quot;Convenience&quot;. Отсюда вы 
можете выбрать пользователя для автоматического входа в систему.&lt;br /&gt;
&lt;br /&gt;
21. Предварительно загрузите Konqueror&lt;br /&gt;
Если вы постоянно запускаете этот файловый и веб-браузер KDE, вы можете 
предварительно загрузить несколько его экземпляров, чтобы уменьшить 
время его запуска. Откройте окно &quot;Настройки&quot;-&amp;gt;&quot;Конфигурировать 
Konqueror&quot; (Settings-&amp;gt;Configure Konqueror) и перейдите на страницу 
&quot;Производительность&quot; (Performance). Увеличьте количество экземпляров с 1
 до чего-нибудь вроде 4 или 5. Каждый экземпляр потребует дополнительной
 системной памяти, но зато каждый сеанс Konqueror будет запускаться 
почти мгновенно.&lt;br /&gt;
&lt;br /&gt;
22. Используйте клавиатурные сокращения для Konqueror&lt;br /&gt;
Konqueror - это классный файловый и веб-браузер с множеством 
клавиатурных сокращений для продвинутых пользователей. Наше любимое - 
возможность использовать сокращения в адресной строке для он-лайн 
поиска. &quot;Wp:linux&quot; будет искать в &quot;Википедии&quot; слово &quot;Linux&quot;, а &quot;gg: 
linux&quot; будет искать это слово в Google и Google Images.&lt;br /&gt;
&lt;br /&gt;
ОБЩЕСИСТЕМНЫЕ НАСТРОЙКИ&lt;br /&gt;
&lt;br /&gt;
23. Сделайте запуск OpenOffice.org быстрее&lt;br /&gt;
Стандартная конфигурация OpenOffice.org неудачна - из-за перестраховок: в
 ней 100 уровней команды &quot;отменить&quot; (undo), к примеру. Уменьшение этого 
числа уменьшит и количество используемой памяти. Соответствующие 
настройки можете найти в окне &quot;Опции&quot; (Options) на странице &quot;Память&quot; 
(Memory). Попробуйте уменьшить шаги отмены до 30.&lt;br /&gt;
&lt;br /&gt;
24. Используйте панель быстрого запуска&lt;br /&gt;
И в Gnome, и в KDE вы можете перетаскивать приложения из меню запуска на
 рабочий стол и на панель инструментов. Быстрее получается щёлкнуть по 
этим пиктограммам для запуска наиболее используемых приложений, чем 
удерживать определённые клавиши.&lt;br /&gt;
&lt;br /&gt;
25. Замените медленные предложения более быстрыми&lt;br /&gt;
В открытом ПО всегда есть альтернативные приложения - и это классно. 
Переключение на одно из них может чрезвычайно улучшить 
производительность вашей системы. Попробуйте использовать Abiword вместо
 OpenOffice.org Writer, Thunar вместо Nautilus и Opera вместо Firefox. 
Все они в целом совместимы друг с другом, но первые работают быстрее.&lt;br /&gt;
&lt;br /&gt;
26. Стремительный запуск приложений&lt;br /&gt;
Если вы знаете название приложения или инструмента, с которым хотите 
поработать, то можете быстро запустить его, нажав Alt+F2. Эта комбинация
 вызовет отдельное окно с командной строкой, и в нём вы можете 
напечатать название приложения. Введите &quot;firefox&quot; - и появится его 
пиктограмма. Нажатие &quot;Enter&quot; запустит программу.&lt;br /&gt;
&lt;br /&gt;
27. Сделайте снимок экрана&lt;br /&gt;
Чтобы сделать скриншот и сохранить его (с помощью появившегося 
диалогового окна), нажмите клавишу &quot;Print&quot;. Возможность сделать скриншот
 в любой момент невероятно полезна. Например, для сохранения 
подробностей он-лайн заказа или наивысшего результата в Crack Attack. 
Нажатием клавиш Alt+Print вы сделаете скриншот текущего активного окна.&lt;br /&gt;
&lt;br /&gt;
28. Перезапустите рабочий стол быстро&lt;br /&gt;
Время от времени вы можете обнаруживать, что ваш рабочий стол завис и 
использовать клавиатуру или мышь больше нельзя. К счастью, процесс 
рабочего стола полностью независим от остальной части операционной 
системы. Вы можете перезапустить рабочий стол, удерживая клавиши 
Ctrl+Alt+Backspace, но вместе с этим вы потеряете все несохранённые 
данные, так что будьте осторожны.&lt;br /&gt;
&lt;br /&gt;
29. Переключитесь на консоль&lt;br /&gt;
Другой вариант действия в случае, если ваш рабочий стол &quot;упал&quot;, это 
перейти в консоль. Нажатие комбинации Ctrl+Alt и F1-F6 переключит экран 
на одну из шести разных консолей. Отсюда вы можете войти в систему и 
попытаться убить создающий проблемы процесс, перед тем как снова 
переключиться на ваш рабочий стол (сделать это можно нажав Ctrl+Alt+F7).&lt;br /&gt;
&lt;br /&gt;
30. Создайте отдельную домашнюю директорию&lt;br /&gt;
Когда вы соберётесь поставить Ubuntu на &quot;свежий&quot; компьютер, выберите в 
установщике ручную разбивку диска и создайте три разных раздела. Один 
нужен для корневой директории (&quot;/&quot;) и должен быть размером где-то в 
10-20Гб. Второй необходим для файла подкачки, его размер равен 
количеству установленной памяти. И наконец, третий раздел - это домашняя
 директория (&quot;/home&quot;), которая будет содержать все ваши личные файлы. 
Когда вы будете переустанавливать Ubuntu, снова выберите ручную разбивку
 диска и ваш раздел с домашней директорией не будет переформатирован и 
все ваши личные и конфигурационные файлы останутся в целости и 
сохранности.&lt;br /&gt;
&lt;br /&gt;
31. Настройте карту Nvidia&lt;br /&gt;
С установленными проприетарными драйверами для Linux карты Nvidia 
обеспечивают исключительное трёх- и двухмерное ускорение. Чтобы точно 
отрегулировать оборудование Nvidia, установите приложение под названием 
&quot;nvidia-settings&quot;: из него вы сможете редактировать настройки монитора, 
включать двойной экран и добавлять тень от курсора.&lt;br /&gt;
&lt;br /&gt;
32. Найдите неиспользуемые большие файлы&lt;br /&gt;
Большие и разбросанные в беспорядке файлы могут замедлять работу вашего 
компьютера, так же как и работу приложений, читающих содержимое 
директории. Лучший инструмент для уплотнения и удаления неиспользуемых 
файлов, который мы нашли, называется Filelight. Чтобы показать, где 
находятся самые большие файлы, программа использует секторную диаграмму.
 Вы можете легко удалить директории с хламом из меню, вызываемого 
щелчком правой кнопкой мыши по диаграмме.&lt;br /&gt;
&lt;br /&gt;
33. Включите вертикальную синхронизацию в Compiz&lt;br /&gt;
Compiz, приложение впечатляющих трёхмерны эффектов, может как пожирать 
ресурсы, так и служить инструментом для ускорения работы компьютера - 
это зависит от мощности вашего графического оборудования. Но после 
включения вертикальной синхронизации мы почти всегда получаем более 
быстрый отклик. Включить параметр можно на странице общих настроек в 
менеджере настроек Compiz (Compiz setting manager).&lt;br /&gt;
&lt;br /&gt;
34. Некомпизный Compiz&lt;br /&gt;
С другой стороны, прекрасные эффекты, производимые Compiz, не могут быть
 названы действительно функциональными, хотя для некоторых они удобны в 
использовании. Вы можете высвободить огромную часть ресурсов системы, 
отключив эффекты рабочего стола на странице визуальных эффектов (Visual 
Effects) в окне &quot;Настройки&quot;-&amp;gt;&quot;Внешний вид&quot; 
(Preferences-&amp;gt;Appearance).&lt;br /&gt;
&lt;br /&gt;
35. Вытащите пакеты с CD или DVD&lt;br /&gt;
Даже во времена проникающего всюду интернета время от времени вам нужно 
иметь возможность установить пакет без подключения к глобальной сети. К 
счастью, Synaptic может читать содержимое установочного диска Ubuntu и 
добавлять пакеты оттуда свою в базу для установки с этого носителя. 
Откройте &quot;Источники ПО&quot; (Software Sources) из меню &quot;Администрирование&quot; 
(Administration), перейдите на страницу &quot;Третьестороннее ПО&quot; (Third 
Party) и щёлкните по кнопке &quot;Добавить CD-ROM&quot; (Add CD-ROM).&lt;br /&gt;
&lt;br /&gt;
36. Повысьте скорость загрузки с помощью Preload&lt;br /&gt;
Утилиту Preload вы можете установить с помощью менеджера пакетов 
Synaptic. Она будет работать в фоновом режиме и попытается угадать, 
какие библиотеки вы собираетесь использовать. Затем она загрузит их в 
память, так что ваши приложения станут запускаться быстрее. Эффект 
Preload, похоже, минимален в последних версиях Ubuntu, но утилиту стоит 
попробовать.&lt;br /&gt;
&lt;br /&gt;
37. Используйте виртуальную машину&lt;br /&gt;
Если вы наслаждаетесь тем, что пробуете разные дистрибутивы, но их 
установка вызывает у вас отвращение, попробуйте использовать Virtual Box
 из официальных репозиториев Ubuntu. Приложение легко в использовании и 
позволяет устанавливать на вашем компьютере виртуальные версии почти 
всех дистрибутивов Linux (и даже Windows), которые работают практически 
на своих настоящих скоростях.&lt;br /&gt;
&lt;br /&gt;
38. Загружайтесь в текстовый режим&lt;br /&gt;
Время от времени графическое окружение бывает ненужным, особенно если вы
 используете свою машину как сервер. Поэтому Ubuntu имеет версию под 
названием Server Edition. По умолчанию Server не имеет графического 
рабочего стола, но во всём остальном это всё тот же Ubuntu. Прекрасное 
решение для веб- или медиа-сервера.&lt;br /&gt;
&lt;br /&gt;
39. Усыпите свою систему&lt;br /&gt;
Зачем ждать, пока система загрузится, если можно просто &quot;разбудить&quot; 
сессию? Это быстрее, чем загружаться с нуля, и вы можете продолжать 
работу с того места, где остановились. Однако всё зависит от вашего 
оборудования. Дайте компьютеру попытаться &quot;заснуть&quot;, чтобы проверить, 
поддерживает ли он этот режим: щёлкните по кнопке &quot;Выход&quot; (Logout), и 
если появится опция &quot;Спящий режим&quot; (Hibernate), то он должен работать.&lt;br /&gt;
&lt;br /&gt;
40. Подгоните ядро под себя&lt;br /&gt;
Если вы чувствуете себя достаточно уверенным (а мы никогда не 
порекомендовали бы это тому, у кого недостаточно набита рука), вы могли 
бы собрать собственное ядро. Это не так тяжело, как кажется, однако 
позволит вам добавить в ядро только те особенности и оборудование, 
которыми вы хотите пользоваться. Прекрасная пошаговая инструкция здесь: &lt;a href=&quot;http://www.stfw.ru/go.php?url=https://help.ubuntu.com/community/Kernel/Compile.&quot; target=&quot;_blank&quot;&gt;https://help.ubuntu.com/community/Kernel/Compile.&lt;/a&gt;&lt;br /&gt;
Командная строка&lt;br /&gt;
&lt;br /&gt;
41. Попробуйте, это действительно неплохо&lt;br /&gt;
Командная строка - ваш настоящий друг. Открыв Тerminal из меню 
&quot;Приложения&quot;-&amp;gt;&quot;Стандартные&quot; (Applications-&amp;gt;Accessories) или 
Konsole в KDE, вы можете выполнять гораздо больше задач, нежели в GUI 
вашего рабочего стола. К примеру, чтобы скопировать директорию, 
напечатайте &quot;cp -rf что куда&quot;; переименуйте файл командой mv и 
отредактируйте текстовый файл, используя команду под названием nano.&lt;br /&gt;
&lt;br /&gt;
42. Лёгкие консольные комбинации клавиш&lt;br /&gt;
Вы можете нажать Tab во время использования командной строки, чтобы 
автоматически дополнить названия команд и системные пути. Вы также 
можете перебирать команды, использовавшиеся вами ранее, а также 
пользоваться поиском (Ctrl+r), чтобы найти команды, начинающиеся с 
символов, которые вы введёте.&lt;br /&gt;
&lt;br /&gt;
43. Замените тяжёлые графические приложения консольными аналогами&lt;br /&gt;
Для большинства графических приложений существуют консольные аналоги. Вы
 могли бы установить и пользоваться pine для чтения электронной почты и 
новостей, к примеру. Или попробовать веб-браузер lynx. Использовать wget
 или ncftp - для скачивания файлов. MC (сокращение от Midnight 
Commander) - это полноценный файловый менеджер. И все эти утилиты 
запускаются на компьютерах с практически любым количеством памяти и 
практически c любым процессором.&lt;br /&gt;
&lt;br /&gt;
44. Создавайте образы CD или DVD&lt;br /&gt;
Вы можете создавать образы оптических носителей информации и большинства
 присоединённых устройств, используя одну-единственную консольную 
команду. Напечатайте &quot;dd if=/dev/cdrom of=disk.iso bs=1024&quot;, чтобы 
сделать необработанную полную копию данных и записать её в файл 
disk.iso. Но вначале вам надо отмонтировать привод, напечатав &quot;sudo 
umount /dev/cdrom&quot;.&lt;br /&gt;
&lt;br /&gt;
45. Читайте образы дисков, не записывая их на болванки&lt;br /&gt;
Если вы скачали образ диска и хотите получить доступ к файлам на нём, не
 тратя оптический диск, вы можете создать из этого образа виртуальный 
диск, используя всего одну команду. Откройте терминал через меню 
&quot;Стандартные&quot; (Accessories). Напечатайте &quot;sudo mkdir /mnt/image&quot;, далее -
 &quot;sudo mount -o loop disk.iso /mnt/image&quot;. Теперь вы можете 
просматривать диск с помощью файл-браузера в директории /mnt/image.&lt;br /&gt;
&lt;br /&gt;
46. Используйте команду screen&lt;br /&gt;
После того как вы привыкли к командной строке, время изучить одну из 
лучших команд - screen. Это консольный эквивалент виртуальных рабочих 
столов. Screen позволяет запускать несколько сессий сразу, так же как и 
&quot;усыплять&quot; и &quot;пробуждать&quot; сессии. Чтобы начать, напечатайте &quot;screen&quot;, 
затем нажмите клавиши Ctrl+C, чтобы создать новую сессию. Ctrl+A и N или
 P будут переключать вас между активными сессиями. Команды Ctrl+A и 
Ctrl+D &quot;отцепляют&quot; от сессии, а &quot;screen -r&quot; возобновит её.&lt;br /&gt;
&lt;br /&gt;
47. Имейте доступ к вашей машине с Ubuntu откуда угодно&lt;br /&gt;
Отличной особенностью консоли является то, что вы можете использовать её
 для безопасного доступа к своей машине через интернет, находясь где 
угодно. Инструмент для этого - нечто под названием &quot;SSH&quot; - безопасная 
оболочка. Установите с помощью Synaptic openssh-server. Для доступа к 
вашей учётной записи используйте утилиты putty (для Windows) и ssh (для 
Linux).&lt;br /&gt;
&lt;br /&gt;
48. Перемещайте файлы между компьютерами быстро и безопасно&lt;br /&gt;
С установленным и запущенным SSH-сервером вы можете быстро и безопасно 
перемещать файлы на и с удалённого компьютера, используя команду sftp. 
Она работает по протоколу FTP и понимает команды put и get для 
перемещения файлов. Если вы предпочитаете графический интерфейс, мы 
рекомендуем использовать Filezilla под Windows или &quot;sftp://&quot; как 
протокол в KDE.&lt;br /&gt;
&lt;br /&gt;
49. Избегайте sudo&lt;br /&gt;
Вы могли заменить, что почти каждую важную конфигурационную команду, 
которую вы вводите, необходимо предварять командой &quot;sudo&quot; и вашим 
паролем. Если вы вводите одну &quot;sudo&quot; за другой, это может обернуться 
настоящей головной болью. Чтобы избежать докучливой процедуры, 
напечатайте &quot;sudo bash&quot; - это заменит текущую оболочку новой - с полными
 администраторскими привилегиями.&lt;br /&gt;
&lt;br /&gt;
50. Создайте учётную запись суперпользователя&lt;br /&gt;
Если вы заметили, что работа с администраторскими привилегиями занимает 
всё больше и больше времени, вы можете создать учётную запись 
суперпользователя. Просто напечатайте &quot;sudo passwd root&quot; и введите свой 
пароль, следом за ним - новый пароль для учётной записи 
суперпользователя. Теперь вы можете напечатать &quot;sudo root&quot; и войти в 
систему как суперпользователь. Но этот режим стоит использовать только 
для администрирования системы.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://stfw.ru/page.php?id=16379&quot;&gt;Источник&lt;/a&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/1305503986817432544/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/10/50-ubuntu.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1305503986817432544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1305503986817432544'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/10/50-ubuntu.html' title='50 советов по экономии времени для пользователей Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-1249503442033940060</id><published>2011-09-30T22:34:00.003+07:00</published><updated>2011-10-05T21:32:32.936+07:00</updated><title type='text'>Seven habbits of effective text editing by Bram Moolenaar</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;blockquote&gt;
If you spend a lot of time typing plain text, writing programs or HTML, you 
    can save much of that time by using a good editor and using it effectively. 
    This paper will present guidelines and hints for doing your work more quickly 
    and with fewer mistakes.&lt;br /&gt;
The open source text editor Vim (Vi IMproved) will be used here to present 
    the ideas about effective editing, but they apply to other editors just as 
    well. Choosing the right editor is actually the first step towards effective 
    editing. The discussion about which editor is the best for you would take 
    too much room and is avoided. If you don&#39;t know which editor to use or are 
    dissatisfied with what you are currently using, give Vim a try; you won&#39;t 
    be disappointed.&lt;br /&gt;
[Vim commands and options are printed in &lt;code&gt;this font&lt;/code&gt;] &lt;/blockquote&gt;
&lt;br /&gt;
&lt;center&gt;
  &lt;h3&gt;

Part 1: edit a file&lt;/h3&gt;
&lt;/center&gt;
&lt;b&gt;1. Move around quickly&lt;/b&gt;&lt;br /&gt;
Most time is spent reading, checking for errors and looking for the right place 
  to work on, rather than inserting new text or changing it. Navigating through 
  the text is done very often, thus you should learn how to do that quickly.&lt;br /&gt;
Quite often you will want to search for some text you know is there. Or look 
  at all lines where a certain word or phrase is used. You could simply use the 
  search command &lt;code&gt;/pattern&lt;/code&gt; to find the text, but there are smarter 
  ways:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; If you see a specific word and want to search for other occurrences of 
    the same word, use the &lt;code&gt;*&lt;/code&gt; command. It will grab the word from 
    under the cursor and search for the next one. 
  &lt;/li&gt;
&lt;li&gt; If you set the &#39;&lt;code&gt;incsearch&lt;/code&gt;&#39; option, Vim will show the first 
    match for the pattern, while you are still typing it. This quickly shows a 
    typo in the pattern. 
  &lt;/li&gt;
&lt;li&gt; If you set the &#39;&lt;code&gt;hlsearch&lt;/code&gt;&#39; option, Vim will highlight all matches 
    for the pattern with a yellow background. This gives a quick overview of where 
    the search command will take you. In program code it can show where a variable 
    is used. You don&#39;t even have to move the cursor to see the matches. 
&lt;/li&gt;
&lt;/ul&gt;
In structured text there are even more possibilities to move around quickly. 
  Vim has specific commands for programs in C (and similar languages like C++ 
  and Java): 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; Use &lt;code&gt;%&lt;/code&gt; to jump from an open brace to its matching closing brace. 
    Or from a &quot;#if&quot; to the matching &quot;#endif&quot;. Actually, &lt;code&gt;%&lt;/code&gt; 
    can jump to many different matching items. It is very useful to check if () 
    and {} constructs are balanced properly. &lt;/li&gt;
&lt;li&gt; Use &lt;code&gt;[{&lt;/code&gt; to jump back to the &quot;{&quot; at the start of the 
    current code block. &lt;/li&gt;
&lt;li&gt; Use &lt;code&gt;gd&lt;/code&gt; to jump from the use of a variable to its local declaration. 
  &lt;/li&gt;
&lt;/ul&gt;
There are many more, of course. The point is that you need to get to know these 
  commands. You might object that you can&#39;t possibly learn all these commands 
  - there are hundreds of different movement commands, some simple, some very 
  clever - and it would take weeks of training to learn them all. Well, you don&#39;t 
  need to; instead realize what your specific way of editing is, and learn only 
  those commands that make your editing more effective.&lt;br /&gt;
There are &lt;b&gt;three basic steps&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; While you are editing, keep an eye out for actions you repeat and/or spend 
    quite a bit of time on. &lt;/li&gt;
&lt;li&gt; Find out if there is an editor command that will do this action quicker. 
    Read the documentation, ask a friend, or look at how others do this. &lt;/li&gt;
&lt;li&gt; Train using the command. Do this until your fingers type it without thinking. 
  &lt;/li&gt;
&lt;/ol&gt;
Let&#39;s use an example to show how it works:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; You find that when you are editing C program files, you often spend time 
    looking for where a function is defined. You currently use the &lt;code&gt;*&lt;/code&gt; 
    command to search for other places where the function name appears, but end 
    up going through a lot of matches for where the function is used instead of 
    defined. You get the idea that there must be a way to do this faster. &lt;/li&gt;
&lt;li&gt; Looking through the quick reference you find a remark about jumping to 
    tags. The documentation shows how this can be used to jump to a function definition, 
    just what you were looking for! &lt;/li&gt;
&lt;li&gt; You experiment a bit with generating a tags file, using the ctags program 
    that comes with Vim. You learn to use the &lt;code&gt;CTRL-]&lt;/code&gt; command, and 
    find you save lots of time using it. To make it easier, you add a few lines 
    to your Makefile to automatically generate the tags file. &lt;/li&gt;
&lt;/ol&gt;
A couple of things to watch out for when you are using these three steps:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; &quot;I want to get the work done, I don&#39;t have time to look through the 
    documentation to find some new command&quot;. If you think like this, you 
    will get stuck in the stone age of computing. Some people use Notepad for 
    everything, and then wonder why other people get their work done in half the 
    time... &lt;/li&gt;
&lt;li&gt; Don&#39;t overdo it. If you always try to find the perfect command for every 
    little thing you do, your mind will have no time left to think about the work 
    you were actually doing. Just pick out those actions that take more time than 
    necessary, and train the commands until you don&#39;t need to think about it when 
    using them. Then you can concentrate on the text. &lt;/li&gt;
&lt;/ul&gt;
In the following sections there will be suggestions for actions that most people 
  have to deal with. You can use these as inspiration for using the &lt;b&gt;three basic 
  steps&lt;/b&gt; for your own work.&lt;br /&gt;
&lt;b&gt;2. Don&#39;t type it twice&lt;/b&gt;&lt;br /&gt;
There is a limited set of words we type. And even a limited number of phrases 
  and sentences. Especially in computer programs.&amp;nbsp; Obviously, you don&#39;t want to 
  type the same thing twice.&lt;br /&gt;
Very often you will want to change one word into another. If this is to be 
  done in the whole file, you can use the &lt;code&gt;:s&lt;/code&gt; (substitute) command. 
  If only a few locations needs changing, a quick method is to use the &lt;code&gt;*&lt;/code&gt; 
  command to find the next occurrence of the word and use &lt;code&gt;cw&lt;/code&gt; to change 
  the word. Then type &lt;code&gt;n&lt;/code&gt; to find the next word and &lt;code&gt;.&lt;/code&gt; 
  (dot) to repeat the &lt;code&gt;cw&lt;/code&gt; command.&lt;br /&gt;
The &lt;code&gt;.&lt;/code&gt; command repeats the last change. A change, in this context, 
  is inserting, deleting or replacing text. Being able to repeat this is a very 
  powerful mechanism. If you organise your editing around it, many changes will 
  become a matter of hitting just that &lt;code&gt;.&lt;/code&gt; key. Watch out for making 
  other changes in between, because it will replace the change that you were repeating. 
  Instead you might want to mark the location with the &lt;code&gt;m&lt;/code&gt; command, 
  continue your repeated change and come back there later.&lt;br /&gt;
Some function and variable names can be awkward to type. Can you quickly type 
  &quot;XpmCreatePixmapFromData&quot; without a typo and without looking it up? 
  Vim has a completion mechanism that makes this a whole lot easier. It looks 
  up words in the file you are editing, and also in #include&#39;d files. You can 
  type &quot;XpmCr&quot;, then hit &lt;code&gt;CTRL-N&lt;/code&gt; and Vim will expand it 
  to &quot;XpmCreatePixmapFromData&quot; for you. Not only does this save quite 
  a bit of typing, it also avoids making a typo and having to fix it later when 
  the compiler gives you an error message.&lt;br /&gt;
When you are typing a phrase or sentence multiple times, there is an even quicker 
  approach. Vim has a mechanism to record a macro. You type &lt;code&gt;qa&lt;/code&gt; to 
  start recording into register &#39;a&#39;. Then you type your commands as usual and 
  finally hit &lt;code&gt;q&lt;/code&gt; again to stop recording. When you want to repeat 
  the recorded commands you type &lt;code&gt;@a&lt;/code&gt;. There are 26 registers available 
  for this.&lt;br /&gt;
With recording you can repeat many different actions, not just inserting text. 
  Keep this is mind when you know you are going to repeat something.&lt;br /&gt;
One thing to watch out for when recording is that the commands will be played 
  back exactly as you typed them. When moving around you must keep in mind that 
  the text you move over might be different when the command is repeated. Moving 
  four characters left might work for the text where you are recording, but it 
  might need to be five characters where you repeat the commands. It&#39;s often necessary 
  to use commands to move over text objects (words, sentences) or move to a specific 
  character.&lt;br /&gt;
When the commands you need to repeat are getting more complicated, typing them 
  right at once is getting more difficult. Instead of recording them, you should 
  then write a script or macro. This is very useful to make templates for parts 
  of your code; for example, a function header. You can make this as clever as 
  you like.&lt;br /&gt;
&lt;b&gt;3. Fix it when it&#39;s wrong&lt;/b&gt;&lt;br /&gt;
It&#39;s normal to make errors while typing. Nobody can avoid it. The trick is 
  to quickly spot and correct them. The editor should be able to help you with 
  this. But you need to tell it what&#39;s wrong and what&#39;s right.&lt;br /&gt;
Very often you will make the same mistake again and again. Your fingers just 
  don&#39;t do what you intended. This can be corrected with abbreviations. A few 
  examples:&lt;br /&gt;
&lt;blockquote&gt;
&lt;pre&gt;:abbr Lunix Linux
:abbr accross across
:abbr hte the&lt;/pre&gt;
&lt;/blockquote&gt;
The words will be automatically corrected just after you typed them. 
The same mechanism can be used to type a long word with just a few characters. 
  Especially useful for words that you find hard to type, and it avoids that you 
  type them wrong. Examples:&lt;br /&gt;
&lt;blockquote&gt;
&lt;pre&gt;:abbr pn penguin
:abbr MS Mandrake Software&lt;/pre&gt;
&lt;/blockquote&gt;
However, these tend to expand to the full word when you don&#39;t want it, which 
  makes it difficult when you really want to insert &quot;MS&quot; in your text. 
  It is best to use short words that don&#39;t have a meaning of their own.&lt;br /&gt;
To find errors in your text Vim has a clever highlighting mechanism. This was 
  actually meant to be used to do syntax highlighting of programs, but it can 
  catch and highlight errors as well.&lt;br /&gt;
Syntax highlighting shows comments in colour. That doesn&#39;t sound like an important 
  feature, but once you start using it you will find that it helps a lot. You 
  can quickly spot text that should be a comment, but isn&#39;t highlighted as such 
  (you probably forgot a comment marker).Or see a line of code highlighted as 
  comment (you forgot to insert a &quot;*/&quot;). These are errors which are 
  hard to spot in a B&amp;amp;W file and can waste a lot of time when trying to debug 
  the code.&lt;br /&gt;
The syntax highlighting can also catch unbalanced braces. An unbalanced &quot;)&quot; 
  is highlighted with a bright red background. You can use the &lt;code&gt;%&lt;/code&gt; 
  command to see how they match, and insert a &quot;(&quot; or &quot;)&quot; at 
  the right position.&lt;br /&gt;
Other common mistakes are also quickly spotted, for example using &quot;#included 
  &lt;stdio.h&gt;&quot; instead of &quot;#include &lt;stdio.h&gt;&quot;. You easily 
  miss the mistake in B&amp;amp;W, but quickly spot that &quot;include&quot; is highlighted 
  while &quot;included&quot; isn&#39;t.&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;br /&gt;
A more complex example: for English text there is a long list of all words 
  that are used. Any word not in this list could be an error. With a syntax file 
  you can highlight all words that are not in the list. With a few extra macros 
  you can add words to the wordlist, so that they are no longer flagged as an 
  error. This works just as you would expect in a word processor. In Vim it is 
  implemented with scripts and you can further tune it for your own use: for example, 
  to only check the comments in a program for spelling errors.&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
  &lt;h3&gt;

Part 2: edit more files&lt;/h3&gt;
&lt;/center&gt;
&lt;b&gt;4. A file seldom comes alone&lt;/b&gt;&lt;br /&gt;
People don&#39;t work on just one file. Mostly there are many related files, and 
  you edit several after each other, or even several at the same time. You should 
  be able to take advantage of your editor to make working with several files 
  more efficient.&lt;br /&gt;
The previously mentioned tag mechanism also works for jumping between files. 
  The usual approach is to generate a tags file for the whole project you are 
  working on. You can then quickly jump between all files in the project to find 
  the definitions of functions, structures, typedefs, etc. The time you save compared 
  with manually searching is tremendous; creating a tags file is the first thing 
  I do when browsing a program.&lt;br /&gt;
Another powerful mechanism is to find all occurrences of a name in a group 
  of files, using the &lt;code&gt;:grep&lt;/code&gt; command. Vim makes a list of all matches, 
  and jumps to the first one. The &lt;code&gt;:cn&lt;/code&gt; command takes you to each next 
  match. This is very useful if you need to change the number of arguments in 
  a function call.&lt;br /&gt;
Include files contain useful information. But finding the one that contains 
  the declaration you need to see can take a lot of time. Vim knows about include 
  files, and can search them for a word you are looking for. The most common action 
  is to lookup the prototype of a function. Position the cursor on the name of 
  the function in your file and type &lt;code&gt;[I&lt;/code&gt;: Vim will show a list of 
  all matches for the function name in included files. If you need to see more 
  context, you can directly jump to the declaration. A similar command can be 
  used to check if you did include the right header files.&lt;br /&gt;
In Vim you can split the text area in several parts to edit different files. 
  Then you can compare the contents of two or more files and copy/paste text between 
  them. There are many commands to open and close windows, jump between them, 
  temporarily hide files, etc. Again you will have to use the three basic steps 
  to select the set of commands you want to learn to use.&lt;br /&gt;
There are more uses of multiple windows. The preview-tag mechanism is a very 
  good example. This opens a special preview window, while keeping the cursor 
  in the file you are working on. The text in the preview window shows, for example, 
  the function declaration for the function name that is under the cursor. If 
  you move the cursor to another name and leave it there for a second, the
  preview window will show the definition of that name. It could also be the
  name of a structure or a function which is declared in an include file of
  your project. &lt;br /&gt;
&lt;b&gt;5. Let&#39;s work together&lt;/b&gt;&lt;br /&gt;
An editor is for editing text. An e-mail program is for sending and receiving 
  messages. An Operating System is for running programs. Each program has its 
  own task and should be good at it. The power comes from having the programs 
  work together.&lt;br /&gt;
A simple example: Select some structured text in a list and sort it: &lt;code&gt;!sort&lt;/code&gt;. 
  The external &quot;sort&quot; command is used to filter the text. Easy, isn&#39;t 
  it? The sorting functionality could be included in the editor. But have a look 
  at &quot;man sort&quot;, it has a lot of options. And it&#39;s probably a nifty 
  algorithm that does the sorting. Do you want to include all that in an editor? 
  Also for other filter commands? It would grow &lt;u&gt;huge&lt;/u&gt;.&lt;br /&gt;
It has always been the spirit of Unix to have separate programs that do their 
  job well, and work together to perform a bigger task. Unfortunately, most editors 
  don&#39;t work too well together with other programs - you can&#39;t replace the e-mail 
  editor in Netscape with another one, for example. You end up using a crippled 
  editor. Another tendency is to include all kinds of functionality inside the 
  editor; Emacs is a good example of where this can end up. (Some call it an operating 
  system that can also be used to edit text.)&lt;br /&gt;
Vim tries to integrate with other programs, but this is still a struggle. Currently 
  it&#39;s possible to use Vim as the editor in MS-Developer Studio and Sniff. Some 
  e-mail programs that support an external editor, like Mutt, can use Vim. Integration 
  with Sun Workshop is being worked on. Generally this is an area that has to 
  be improved in the near future. Only then will we get a system that&#39;s better 
  than the sum of its parts.&lt;br /&gt;
&lt;b&gt;6. Text is structured&lt;/b&gt;&lt;br /&gt;
You will often work with text that has some kind of structure, but different 
  from what is supported by the available commands. Then you will have to fall 
  back to the &quot;building blocks&quot; of the editor and create your own macros 
  and scripts to work with this text. We are getting to the more complicated stuff 
  here.&lt;br /&gt;
One of the simpler things is to speed up the edit-compile-fix cycle. Vim has 
  the &lt;code&gt;:make&lt;/code&gt; command, which starts your compilation, catches the errors 
  it produces and lets you jump to the error locations to fix the problems. If 
  you use a different compiler, the error messages will not be recognised. Instead 
  of going back to the old &quot;write it down&quot; system, you should adjust 
  the &#39;&lt;code&gt;errorformat&lt;/code&gt;&#39; option. This tells Vim what your errors look 
  like and how to get the file name and line number out of them. It works for 
  the complicated gcc error messages, thus you should be able to make it work 
  for almost any compiler.&lt;br /&gt;
Sometimes adjusting to a type of file is just a matter of setting a few options 
  or writing a few macros. For example, to jump around manual pages, you can write 
  a macro that grabs the word under the cursor, clears the buffer and then reads 
  the manual page for that word into the buffer. That&#39;s a simple and efficient 
  way to lookup cross-references.&lt;br /&gt;
Using the three basic steps, you can work more effectively with any sort of 
  structured file. Just think about the actions you want to do with the file, 
  find the editor commands that do it and start using them. It&#39;s really as simple 
  as it sounds. You just have to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
  &lt;h3&gt;

Part 3: sharpen the saw&lt;/h3&gt;
&lt;/center&gt;
&lt;b&gt;7. Make it a habit&lt;/b&gt;&lt;br /&gt;
Learning to drive a car takes effort. Is that a reason to keep driving your 
  bicycle? No, you realize you need to invest time to learn a skill. Text editing 
  isn&#39;t different. You need to learn new commands and turn them into a habit.&lt;br /&gt;
On the other hand, you should not try to learn every command an editor offers. 
  That would be a complete waste of time. Most people only need to learn 10 to 
  20 percent of the commands for their work. But it&#39;s a different set of commands 
  for everybody. It requires that you lean back now and then, and wonder if there 
  is some repetitive task that could be automated. If you do a task only once, 
  and don&#39;t expect having to do it again, don&#39;t try to optimise it. But you probably 
  realize you have been repeating something several times in the last hour. Then 
  search the documentation for a command that can do it quicker. Or write a macro 
  to do it.&amp;nbsp; When it&#39;s a larger task, like lining out a specific sort of text, 
  you could look around in newsgroups or on the Internet to see if somebody
  already solved it for you.&lt;br /&gt;
The essential basic step is the last one. You can think of a repetitive task, 
  find a nice solution for it and after the weekend you forgot how you did it. 
  That doesn&#39;t work. You will have to repeat the solution until your fingers do 
  it automatically. Only then will you reach the efficiency you need. Don&#39;t try 
  to learn too many things at once. But doing a few at the same time will work 
  well. For tricks you don&#39;t use often enough to get them in your fingers, you 
  might want to write them down to be able to look them up later. Anyway, if you 
  keep the goal in view, you will find ways to make your editing more and more 
  effective.&lt;br /&gt;
One last remark to remind you of what happens when people ignore all the above: 
  I still see people who spend half their day behind a VDU looking up at their 
  screen, then down at two fingers, then up at the screen, etc. - and then wonder 
  why they get so tired... Type with ten fingers! It&#39;s not just faster, it also 
  is much less tiresome. Using a computer program for one hour each day, it only 
  takes a couple of weeks to learn to touch-type. &lt;br /&gt;
&lt;h4&gt;

Epilogue&lt;/h4&gt;
The idea for the title comes from the successful book &quot;The 7 habits of 
  highly effective people&quot; by Stephen R. Covey. I recommend it to everyone 
  who wants to solve personal and professional problems (and who doesn&#39;t?). Although 
  some of you will claim it came from the Dilbert book &quot;Seven years of highly 
  defective people&quot; by Scott Adams (also recommended!). See &lt;a href=&quot;http://iccf-holland.org/click1.html&quot;&gt;http://iccf-holland.org/click1.html&lt;/a&gt; 
  and go to &quot;recommended books and CDs&quot;.&lt;br /&gt;
&lt;br /&gt;
From &lt;a href=&quot;http://www.moolenaar.net/habits.html&quot;&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/1249503442033940060/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/seven-habbits-of-effective-text-editing.html#comment-form' title='Комментарии: 2'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1249503442033940060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1249503442033940060'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/seven-habbits-of-effective-text-editing.html' title='Seven habbits of effective text editing by Bram Moolenaar'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516653391373273766.post-8235850231751310091</id><published>2011-09-27T14:27:00.002+07:00</published><updated>2011-09-27T14:27:47.377+07:00</updated><title type='text'>Midnight Commander shortcuts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Ctrl + r -- Refresh active panel&lt;br /&gt;Ctrl + t -- Mark single file&lt;br /&gt;Ctrl + x c -- Opens chmod dialog for marked file&lt;br /&gt;Ctrl + x o -- Opens chown dialog for marked file&lt;br /&gt;Alt + ? -- Opens search dialog&lt;br /&gt;Ctrl-x a -- Open VFS list. If a ftp session times out, you can use this to free the open vfs so you can log in again.&lt;br /&gt;

&lt;br /&gt;

&lt;strong&gt;Panel Functions&lt;/strong&gt;&lt;br /&gt;

TAB -- Switch focus between left and right panel&lt;br /&gt;Insert -- Marks or removes mark on file(s)&lt;br /&gt;

Alt + F1..F12 (opens dialog for F1..F12 menu)&lt;br /&gt;

Alt + g -- Marks first file or directory in active panel&lt;br /&gt;Alt + r -- Marks middle file or directory in active panel&lt;br /&gt;Alt + j -- Marks last file or directory in active panel&lt;br /&gt;Alt + s -- Incremental search&lt;br /&gt;Ctrl + / -- Look for filename given in last line of active panel (not whole screen), and jumps on first file&lt;br /&gt;* (Asterisk) -- Marks removes marking for all files in active panel (not directories)&lt;br /&gt;+
 (Plus) -- Brings up the input box where it can be given regular 
expression. All files with names that fill condition(s) in regular 
expression will be marked.&lt;br /&gt;\ (Backslash) -- Remove marking for more data (opposite to + )&lt;br /&gt;

&lt;br /&gt;

&lt;strong&gt;Shell Functions&lt;/strong&gt;&lt;br /&gt;

Alt + Enter -- Copies selected filename in command line&lt;br /&gt;Ctrl + Shft + Enter -- Copies full path of selected file in the command line&lt;br /&gt;Alt + H -- Shows command line history&lt;br /&gt;

&lt;br /&gt;

&lt;strong&gt;Function Keys&lt;/strong&gt;&lt;br /&gt;

F1 -- Help&lt;br /&gt;F2 -- Opens user menu&lt;br /&gt;F3 -- View selected file content&lt;br /&gt;F4 -- Opens file in internal text editor&lt;br /&gt;F5 -- Copies selected file. Default is to another panel, but it asks first.&lt;br /&gt;F6 -- Moving file. Default is to another panel, but it asks first.&lt;br /&gt;F7 -- Make directory.&lt;br /&gt;F8 -- Delete file or directory.&lt;br /&gt;F9 -- Opens main menu at the top of the screen.&lt;br /&gt;F10 -- Ends current action; editor, viewer, dialog window or ends mc program.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/8235850231751310091/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/midnight-commander-shortcuts.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8235850231751310091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8235850231751310091'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/midnight-commander-shortcuts.html' title='Midnight Commander shortcuts'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-2987861036207834106</id><published>2011-09-25T20:52:00.004+07:00</published><updated>2011-09-25T20:53:34.394+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="meld"/><title type='text'>Hiw to diff local changes with remote revision with git ?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre&gt;&lt;code&gt;
&lt;/code&gt;&lt;code class=&quot;python&quot;&gt;~/diff.py:&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;python&quot;&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;#!/usr/bin/python&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;
import sys
import os

os.system(&#39;meld &quot;%s&quot; &quot;%s&quot;&#39; % (sys.argv[2], sys.argv[5]))&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ chmod +x ~/diff.py &lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ git config --global diff.external ~/diff.py&lt;/code&gt;&lt;code class=&quot;python&quot;&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$ git diff origin/master&lt;/code&gt;&lt;code class=&quot;python&quot;&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/2987861036207834106/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/hiw-to-diff-local-changes-with-remote.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2987861036207834106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2987861036207834106'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/hiw-to-diff-local-changes-with-remote.html' title='Hiw to diff local changes with remote revision with git ?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-5979867065168827907</id><published>2011-09-25T20:36:00.002+07:00</published><updated>2011-09-25T20:36:48.162+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><title type='text'>Git: comparing changes between commits</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Comparing the differences in the whole project since last commit (or any other):&lt;/h2&gt;
&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff HEAD~&lt;/blockquote&gt;
you can also compare between current state and some older commits:&lt;br /&gt;

&lt;ul&gt;
&lt;li&gt;Two commits ago&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff HEAD~2&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Differences between two commits ago and three comits ago&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff HEAD~2 HEAD~3&lt;/blockquote&gt;
All of the above can be of course applied to a single unique file. For example:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff HEAD~2 HEAD~3 main.cpp&lt;/blockquote&gt;
Instead of reference to head you can use a sha1 sum assigned to every commit or blob number or tags:&lt;br /&gt;

&lt;ul&gt;
&lt;li&gt;Single File or whole repo with a blob:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff d0403e0 9c20bb9 main.cpp&lt;br /&gt;

&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff d0403e0 9c20bb9&lt;/blockquote&gt;
the same as can be done with sha1 hashes or tags.&lt;br /&gt;

Comparison can of course be done also in between branches.&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff -b dev [&lt;file&gt;]&lt;/file&gt;&lt;/blockquote&gt;
or even without -b parameter, comparing between state at current &lt;b style=&quot;background-color: #ff9999; color: black;&quot;&gt;branch&lt;/b&gt; and the last commit of given one:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff &lt;branch_name&gt; [&lt;file&gt;]&lt;/file&gt;&lt;/branch_name&gt;&lt;/blockquote&gt;
In every situation instead of data change you can see what files 
really changed. This can be achieved with --name-only parameter passed 
to diff. For example, to see files changes between current state and 
last commit:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; diff HEAD~ --name-only&lt;/blockquote&gt;
Sometimes you only have to check in which commits a single file has 
been changed, in that kind of situations &quot;whatchanged&quot; command can be 
very handy. It display in which commits a given file has been changed:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; whatchanged &lt;file&gt;&lt;/file&gt;&lt;/blockquote&gt;
&lt;h2&gt;
Graphical diff/merge tools&lt;/h2&gt;
Every of the above command will print the text diff acceptable by 
patch tool, but in case of very big diffs not very readable for humans. 
There is of course no problem to use any other diff tool of own kind. 
The command syntax remains the same except now we use difftool instead 
of diff, i.e.:&lt;br /&gt;

Launch graphical difftool &lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt; and compare the contents of main.cpp between current state and last commit:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; difftool -t &lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt; HEAD~ main.cpp&lt;/blockquote&gt;
The same applies to merging, in those cases we use mergetool. The 
syntax is the same as above. For example, to merge data from file 
main.cpp on &lt;b style=&quot;background-color: #ff9999; color: black;&quot;&gt;branch&lt;/b&gt; &quot;dev&quot; to current &lt;b style=&quot;background-color: #ff9999; color: black;&quot;&gt;branch&lt;/b&gt; we use:&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; mergetool -t &lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt; dev main.cpp&lt;/blockquote&gt;
This is not of course most convenient way. You can configure your 
favourite merge/diff tool (from the set which is currently supported by &lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt;, you can also add your own merge tool to &lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt;, but I wont cover this part) to be used as default by setting the &lt;tt&gt;merge.tool variable.:&lt;/tt&gt;&lt;br /&gt;

&lt;blockquote&gt;
&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; config --global merge.tool=&lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt;&lt;br /&gt;

&lt;b style=&quot;background-color: #a0ffff; color: black;&quot;&gt;git&lt;/b&gt; config --global diff.tool=&lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt;&lt;/blockquote&gt;
From now on &quot;&lt;b style=&quot;background-color: #ffff66; color: black;&quot;&gt;meld&lt;/b&gt;&quot; will be used as default diff/merge tool and theres no need to pass it with -t parameter to difftool/mergetool command.&lt;br /&gt;

&lt;div id=&quot;_mcePaste&quot; style=&quot;height: 1px; left: -10000px; overflow: hidden; position: absolute; top: 67px; width: 1px;&quot;&gt;
﻿&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/5979867065168827907/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/git-comparing-changes-between-commits.html#comment-form' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/5979867065168827907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/5979867065168827907'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/git-comparing-changes-between-commits.html' title='Git: comparing changes between commits'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516653391373273766.post-8797375105322572395</id><published>2011-09-16T18:47:00.003+07:00</published><updated>2011-09-16T18:47:54.020+07:00</updated><title type='text'>How to read a file line by line in C style?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main ( void )&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp;static const char filename[] = &quot;file.txt&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;FILE *file = fopen ( filename, &quot;r&quot; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp;if ( file != NULL )&amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; char line [ 128 ]; /* or other suitable maximum line size */&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; while ( fgets ( line, sizeof line, file ) != NULL ) /* read a line */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fputs ( line, stdout ); /* write the line */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; fclose ( file );&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;else&lt;br /&gt;
&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; perror ( filename ); /* why didn&#39;t the file open? */&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/8797375105322572395/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/how-to-read-file-line-by-line-in-c.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8797375105322572395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8797375105322572395'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/how-to-read-file-line-by-line-in-c.html' title='How to read a file line by line in C style?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-278878848830039356</id><published>2011-09-16T18:45:00.003+07:00</published><updated>2011-09-16T18:45:43.844+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Convert string to UPPERCASE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#include &amp;lt; string &amp;gt;&lt;br /&gt;
#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;
#include &amp;lt; ctype.h &amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
void stoupper(string&amp;amp; s)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; string::iterator i = s.begin();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; string::iterator end = s.end();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; while (i != end) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *i = toupper((unsigned char)*i);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++i;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; string str = &quot;Some string&quot;; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; stoupper(str);&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/278878848830039356/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/convert-string-to-uppercase.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/278878848830039356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/278878848830039356'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/convert-string-to-uppercase.html' title='Convert string to UPPERCASE'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-2553670371265071944</id><published>2011-09-16T18:24:00.001+07:00</published><updated>2011-09-16T18:24:56.673+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Snippet for sorting map by values in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
#include &amp;lt; algorithm &amp;gt;&lt;br /&gt;#include &amp;lt; iostream &amp;gt;&lt;br /&gt;#include &amp;lt; map &amp;gt;&lt;br /&gt;#include &amp;lt; string &amp;gt;&lt;br /&gt;#include &amp;lt; vector &amp;gt;&lt;algorithm&gt;&lt;iostream&gt;&lt;map&gt;&lt;string&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/string&gt;&lt;/map&gt;&lt;/iostream&gt;&lt;/algorithm&gt;&lt;br /&gt;
&lt;algorithm&gt;&lt;iostream&gt;&lt;map&gt;&lt;string&gt;&lt;vector&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;typedef pair&lt;string, int=&quot;&quot;&gt; mypair;&lt;br /&gt;&lt;br /&gt;struct IntCmp {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool operator()(const mypair &amp;amp;lhs, const mypair &amp;amp;rhs) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lhs.second &amp;lt; rhs.second;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; map&lt;string, int=&quot;&quot;&gt; m; &lt;br /&gt;&amp;nbsp;&amp;nbsp; m[&quot;A&quot;] = 5;&lt;br /&gt;&amp;nbsp;&amp;nbsp; m[&quot;B&quot;] = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp; m[&quot;C&quot;] = 2;&lt;br /&gt;&amp;nbsp;&amp;nbsp; m[&quot;D&quot;] = 4;&lt;br /&gt;&amp;nbsp;&amp;nbsp; vector&lt;mypair&gt; v(m.begin(), m.end());&lt;br /&gt;&amp;nbsp;&amp;nbsp; partial_sort(v.begin(), v.begin() + m.size() - 1, v.end(), IntCmp());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; m.size(); i++)&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; &quot;: &quot; &amp;lt;&amp;lt; v[i].first &amp;lt;&amp;lt; &quot; --&amp;gt; &quot; &amp;lt;&amp;lt; v[i].second &amp;lt;&amp;lt; &quot;\n&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/mypair&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/vector&gt;&lt;/string&gt;&lt;/map&gt;&lt;/iostream&gt;&lt;/algorithm&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/2553670371265071944/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-sorting-map-by-values-in-c.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2553670371265071944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/2553670371265071944'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-sorting-map-by-values-in-c.html' title='Snippet for sorting map by values in C++'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-4634595686064864369</id><published>2011-09-15T21:11:00.003+07:00</published><updated>2011-09-15T21:11:57.449+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Snippet for splitting string in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt; string &amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include &amp;lt; sstream &amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include &amp;lt; iostream &amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Hello world&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;stringstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ss&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;    

    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ss&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sc&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;endl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/4634595686064864369/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-splitting-string-in-c.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4634595686064864369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/4634595686064864369'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-splitting-string-in-c.html' title='Snippet for splitting string in C++'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-3642205424525882771</id><published>2011-09-15T19:31:00.005+07:00</published><updated>2011-09-15T19:44:27.634+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="snippets"/><title type='text'>Snippet for text file reading in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// reading a text file&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt; iostream &amp;gt;&lt;iostream&gt;&lt;/iostream&gt;&lt;/dfn&gt;
&lt;dfn&gt;#include &amp;lt; fstream &amp;gt;&lt;fstream&gt;&lt;/fstream&gt;&lt;/dfn&gt;
&lt;dfn&gt;#include &amp;lt; string &amp;gt;&lt;string&gt;&lt;/string&gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;int&lt;/var&gt; main () {
  string line;
  ifstream myfile (&lt;kbd&gt;&quot;example.txt&quot;&lt;/kbd&gt;);
  &lt;var&gt;if&lt;/var&gt; (myfile.is_open()) {
    &lt;var&gt;while&lt;/var&gt; (myfile.good()){
      getline (myfile,line);
      cout &amp;lt;&amp;lt; line &amp;lt;&amp;lt; endl;
    }
    myfile.close();
  }

  &lt;var&gt;else&lt;/var&gt; cout &amp;lt;&amp;lt; &lt;kbd&gt;&quot;Unable to open file&quot;&lt;/kbd&gt;; 

  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/3642205424525882771/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-text-file-reading-in-c.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3642205424525882771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3642205424525882771'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/snippet-for-text-file-reading-in-c.html' title='Snippet for text file reading in C++'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-8281154787621136802</id><published>2011-09-14T19:25:00.000+07:00</published><updated>2011-09-14T19:27:36.578+07:00</updated><title type='text'>C++: How to round number until N&#39;th digit after decimal point</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
#include &amp;lt; iostream &amp;gt;&lt;br /&gt;
#include  &amp;lt; iomanip &amp;gt; 
&lt;br /&gt;
using namespace std; &lt;br /&gt;
&lt;br /&gt;
int main() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cout.setf(ios::fixed);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout.setprecision(2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; 98765.12345 // 98765.12&lt;br /&gt;
} &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/8281154787621136802/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/c-how-to-round-number-until-nth-digit.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8281154787621136802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/8281154787621136802'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/c-how-to-round-number-until-nth-digit.html' title='C++: How to round number until N&#39;th digit after decimal point'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-7574376692836189569</id><published>2011-09-12T15:57:00.000+07:00</published><updated>2011-09-12T16:12:11.039+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><title type='text'>GIT: how to push new local branch to remote repository?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
$ git push origin dev&lt;br /&gt;
&lt;br /&gt;
To fetch it:&lt;br /&gt;
$ git fetch origin dev:dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/7574376692836189569/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/09/git-how-to-push-new-local-branch-to.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/7574376692836189569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/7574376692836189569'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/09/git-how-to-push-new-local-branch-to.html' title='GIT: how to push new local branch to remote repository?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-3131212968541451766</id><published>2011-08-23T14:31:00.002+07:00</published><updated>2011-08-23T14:32:34.074+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>How to disable cursor blinking in gnome-terminal in Ubuntu 11.04</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;$gconftool-2 -s /apps/gnome-terminal/profiles/Default/cursor_blink_mode&amp;nbsp;-t string off&lt;br /&gt;
&lt;br /&gt;
from&amp;nbsp;&lt;a href=&quot;http://www.jurta.org/en/prog/noblink&quot;&gt;http://www.jurta.org/en/prog/noblink&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/3131212968541451766/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/08/how-to-disable-cursor-blinking-in-gnome.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3131212968541451766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3131212968541451766'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/08/how-to-disable-cursor-blinking-in-gnome.html' title='How to disable cursor blinking in gnome-terminal in Ubuntu 11.04'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-1364415819507600304</id><published>2011-02-11T12:32:00.004+06:00</published><updated>2011-02-11T15:48:21.079+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tcpflow"/><title type='text'>Как использовать tcpflow</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;TODO&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; white-space: pre;&quot;&gt;sudo tcpflow -i eth0 -cpve host google.com&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/1364415819507600304/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/02/tcpflow.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1364415819507600304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/1364415819507600304'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/02/tcpflow.html' title='Как использовать tcpflow'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-737498464475785248</id><published>2011-01-17T23:56:00.000+06:00</published><updated>2011-01-17T23:56:05.091+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apt-get"/><category scheme="http://www.blogger.com/atom/ns#" term="aptitude"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>How to get and remove build dependencies in Ubuntu?</title><content type='html'>To get all dependencies, necessary for building we use&lt;br /&gt;
apt-get build-dep {packagename}&lt;br /&gt;
or&lt;br /&gt;
aptitude build-dep {packagename}&lt;br /&gt;
but how to remove it?&lt;br /&gt;
There is no built-in func for it, but I found an answer on &lt;a href=&quot;https://answers.launchpad.net/apt/+question/8366&quot;&gt;launchpad&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 17px;&quot;&gt;sudo aptitude markauto $(apt-cache showsrc YOUR_APP_NAME | grep Build-Depends: | sed -e &#39;s/Build-&lt;wbr style=&quot;font-family: Ubuntu, UbuntuBeta !important;&quot;&gt;&lt;/wbr&gt;Depends:&lt;wbr style=&quot;font-family: Ubuntu, UbuntuBeta !important;&quot;&gt;&lt;/wbr&gt;\|,\|([&lt;wbr style=&quot;font-family: Ubuntu, UbuntuBeta !important;&quot;&gt;&lt;/wbr&gt;^)]*)//&lt;wbr style=&quot;font-family: Ubuntu, UbuntuBeta !important;&quot;&gt;&lt;/wbr&gt;g&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 17px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/737498464475785248/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/01/how-to-get-and-remove-build.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/737498464475785248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/737498464475785248'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/01/how-to-get-and-remove-build.html' title='How to get and remove build dependencies in Ubuntu?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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-3516653391373273766.post-3990925391929698253</id><published>2011-01-17T15:16:00.002+06:00</published><updated>2011-01-17T15:27:47.276+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="errors"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><title type='text'>Проблема c push  в git</title><content type='html'>Недавно я столкнулся со следующей проблемой в git:&lt;br /&gt;
&lt;div&gt;$ git stash&lt;/div&gt;&lt;div&gt;&lt;div&gt;$ git checkout -b secbranch&lt;/div&gt;&lt;div&gt;$ git shash pop&lt;br /&gt;
&lt;div&gt;$ git push&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;error: failed to push some refs to &#39;git@git.assembla.com:myspace.git&#39;&lt;/div&gt;&lt;div&gt;To prevent you from losing history, non-fast-forward updates were rejected&lt;/div&gt;&lt;div&gt;Merge the remote changes before pushing again. &amp;nbsp;See the &#39;Note about&lt;/div&gt;&lt;div&gt;fast-forwards&#39; section of &#39;git push --help&#39; for details.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;$ git push origin +HEAD:HEAD&lt;/div&gt;&lt;div&gt;И все заработало нормально.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gennadz.blogspot.com/feeds/3990925391929698253/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://gennadz.blogspot.com/2011/01/c-push-git.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3990925391929698253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516653391373273766/posts/default/3990925391929698253'/><link rel='alternate' type='text/html' href='http://gennadz.blogspot.com/2011/01/c-push-git.html' title='Проблема c push  в git'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06603316559473917518</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>