<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2721332859140255801</atom:id><lastBuildDate>Fri, 03 Feb 2012 22:28:40 +0000</lastBuildDate><category>Vim</category><category>Digest</category><category>Debian</category><title>Zoresvit</title><description>security, cryptography and everything else</description><link>http://zoresvit.blogspot.com/</link><managingEditor>noreply@blogger.com (Ruslan Kiyanchuk)</managingEditor><generator>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/zoresvit" /><feedburner:info uri="zoresvit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2721332859140255801.post-5501856065551122969</guid><pubDate>Fri, 16 Sep 2011 22:29:00 +0000</pubDate><atom:updated>2012-01-28T01:38:09.430+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Digest</category><category domain="http://www.blogger.com/atom/ns#">Debian</category><title>Fix It Digest: logging and fonts</title><description>&lt;div style="text-align: justify;"&gt;
Fix It digest highlights some short how-tos and tutorials I found useful and important but too small for a separate post. So here we go.&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Enable sudo logging&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
It's useful to have all priviledged commands been logged. You might use the log for&amp;nbsp;auditing&amp;nbsp;purposes and to refresh your memory about some changes&amp;nbsp;you've done&amp;nbsp;to the system. To enable sudo commands logging you need to edit &lt;span class="Apple-style-span" style="color: #274e13;"&gt;/etc/sudoers&lt;/span&gt; file. But you &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;b&gt;never&lt;/b&gt; &lt;/span&gt;edit this file using just the text editor! The only way you can touch the&amp;nbsp;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;sudoers&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt;&amp;nbsp;&lt;/span&gt;file is by executing &lt;span class="Apple-style-span" style="color: #38761d;"&gt;&lt;b&gt;visudo&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #674ea7;"&gt; &lt;/span&gt;program with root privileges:&lt;/div&gt;
&lt;pre class="prettyprint lang-bash"&gt;$ sudo visudo
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
This will still launch your default text editor but will prevent you from making mistakes in the &lt;span class="Apple-style-span" style="color: #274e13;"&gt;sudoers&lt;/span&gt; configuration file (it simply won't let you save it until you get it right). Once you can safely edit sudo configuration, add the following line:&lt;/div&gt;
&lt;pre class="prettyprint lang-bash"&gt;Defaults    log_year, logfile=/var/log/sudo.log
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
This option will enable sudo logging to&lt;span class="Apple-style-span" style="color: #0b5394;"&gt; /var/log/sudo.log&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #274e13;"&gt; &lt;/span&gt;file. The &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;log_year&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #20124d;"&gt; &lt;/span&gt;option will add current year the the&amp;nbsp;time stamp. It is useful if the log is going to be stored for a long time (multiple years).&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Enable boot logging&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
For some reason boot logging in Debian is disabled by default. It is always useful to be able to see how the system boot goes, so to enable it you need to edit the &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;/etc/default/bootlogd&lt;/span&gt; file. Change the&lt;span class="Apple-style-span" style="color: #0b5394;"&gt; BOOTLOGD_ENABLE&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #20124d;"&gt; &lt;/span&gt;parameter to &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;yes&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #20124d;"&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint lang-bash"&gt;# Run bootlogd at startup ?
BOOTLOGD_ENABLE=yes
&lt;/pre&gt;
Now all the boot messages are logged to &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;/var/log/boot&lt;/span&gt; file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Displaying&amp;nbsp;Japanese&amp;nbsp;fonts&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
I've noticed that Google Chrome couldn't display Japanese symbols (and other&amp;nbsp;hieroglyphs) even though the encoding was set to UTF-8. As I found out later it had nothing to do with the encoding. Just the needed fonts weren't installed on the system. Installing&lt;span class="Apple-style-span" style="color: #0b5394;"&gt; ttf-ipafont &lt;/span&gt;package will fix the problem.&lt;/div&gt;
&lt;pre class="prettyprint lang-bash"&gt;$ sudo aptitude install ttf-ipafont
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
If you have the same issue with other languages try searching the repository for corresponding fonts with &lt;span class="Apple-style-span" style="color: #38761d;"&gt;aptitude search&lt;/span&gt;. Just search for &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;ttf&lt;/span&gt; packages and use &lt;span class="Apple-style-span" style="color: #38761d;"&gt;grep &lt;/span&gt;to filter needed language. For example you can search for Korean language fonts:&lt;/div&gt;
&lt;pre class="prettyprint lang-bash"&gt;$ aptitude search ttf | grep -i korean
p   ttf-nanum          - Nanum Korean TrueType fonts               
p   ttf-nanum-coding   - Nanum Coding fixed width Korean TrueType f
p   ttf-unfonts-core   - Un series Korean TrueType fonts           
p   ttf-unfonts-extra  - Un series Korean TrueType fonts (extra) 
&lt;/pre&gt;
Or Chinese fonts:&lt;br /&gt;
&lt;pre class="prettyprint lang-bash"&gt;$ aptitude search ttf | grep -i chinese
i   ttf-arphic-bkai00mp - "AR PL KaitiM Big5" Chinese TrueType fon 
p   ttf-arphic-bsmi00lp - "AR PL Mingti2L Big5" Chinese TrueType f
i   ttf-arphic-gbsn00lp - "AR PL SungtiL GB" Chinese TrueType font
p   ttf-arphic-gkai00mp - "AR PL KaitiM GB" Chinese TrueType font 
p   ttf-arphic-ukai     - "AR PL UKai" Chinese Unicode TrueType fo
p   ttf-arphic-uming    - "AR PL UMing" Chinese Unicode TrueType f
&lt;/pre&gt;
Once all the needed fonts are installed your browser shouldn't have any problems displaying most extraordinary symbols.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2721332859140255801-5501856065551122969?l=zoresvit.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zoresvit/~4/Oh6YRZ5YfmY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/zoresvit/~3/Oh6YRZ5YfmY/weekly-fix-it-digest-debian-logging-and.html</link><author>noreply@blogger.com (Ruslan Kiyanchuk)</author><feedburner:origLink>http://zoresvit.blogspot.com/2011/09/weekly-fix-it-digest-debian-logging-and.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2721332859140255801.post-1319246241256699571</guid><pubDate>Wed, 19 Jan 2011 23:46:00 +0000</pubDate><atom:updated>2012-01-27T16:21:24.335+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Vim</category><title>Introduction to Vim</title><description>&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;If you have ever had to press these keys on your keyboard:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;&lt;span style="font-family: inherit;"&gt;↑ → → → → → CTRL + C ↓ ↓ ↓ → → → → CTRL + V&lt;/span&gt;&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;or these:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;&lt;span style="font-family: inherit;"&gt;, CTRL → , CTRL → , CTRL → , CTRL → ,&lt;/span&gt;&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;than you use a wrong text editor.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;How annoying the routine text editing operations can get?! While doing monkey-editing stuff you lose your time, motivation and sometimes even the idea you've had on your mind. Suppose, you have a string:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;&lt;span style="font-family: inherit;"&gt;Fire Me Up - Manteca - Intro.mp3&lt;/span&gt;&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;And you have to transform it to the following string:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;&lt;span style="font-family: inherit;"&gt;id3v2 -A"Fire Me Up" -a"Manteca" -T1 -t "Intro" "01 Intro.mp3"&lt;/span&gt;&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Nothing impossible, just another 10-20 key pressings on GUI arrows, some copy-pasting and you are done. But what if you have about 1000 such strings and each one has to be transformed? Panic! "Well, I can write a script and use regular expressions", — some of you might think. But why write the whole script just for one-time case? Besides, how many RegExp rules do you remember? If you have never used&amp;nbsp;&lt;a href="http://www.vim.org/"&gt;Vim&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="http://www.gnu.org/software/emacs/"&gt;Emacs&lt;/a&gt;, you know nothing about text editing and have no idea about how much more comfortable, effective and fast it can get. Studying Vim editor is said to be complex. I'll tell you a secret — all new information is complex for studying. If studying something seemed easy for you, it's just because of former experience with similar problems. And why you need to study something you already know? You won't find out anything new. If you want to learn how to walk and how to run, not to crawl &amp;nbsp;— learn Vim.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: helvetica;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Introduction&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
What makes Vim so different from the rest of the text editors and what makes it so functional and useful? Modes. In contrast to usual one-moded editor, where you are always in insert mode: navigate through text using cursor and highlight stuff with mouse or &lt;strong&gt;Shift&lt;/strong&gt; (&lt;strong&gt;Ctrl + Shift &lt;/strong&gt;at best), Vim has 3 main modes of operation:&lt;/div&gt;
&lt;/div&gt;
&lt;ul style="text-align: justify;"&gt;
&lt;li style="text-align: justify;"&gt;&lt;strong&gt;Insert Mode&lt;/strong&gt;&amp;nbsp;— direct text input;&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;&lt;strong&gt;Normal Mode&lt;/strong&gt; (Command Mode)&amp;nbsp;— text formatting, executing various functions (including user defined functions);&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;&lt;strong&gt;Visual Mode&lt;/strong&gt;&amp;nbsp;— highlighting the text in various ways. It is much more powerful than anything what you've used before.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
Splitting down to several modes enables the editor to be highly optimized for performing any operation on the text you might think of: weather it's highlighting some area (a column, for instance) — &lt;strong&gt;Visual Mode&lt;/strong&gt;, formatting (auto-indentation&amp;nbsp;in source code, defined for your own style), changing the text (replacing words, sentences or whole lines at once) — &lt;strong&gt;Normal Mode&lt;/strong&gt;, inserting text (from new line, from above line, after the third word in the line or at line start) —&lt;span style="font-family: helvetica;"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Insert Mode&lt;/strong&gt;. Vim can also work with numerous files, perform similar changes to all opened files at once, do some processing on the file before reading, just after the file is read or after writing it to disk (insert templates based on file extension, add author, file creation and editing date, backup — anything).&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
The capability of Vim is limited only with you imagination and gumption. All you have to do to save days of your life is spend few hours for learning and few days for practicing Vim. It's better to see once than read 100 times (just 3.5 minutes of your time and you'll know how to efficiently solve the previous string transformation problem):&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;object height="313" width="400"&gt; &lt;param name="allowfullscreen" value="true" /&gt;


                  &lt;param name="allowscriptaccess" value="always" /&gt;


                  &lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6025010&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=1&amp;amp;color=00ADEF&amp;amp;fullscreen=1&amp;amp;autoplay=0&amp;amp;loop=0" /&gt;


                  &lt;embed type="application/x-shockwave-flash" width="400" height="313" src="http://vimeo.com/moogaloop.swf?clip_id=6025010&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=1&amp;amp;color=00ADEF&amp;amp;fullscreen=1&amp;amp;autoplay=0&amp;amp;loop=0" allowfullscreen="true" allowscriptaccess="always"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
And it's just about 0,1% of Vim power.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;How to start?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
Only sensible ones&amp;nbsp;who really want to learn Vim&amp;nbsp;have gotten this far. At least, I believe so and want to help you. But I'm not going to create tutorial videos or tell about Vim from scratch. I'm too lazy for that, because far more experienced and competent users have already done that before me.&amp;nbsp;But I'm going to show you what and where to search for.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
You can install Vim with the following command:&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;$ aptitude install vim&lt;/pre&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
or download it from the&amp;nbsp;&lt;a href="http://www.vim.org/download.php"&gt;official site&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
For the first familiarity with Vim you should complete the &lt;em&gt;&lt;a href="http://linuxcommand.org/man_pages/vimtutor1.html"&gt;Vimtutor&lt;/a&gt;&lt;/em&gt;. You can start &lt;em&gt;Vimtutor&lt;/em&gt;&amp;nbsp;with the command (no way!):&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="prettyprint" style="text-align: justify;"&gt;vimtutor&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
After learning Vim basics you can move on forward. There is no better resource on Internet for Vim newbies than&amp;nbsp;&lt;a href="http://www.derekwyatt.org/"&gt;Derek Wyatt's blog&lt;/a&gt;, precisely the&amp;nbsp;&lt;a href="http://www.derekwyatt.org/category/vim/"&gt;Vim section&lt;/a&gt;. It has some awesome&amp;nbsp;&lt;a href="http://www.derekwyatt.org/vim/vim-tutorial-videos/"&gt;videos&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.derekwyatt.org/vim/the-vimrc-file/"&gt;settings description&lt;/a&gt;, and working with&amp;nbsp;&lt;a href="http://www.derekwyatt.org/vim/working-with-vim-and-cpp/"&gt;Vim and C++&lt;/a&gt;. Derek made a great Vim overview, far better than I could ever make. Yet if you'll have any questions I'll try to do my best answering them in comments.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
You shold start from the&amp;nbsp;&lt;a href="http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-novice-tutorial-videos/"&gt;novice tutorial videos&lt;/a&gt;. Here Derek explains differences between Vim and everything else and explains basic functioning of Vim text editor.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
After the initial&amp;nbsp;acquaintance with Vim you might want to configure the text editor to meet your own needs. I'll talk about my solutions, settings and optimizations in the next blog posts.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;strong&gt;PS: &lt;/strong&gt;You don't&amp;nbsp;necessarily have to memorize all Vim shortcuts at once — you'll get them automatically memorized through time in case of frequent usage. After a while you'll remember all useful shoftcuts.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2721332859140255801-1319246241256699571?l=zoresvit.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zoresvit/~4/15_s72XyTy8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/zoresvit/~3/15_s72XyTy8/introduction-to-vim_20.html</link><author>noreply@blogger.com (Ruslan Kiyanchuk)</author><feedburner:origLink>http://zoresvit.blogspot.com/2011/01/introduction-to-vim_20.html</feedburner:origLink></item></channel></rss>

