<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.7.4">Jekyll</generator><link href="https://vardan.pro/feed.xml" rel="self" type="application/atom+xml" /><link href="https://vardan.pro/" rel="alternate" type="text/html" /><updated>2019-03-04T13:18:29+00:00</updated><id>https://vardan.pro/feed.xml</id><title type="html">vardan.pro</title><subtitle>Vardan Pogosian is Software developer and IT consultant. Love Go, Ruby and JS.</subtitle><author><name>Vardan Pogosian</name></author><entry><title type="html">Grand refactoring of SublimeText Nodejs plugin</title><link href="https://vardan.pro/2017/11/30/grand-refactoring-of-sublimetext-nodejs-plugin.html" rel="alternate" type="text/html" title="Grand refactoring of SublimeText Nodejs plugin" /><published>2017-11-30T08:58:26+00:00</published><updated>2017-11-30T08:58:26+00:00</updated><id>https://vardan.pro/2017/11/30/grand-refactoring-of-sublimetext-nodejs-plugin</id><content type="html" xml:base="https://vardan.pro/2017/11/30/grand-refactoring-of-sublimetext-nodejs-plugin.html">&lt;p&gt;I’m very happy to announce the second version of Nodejs Sublime Text plugin. 
This is big release with a big refactorings and new features.&lt;/p&gt;

&lt;h2 id=&quot;intro&quot;&gt;Intro&lt;/h2&gt;

&lt;p&gt;On November 2016 I’ve started to support (this is said very strongly), 
started to play around with SublimeText &lt;a href=&quot;https://packagecontrol.io/packages/Nodejs&quot;&gt;Nodejs plugin&lt;/a&gt;. The plugin was very 
small and has several bugs and unknown issue under the hood.&lt;/p&gt;

&lt;p&gt;In those days I was playing around with Nodejs and favorite code editor was 
SublimeText, as always. I installed Nodejs plugin from 
&lt;a href=&quot;https://packagecontrol.io&quot;&gt;packagecontrol.io&lt;/a&gt; and found several bugs as I 
mentioned earlier. I thought… Ohh, this is awful, take in count that Nodejs
was a hype, and still the hype, but nowadays with a small pressure of Go. IMHO. 😇&lt;/p&gt;

&lt;p&gt;In a such situation I directly go the GitHub repository of the project and 
looking for recent activity, to be sure that project is not abandoned. I saw 
that last commit was made to the project was in late 2013. Also, users left 
issues, but with no answer from the maintainer. Then, I thought… There is a 
two piece of technology which I love, and I always want to contribute to the 
Open Source. No sooner said than done.&lt;/p&gt;

&lt;p&gt;The plan was simple. Fixing bugs which I will encounter with. Over time, I 
realized problem in fixing bugs, because of plugin architecture, missing of 
tests, debugging capabilities etc.&lt;/p&gt;

&lt;h2 id=&quot;the-plans-is-changing&quot;&gt;The plans is changing&lt;/h2&gt;

&lt;p&gt;As I mentioned earlier I was suffering without tests and debug capabilities. 
One bug fix could fork another bugs and issues. More over, some bugs could be 
fixed on one platform and still exists on another ones. Then I decided to make 
my life easier and makes me more happier.&lt;/p&gt;

&lt;h2 id=&quot;what-was-done&quot;&gt;What was done&lt;/h2&gt;

&lt;p&gt;A lot stuff was refactored and reconsidered. All changes logical could be 
divided in two groups: for user experience and for developer comfort.&lt;/p&gt;

&lt;h3 id=&quot;developer-comfort&quot;&gt;Developer comfort&lt;/h3&gt;
&lt;p&gt;Lets start with a list of changes and little explanation for what, how and 
possible why it was done.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The whole code of plugin in earlier versions was located at one big file 
&lt;code class=&quot;highlighter-rouge&quot;&gt;Nodejs.py&lt;/code&gt;. Will make decision to divide and re-locate the whole code to base 
into logical modules and move into &lt;code class=&quot;highlighter-rouge&quot;&gt;lib&lt;/code&gt; folder. Now he have the following 
logical parts:
    &lt;ol&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_base.py&lt;/code&gt; - base command classes for the rest of Sublime Text commands&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_command_thread.py&lt;/code&gt; - classes for running underlying OS specific commands&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_commands.py&lt;/code&gt; - core classes for the plugin functionality (node_run, node_drun and etc.)&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_constants.py&lt;/code&gt; - several constants for PLUGIN_PATH and etc.&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_debug.py&lt;/code&gt; - debugging functions&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nodejs_nvm.py&lt;/code&gt; - class for detecting and working with NVM (Nodejs Version Manager)&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added debugging capabilities. Throughout of the code you call &lt;code class=&quot;highlighter-rouge&quot;&gt;debug&lt;/code&gt; functions 
to output some of debug data to the Sublime Text console. The data will be printed 
only if file &lt;code class=&quot;highlighter-rouge&quot;&gt;.debug_plugin&lt;/code&gt; exists in the plugin root directory. Simple remove 
the file to disable debug output.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Unit testing was introduced with help of great job done by &lt;a href=&quot;https://github.com/randy3k/UnitTesting&quot;&gt;Randy3k&lt;/a&gt;.
This is a great module for writing acceptance tests for Sublime Text 
plugins. You can also use it to write simple plain unit tests for core parts 
of your plugin using plain old Python.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The Randy3k unit testing plugin also allow you to run tests in CI (continuous 
integration) services such as Travis Ci and Appveyor. Bang! I used it as well as 
tests. Now we can test plugin functionality on different platforms with a 
different versions of Nodejs.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Plugin now requires dependencies to be installed: &lt;code class=&quot;highlighter-rouge&quot;&gt;sheellenv&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;newterm&lt;/code&gt;, 
which means after installing the plugin the Sublime Text will be restarted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the help of all the stuff listed above, we can develop new or bug fixing 
old functionality by enjoying.🕺&lt;/p&gt;

&lt;h3 id=&quot;user-experience&quot;&gt;User experience&lt;/h3&gt;

&lt;p&gt;Ok. We got to the most interest part - user interaction with plugin. As in 
previous part I will list of changes and reasons for it.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;It sad to say, but from now we only support Sublime Text 3. Sublime Text 2 
support is deprecated, because of long waited Sublime Text 3 official release.
It’s not beta now.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The most annoying (I think there was around 3-4 bugs related with it) incorrect 
auto complete. Sometimes it had replaced the part before dot: &lt;code class=&quot;highlighter-rouge&quot;&gt;os.chdir()&lt;/code&gt;, 
&lt;code class=&quot;highlighter-rouge&quot;&gt;chdir()&lt;/code&gt; replaced the &lt;code class=&quot;highlighter-rouge&quot;&gt;os.&lt;/code&gt; part. Sometimes it had duplicated the part after a 
dot: &lt;code class=&quot;highlighter-rouge&quot;&gt;http.createServer()&lt;/code&gt; duplicated the &lt;code class=&quot;highlighter-rouge&quot;&gt;http&lt;/code&gt; part. The issue was solved by 
rewrite &lt;code class=&quot;highlighter-rouge&quot;&gt;tools/doc_builder.js&lt;/code&gt; by adding Nodejs standard library modules names 
to the &lt;code class=&quot;highlighter-rouge&quot;&gt;Nodejs.sublime-completions&lt;/code&gt; as a separate auto complete items.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now, on the plugin loading, it detects if a Node Version Manager is installed 
and if it is, it gets current Node version from the NVM and use it by default 
instead of globally installed one, if any.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Also, on the plugin loading, it build completions list for a current version of 
Nodejs&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;On the plugin loading, it install all Nodejs dependencies need for plugin tools, 
located under &lt;code class=&quot;highlighter-rouge&quot;&gt;tools&lt;/code&gt; folder: &lt;code class=&quot;highlighter-rouge&quot;&gt;doc_builder.js&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;uglify_js.js&lt;/code&gt;. Before, you 
will need to install it manually.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;At the core plugin, now, detects different versions of Nodejs. At the moment 
of release it is a Nodejs 6 branch and 8 branch aka LTS and current stable.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Plugin settings now opens in style of Sublime Text 3, by &lt;code class=&quot;highlighter-rouge&quot;&gt;edit_settings&lt;/code&gt; 
command, default settings on the left side and user custom settings on the right 
side&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;From now, commands (‘node_drun’, ‘node_npm_install’ and etc.) could be run only 
when type or the buffer/file is type of &lt;code class=&quot;highlighter-rouge&quot;&gt;source.js&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;OK. What is the most important tool of every developer? You, right! It’s a debugger.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;debugger&quot;&gt;&lt;em&gt;Debugger&lt;/em&gt;&lt;/h3&gt;

&lt;p&gt;In previous versions of the plugin, Nodejs Debug (+ arguments)
command would run only the current file with a &lt;code class=&quot;highlighter-rouge&quot;&gt;debug&lt;/code&gt; argument passed to &lt;code class=&quot;highlighter-rouge&quot;&gt;node&lt;/code&gt; 
executable. It was a useless. Since version 6.3.0 of Nodejs it support debugging 
using Chrome DevTools debugger. Read more at &lt;a href=&quot;https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27&quot;&gt;Paul Irish Medium blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, when you run Nodejs Debug (+ arguments) the &lt;code class=&quot;highlighter-rouge&quot;&gt;node&lt;/code&gt; executable will run 
current file with flags &lt;code class=&quot;highlighter-rouge&quot;&gt;--inspect=localhost:60123 --debug-brk&lt;/code&gt; for version 6 of 
Nodejs and &lt;code class=&quot;highlighter-rouge&quot;&gt;--inspect-brk=localhost:60123&lt;/code&gt; for version 8. As you can see, 
debugger would run on a separate port 60123 which is not correlate with 
 the default Nodejs - 9229.&lt;/p&gt;

&lt;p&gt;Then, you can connect to the debugger using steps instructed by the plugin:&lt;/p&gt;
&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    Debugger is successfully started at localhost:60123.
    1. Now you can open Google Chrome and navigate to chrome://inspect.
    2. Then click Open dedicated DevTools for Node. 
    3. After click Add connection and add connection to localhost:60123
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-need-to-be-done&quot;&gt;What need to be done&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Recreate functionality of Nodejs cli debugger using Sublime Text 3 dependency - 
&lt;a href=&quot;https://github.com/varp/sublime-pexpect&quot;&gt;sublime-pexpect&lt;/a&gt;, which I contributed 
to &lt;a href=&quot;https://packagecontrol.io&quot;&gt;packagecontrol.io&lt;/a&gt; recently.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Track Nodejs processes ran by the plugin and kill only that processes in 
&lt;code class=&quot;highlighter-rouge&quot;&gt;_kill_node_processes()&lt;/code&gt;. For that, need to be done work by contributing another 
Python package to the Sublime package control - &lt;a href=&quot;https://github.com/varp/sublime-psutil&quot;&gt;sublime-psutil&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run current JS file in new terminal, instead of output to the Sublime Text 
output panel.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;</content><author><name>Vardan Pogosian</name></author><category term="sublimetext" /><category term="Nodejs" /><category term="refactor" /><category term="plugin" /><summary type="html">I’m very happy to announce the second version of Nodejs Sublime Text plugin. This is big release with a big refactorings and new features.</summary></entry><entry><title type="html">Script for guessing MySQL table charset and collation</title><link href="https://vardan.pro/2017/07/10/script-for-guessing-mysql-table-charset-and-collation.html" rel="alternate" type="text/html" title="Script for guessing MySQL table charset and collation" /><published>2017-07-10T17:40:26+00:00</published><updated>2017-07-10T17:40:26+00:00</updated><id>https://vardan.pro/2017/07/10/script-for-guessing-mysql-table-charset-and-collation</id><content type="html" xml:base="https://vardan.pro/2017/07/10/script-for-guessing-mysql-table-charset-and-collation.html">&lt;h2 id=&quot;intro&quot;&gt;Intro&lt;/h2&gt;
&lt;p&gt;Sometimes we getting in a situation where have MySQL database where we have tables and even and columns in that tables in different charset/collations.&lt;/p&gt;

&lt;p&gt;In such situations, we can “stick” in the problem where a DB has one charset/collation and a table has another charset/collation. On other hands, we can have tables where charset/collation match with DB’s charset, but data inserted in that tables in a third charset/collation, and it seems like corrupted.&lt;/p&gt;

&lt;p&gt;In such situation, we can have the following: when we trying to select data from a table whose charset/collation match with the DB’s charset or not match but inserted in different charset/collation we get the:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;+------+------------------------------+----------------------+
| id   | name                | surname                       |
+------+------------------------------+----------------------+
| 5100 | Ð                   | Ð¡Ð˜ÐÐ®ÐšÐžÐ’                 |
| 5234 | Ð¡Ð•Ð Ð“Ð•Ð™        | ÐœÐÐ§Ð˜ÐÐ¡ÐšÐ˜Ð™              |
+------+------------------------------+----------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The data seems like it to be corrupted. To solve the problem if the data exactly corrupted or by mistake inserted in the wrong charset/collation, we must check the data against charset/collation supported by your version of MySQL. And then we can decide, the data really corrupted (if we can not find at least one right charset/collation combination with readable text) or to the data applied wrong charset/collation.&lt;/p&gt;

&lt;h2 id=&quot;preparation&quot;&gt;Preparation&lt;/h2&gt;
&lt;p&gt;Okey. First of all, we must find out which charset and collation support your installed MySQL version. For that, we go the terminal and:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;your password&amp;gt;'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'show collation'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The next, we must get the output and convert to the following format: the first column of the output and the second column separated by the symbol ‘|’. For that purpose, I just copy-pasted output to the Sublime Text editor and with a help of multiline editing feature got the needed format. For example:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;latin1_swedish_ci|latin1
latin1_bin|latin1
latin1_general_ci|latin1
latin2_general_ci|latin2
latin2_bin|latin2
ascii_general_ci|ascii
ascii_bin|ascii
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After you have done converting, save it under you &lt;code class=&quot;highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; directory path with name &lt;code class=&quot;highlighter-rouge&quot;&gt;mysql.collations.txt&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;code&quot;&gt;Code&lt;/h2&gt;
&lt;p&gt;Okey. We get to the fun part 😊 The following simple line of the Bash script, get the input file prepared in the previous step and iterating through it. On the each iteration it changes a connection charset and collation and select one row from your desired table and duplicate its output to a file in the current working directory with name &lt;code class=&quot;highlighter-rouge&quot;&gt;mysql.codepage.guess.log&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;row &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/mysql.collations.txt&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$row&lt;/span&gt; | cut &lt;span class=&quot;nt&quot;&gt;-f2&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'|'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;collate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$row&lt;/span&gt; | cut &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'|'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\t\t&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;CHECKING: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$charset&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$collate&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; mysql &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;your password&amp;gt;'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;use &amp;lt;your db name&amp;gt;; set names &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$charset&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; collate &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$collate&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;; select * from &amp;lt;your table name&amp;gt; limit 1;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; | tee mysql.codepage.guess.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;result&quot;&gt;Result&lt;/h2&gt;
&lt;p&gt;Here is presented a few lines of the file &lt;code class=&quot;highlighter-rouge&quot;&gt;mysql.codepage.guess.log&lt;/code&gt; from my run (the outpur is cut for simplicity):&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;		CHECKING: latin1 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; latin1_swedish_ci
id	name	surname	
5100	А	СИНЮКОВ	
		CHECKING: latin2 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; latin2_bin
id	name	surname
5100	??	??????????????
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That’s all. Here you can see that the right charset/collation for my table is &lt;code class=&quot;highlighter-rouge&quot;&gt;latin1_swedish_ci&lt;/code&gt;. On the production, someone before me has set collation for the table to the &lt;code class=&quot;highlighter-rouge&quot;&gt;utf8_general_ci&lt;/code&gt; but data was inserted in &lt;code class=&quot;highlighter-rouge&quot;&gt;latin1_swedish_ci&lt;/code&gt;. Thank you for your time 🕺&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="bash" /><category term="mysql" /><category term="charset" /><category term="collation" /><category term="script" /><summary type="html">Intro Sometimes we getting in a situation where have MySQL database where we have tables and even and columns in that tables in different charset/collations.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vardan.pro/content/images/2017/07/mysql_charset_guessing.png" /></entry><entry><title type="html">Released a new bugfix version of the Sublime Text NodeJS plugin</title><link href="https://vardan.pro/2017/06/03/released-a-new-bugfix-version-of-the-sublime-text-nodejs-plugin.html" rel="alternate" type="text/html" title="Released a new bugfix version of the Sublime Text NodeJS plugin" /><published>2017-06-03T19:21:27+00:00</published><updated>2017-06-03T19:21:27+00:00</updated><id>https://vardan.pro/2017/06/03/released-a-new-bugfix-version-of-the-sublime-text-nodejs-plugin</id><content type="html" xml:base="https://vardan.pro/2017/06/03/released-a-new-bugfix-version-of-the-sublime-text-nodejs-plugin.html">&lt;p&gt;I’ve just released a new bugfix version of the &lt;a href=&quot;https://www.sublimetext.com/&quot;&gt;Sublime Text&lt;/a&gt; Nodejs &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/&quot;&gt;plugin&lt;/a&gt;. Should say, this is a first version, since that moment when I started porting the plugin to the version 3 of Sublime Text, when all features working out of the box either installed by the Package Control or manually.&lt;/p&gt;

&lt;p&gt;List of bug fixes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Fix issue-63. Now can run built-in tools, when the package is installed by Package Control. &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/issues/63&quot;&gt;See more at GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Fix issue-65. Now the package resolves correct path for built-in tools. &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/issues/65&quot;&gt;See more at GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Vardan Pogosian</name></author><category term="sublimetext" /><category term="editor" /><category term="plugin" /><category term="nodejs" /><summary type="html">I’ve just released a new bugfix version of the Sublime Text Nodejs plugin. Should say, this is a first version, since that moment when I started porting the plugin to the version 3 of Sublime Text, when all features working out of the box either installed by the Package Control or manually.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vardan-pro.s3.amazonaws.com/2017/Jun/Screen_Shot_2017_05_13_at_19_50_48-1496517528446.png" /></entry><entry><title type="html">Released a new version of the Sublime Text NodeJS plugin</title><link href="https://vardan.pro/2017/05/13/released-new-version-of-the-sublimetext-nodejs-plugin.html" rel="alternate" type="text/html" title="Released a new version of the Sublime Text NodeJS plugin" /><published>2017-05-13T16:58:16+00:00</published><updated>2017-05-13T16:58:16+00:00</updated><id>https://vardan.pro/2017/05/13/released-new-version-of-the-sublimetext-nodejs-plugin</id><content type="html" xml:base="https://vardan.pro/2017/05/13/released-new-version-of-the-sublimetext-nodejs-plugin.html">&lt;p&gt;I’ve just released a new bugfix version of &lt;a href=&quot;https://packagecontrol.io/packages/Nodejs&quot;&gt;SublimeText-NodeJs&lt;/a&gt; package. A release notes for the new version &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/releases/tag/v1.5.5&quot;&gt;v1.5.5&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Fix issue-60. Now the plugin respects system env var $PATH &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/issues/60&quot;&gt;See more at GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Fix issue-61. Autocompletion duplicates root object. &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/issues/61&quot;&gt;See more at GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Fix issue-62. Turning off shortcuts. &lt;a href=&quot;https://github.com/tanepiper/SublimeText-Nodejs/issues/62&quot;&gt;See more at GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Generated completions for NodeJS v7.10&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Vardan Pogosian</name></author><category term="sublimetext" /><category term="plugin" /><category term="nodejs" /><summary type="html">I’ve just released a new bugfix version of SublimeText-NodeJs package. A release notes for the new version v1.5.5:</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vardan-pro.s3.amazonaws.com/2017/May/Screen_Shot_2017_05_13_at_19_50_48-1494694291080.png" /></entry><entry><title type="html">Simple backups for non-tech users with udev</title><link href="https://vardan.pro/2015/10/30/simple-backups-for-non-tech-users-with-udev.html" rel="alternate" type="text/html" title="Simple backups for non-tech users with udev" /><published>2015-10-30T06:00:28+00:00</published><updated>2015-10-30T06:00:28+00:00</updated><id>https://vardan.pro/2015/10/30/simple-backups-for-non-tech-users-with-udev</id><content type="html" xml:base="https://vardan.pro/2015/10/30/simple-backups-for-non-tech-users-with-udev.html">&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;
We are using SharePoint 2010 Foundation SP2 as our &lt;a rel=&quot;nofollow&quot; href=&quot;http://en.wikipedia.org/wiki/Document_management_system&quot;&gt;EDM&lt;/a&gt; system. Every day we are making backups of our EDM system on external hard drive. A week ago our CEO has decided to has a second copy of the archives and keep it into a safe. 
&lt;/p&gt;

&lt;h2&gt;No sooner said that done!&lt;/h2&gt;
&lt;p&gt;
Let's make criterias of future backup system:
&lt;ul&gt;
  &lt;li&gt;it must be automatic&lt;/li&gt;
  &lt;li&gt;it can do everyone, even non-tech users&lt;/li&gt;
  &lt;li&gt;it must do ONLY onto specific external hard drive&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
So, what is a system doing? System consists of the following components: a udev rule and a bash script, which run when you insert the concrete external hard drive into destination host. Also, the system depends on the following system packages: cifs-utils, at, ntfs-3g.  
&lt;/p&gt;

&lt;p&gt;Backups of our EDM system is lying on a Windows (SMB) share.
When the external hard drive is inserted, the bash script will be runned and will create an `at` job. The `at` job at the specific time (by default 11pm on Saturday) will remove all content on the hard drive, then copy all files and folders from the Windows (SMB) share to the external hard drive.
&lt;/p&gt;

&lt;h2&gt;Source Code&lt;/h2&gt;
&lt;p&gt;
The source code is available at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/varp/udevbackup&quot;&gt;GitHub&lt;/a&gt; and distributed under &lt;a rel=&quot;nofollow&quot; href=&quot;https://opensource.org/licenses/MIT&quot;&gt;MIT License&lt;/a&gt;.
&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;
As every backuping system, our system also need a some bit of configuration. First of all you need to install the system's required packages:
```bash
sudo apt-get install git-core cifs-utils at ntfs-3g -y
git clone https://github.com/varp/udevbackup.git &amp;amp;&amp;amp; cd udevbackup
```
Second you need obtain your external hard drive serial number. To obtain serial number run:
```bash
sudo udevadm info --query=all --attribute-walk --root /dev/sdb1
```
The next phase of configuraion: 
```bash
HARD_SERIAL=&lt;your hard=&quot;&quot; serial=&quot;&quot; is=&quot;&quot; obtained=&quot;&quot; from=&quot;&quot; the=&quot;&quot; previous=&quot;&quot; step=&quot;&quot;&gt; SMB_DOMAIN=&lt;domain.local&gt; SMB_SHARE=&amp;lt;//server/share&amp;gt; SMB_USER=&lt;user&gt; SMB_PASSWORD=&lt;password&gt; make configure
``` 
&amp;lt;/p&amp;gt;
&lt;p&gt;
To &lt;b&gt;install&lt;/b&gt; just run the following in a terminal:
```bash
sudo make install
```
&lt;/p&gt;
&lt;/password&gt;&lt;/user&gt;&lt;/domain.local&gt;&lt;/your&gt;&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="udev" /><category term="automatic" /><category term="devops" /><category term="non-tech" /><category term="sharepoint" /><category term="backups" /><summary type="html">Intro We are using SharePoint 2010 Foundation SP2 as our EDM system. Every day we are making backups of our EDM system on external hard drive. A week ago our CEO has decided to has a second copy of the archives and keep it into a safe.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vardan.pro/content/images/2017/08/Backup-e1450691392717.jpg" /></entry><entry><title type="html">Installation of TeamViewer on Ubuntu via SSH (Terminal)</title><link href="https://vardan.pro/2015/05/06/installing-of-teamviewer-on-ubuntu-from-ssh.html" rel="alternate" type="text/html" title="Installation of TeamViewer on Ubuntu via SSH (Terminal)" /><published>2015-05-06T05:26:00+00:00</published><updated>2015-05-06T05:26:00+00:00</updated><id>https://vardan.pro/2015/05/06/installing-of-teamviewer-on-ubuntu-from-ssh</id><content type="html" xml:base="https://vardan.pro/2015/05/06/installing-of-teamviewer-on-ubuntu-from-ssh.html">&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;When I searched a solution to access remotely my Unity desktop on 14.04, I
have faced with a little problem. It appears to be that all the
solutions I found (xdrp, RealVNC, X11 forwarding) might only work
with 2D desktop environments like as XFCE, Mate (the first two
solutions) or can only forward “raw” X apps’ renders (the last
solution). No one of it fit my needs.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The only solution that fits needs was the TeamViewer.  It&amp;rsquo;s not hundred
percent a UNIX solution, but it appears to be the only one solution
that can give me access to Unity 3D session. Ok, I thought, let&amp;rsquo;s
install TeamViewer! But, I was have only SSH access to my Ubuntu box.&lt;/p&gt;
&lt;h2&gt;Installing&lt;/h2&gt;
&lt;p&gt;If you will try to install TeamViewer 64bit deb you will be fail because
in Ubuntu 14.04 (amd64) and above the &lt;b&gt;lib32asound2 &lt;/b&gt;package was removed which on the TeamViewer
64bit depends. Though, we will install i386 package of TeamViwer.
Enough words!&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/Downloads &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; wget http://download.teamviewer.com/download/teamviewer_i386.deb
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dpkg –add-architecture i386
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dpkg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; ~/Downloads/teamviewer_i386.deb
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;cp &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; /opt/teamviewer/tv_bin/script/teamviewerd.sysv /etc/init.d/teamviewerd
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;teamviewer daemon &lt;span class=&quot;nb&quot;&gt;enable&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;teamviewer daemon start
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-rc.d teamviewerd defaults
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;teamviewer &lt;span class=&quot;nt&quot;&gt;--passwd&lt;/span&gt; &amp;lt;at least 8 characters&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Reconnect to your Ubuntu box after it was rebooted and type in SSH terminal:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;teamviwer info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There you will see version of TeamViewer, ID of your TeamViewer to connect
to and the TeamViewer daemon
status.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all. Grab your TeamViewer ID and remotely enjoy your Unity 3D session =).&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="trusty" /><category term="ubuntu" /><category term="teamviewer" /><category term="ssh" /><category term="terminal" /><summary type="html">Intro When I searched a solution to access remotely my Unity desktop on 14.04, I have faced with a little problem. It appears to be that all the solutions I found (xdrp, RealVNC, X11 forwarding) might only work with 2D desktop environments like as XFCE, Mate (the first two solutions) or can only forward “raw” X apps’ renders (the last solution). No one of it fit my needs. The only solution that fits needs was the TeamViewer.  It&amp;rsquo;s not hundred percent a UNIX solution, but it appears to be the only one solution that can give me access to Unity 3D session. Ok, I thought, let&amp;rsquo;s install TeamViewer! But, I was have only SSH access to my Ubuntu box. Installing If you will try to install TeamViewer 64bit deb you will be fail because in Ubuntu 14.04 (amd64) and above the lib32asound2 package was removed which on the TeamViewer 64bit depends. Though, we will install i386 package of TeamViwer. Enough words! $ cd ~/Downloads &amp;amp;&amp;amp; wget http://download.teamviewer.com/download/teamviewer_i386.deb $ sudo dpkg –add-architecture i386 $ sudo dpkg -i ~/Downloads/teamviewer_i386.deb $ sudo cp -v /opt/teamviewer/tv_bin/script/teamviewerd.sysv /etc/init.d/teamviewerd $ sudo teamviewer daemon enable $ sudo teamviewer daemon start $ sudo update-rc.d teamviewerd defaults $ sudo teamviewer --passwd &amp;lt;at least 8 characters&amp;gt; $ sudo reboot Reconnect to your Ubuntu box after it was rebooted and type in SSH terminal: sudo teamviwer info There you will see version of TeamViewer, ID of your TeamViewer to connect to and the TeamViewer daemon status. That&amp;rsquo;s all. Grab your TeamViewer ID and remotely enjoy your Unity 3D session =).</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vardan-pro.s3.amazonaws.com/2016/Aug/team-1470634134424.png" /></entry><entry><title type="html">Hacking SharePoint 2010 DB Performance</title><link href="https://vardan.pro/2015/02/08/hacking-sharepoint-2010-db-performance.html" rel="alternate" type="text/html" title="Hacking SharePoint 2010 DB Performance" /><published>2015-02-08T20:44:00+00:00</published><updated>2015-02-08T20:44:00+00:00</updated><id>https://vardan.pro/2015/02/08/hacking-sharepoint-2010-db-performance</id><content type="html" xml:base="https://vardan.pro/2015/02/08/hacking-sharepoint-2010-db-performance.html">&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;We are using SharePoint Foundation 2010 SP2 as &lt;a rel=&quot;nofollow&quot; href=&quot;http://en.wikipedia.org/wiki/Document_management_system&quot;&gt;&lt;/a&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://en.wikipedia.org/wiki/Document_management_system&quot;&gt;EDM&lt;/a&gt; system in our organization. We faced with a performance issue, after 3 years of using SharePoint 2010.&lt;/p&gt;
&lt;h2&gt;The Issue Context&lt;/h2&gt;
&lt;p style=&quot;outline-width: 0px !important; -webkit-user-select: text !important;&quot;&gt;Every employee in our organization has a pool of tasks to do. The pool of tasks is implemented as a SharePoint list. A task may has a dozen of executors. The executors leaving comments to the task overtime. Therefore, version history of the task (a list item) is growing and growing. On some tasks, we have about 2500 version history items. A SharePoint
2010 wasting about 150000 ms to retrieve these tasks.&lt;/p&gt;
&lt;h2&gt;Solving The Issue&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;WARNING! YOU CAN LOOSE &lt;a rel=&quot;nofollow&quot; href=&quot;https://support.microsoft.com/kb/841057/en-us?wa=wsignin1.0&quot;&gt;SUPPORT&lt;/a&gt; ON YOUR COPY OF SHAREPOINT! &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Open SQL Server Management Studio and run following script on a content database of your SharePoint instance:&lt;/p&gt;
&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;USE&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WSS_Content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;GO&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tpID&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tp_ID&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_ListId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_ListId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_SiteId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_SiteId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_RowOrdinal&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_RowOrdinal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_DeleteTransactionId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_DeleteTransactionId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_Level&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_Level&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nonclustered&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AllUserData_tp_IsCurrentVersion&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllUserData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tp_IsCurrentVersion&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ASC&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;GO&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After that, I have achieved increasing of the DB performance up to 100 times.&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="sharepoint-2010" /><category term="ms-sql-2008-r2" /><category term="windows-server-2008-r2" /><summary type="html">Intro We are using SharePoint Foundation 2010 SP2 as EDM system in our organization. We faced with a performance issue, after 3 years of using SharePoint 2010. The Issue Context Every employee in our organization has a pool of tasks to do. The pool of tasks is implemented as a SharePoint list. A task may has a dozen of executors. The executors leaving comments to the task overtime. Therefore, version history of the task (a list item) is growing and growing. On some tasks, we have about 2500 version history items. A SharePoint 2010 wasting about 150000 ms to retrieve these tasks. Solving The Issue WARNING! YOU CAN LOOSE SUPPORT ON YOUR COPY OF SHAREPOINT!  Open SQL Server Management Studio and run following script on a content database of your SharePoint instance: USE [WSS_Content]; GO create nonclustered index AllUserData_tpID on dbo.AllUserData ( tp_ID ASC ); create nonclustered index AllUserData_tp_ListId on dbo.AllUserData ([tp_ListId] ASC); create nonclustered index AllUserData_tp_SiteId on dbo.AllUserData ([tp_SiteId] ASC); create nonclustered index AllUserData_tp_RowOrdinal on dbo.AllUserData ([tp_RowOrdinal] ASC); create nonclustered index AllUserData_tp_DeleteTransactionId on dbo.AllUserData ([tp_DeleteTransactionId] ASC); create nonclustered index AllUserData_tp_Level on dbo.AllUserData ([tp_Level] ASC); create nonclustered index AllUserData_tp_IsCurrentVersion on dbo.AllUserData ([tp_IsCurrentVersion] ASC ); GO After that, I have achieved increasing of the DB performance up to 100 times.</summary></entry><entry><title type="html">Some usefull Linux command line shortcuts</title><link href="https://vardan.pro/2015/01/14/some-usefull-linux-command-line-shortcuts.html" rel="alternate" type="text/html" title="Some usefull Linux command line shortcuts" /><published>2015-01-14T05:13:36+00:00</published><updated>2015-01-14T05:13:36+00:00</updated><id>https://vardan.pro/2015/01/14/some-usefull-linux-command-line-shortcuts</id><content type="html" xml:base="https://vardan.pro/2015/01/14/some-usefull-linux-command-line-shortcuts.html">&lt;p&gt;&lt;img class=&quot;img-fluid&quot; src=&quot;https://vardan-pro.s3.amazonaws.com/2016/Aug/tumblr_ni6d2ol7uu1se1mfwo1_1280-1470634184405.jpg&quot; alt=&quot;Linux command line shortcuts&quot; /&gt;
&lt;img class=&quot;img-fluid&quot; src=&quot;https://vardan-pro.s3.amazonaws.com/2016/Aug/tumblr_ni6d2ol7uu1se1mfwo2_1280-1470634191747.jpg&quot; alt=&quot;Linux command line shortcuts&quot; /&gt;&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="command-line" /><category term="bash" /><category term="shortcuts" /><category term="linux" /><summary type="html"></summary></entry><entry><title type="html">Snort 2.9.7.0 and Daq 2.0.4</title><link href="https://vardan.pro/2015/01/14/snort-2-9-7-0-and-daq-2-0-4.html" rel="alternate" type="text/html" title="Snort 2.9.7.0 and Daq 2.0.4" /><published>2015-01-14T04:57:00+00:00</published><updated>2015-01-14T04:57:00+00:00</updated><id>https://vardan.pro/2015/01/14/snort-2-9-7-0-and-daq-2-0-4</id><content type="html" xml:base="https://vardan.pro/2015/01/14/snort-2-9-7-0-and-daq-2-0-4.html">&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;On past weekend I&amp;rsquo;ve packaged latest stable versions of &lt;a href=&quot;https://snort.org/&quot; target=&quot;_blank&quot;&gt;snort&lt;/a&gt; and &lt;a href=&quot;https://snort.org/&quot; target=&quot;_blank&quot;&gt;daq&lt;/a&gt; for Ubuntu Trusty. I&amp;rsquo;ve pushed the packages to my &lt;a href=&quot;https://launchpad.net/~vardan-pogosyan/+archive/ubuntu/stable&quot; title=&quot;PPA&quot; target=&quot;_blank&quot;&gt;PPA&lt;/a&gt;. Enjoy and use it who it will be useful.&lt;/p&gt;
&lt;h2&gt;Upgrading&lt;/h2&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;service snort stop
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-add-repository ppa:vardan-pogosyan/stable
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get upgrade &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If you are using a &lt;a href=&quot;https://code.google.com/p/pulledpork/&quot; target=&quot;_blank&quot;&gt;PulledPork&lt;/a&gt;, go to the PulledPork config file in &lt;em&gt;/etc/pulledpork/pulledpork.conf&lt;/em&gt; by default and change &lt;em&gt;snort_version&lt;/em&gt; option to &lt;em&gt;2.9.7.0. &lt;/em&gt;Then go to terminal and run:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pulledpork.pl &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; /etc/pulledpork/pulledpork.conf &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; /etc/snort/sid-msg.map &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The above need to update a snort dynamic rules lying in shared libraries under &lt;em&gt;/usr/lib/snort_dynamicrules&lt;/em&gt; to version 2.9.7.0 otherwise snort won&amp;rsquo;t start. After upgrading the snort rules restart snort service.&lt;/p&gt;
&lt;p&gt;If you are not using PulledPork for updating snort rules, you will need to do it manually.&lt;/p&gt;</content><author><name>Vardan Pogosian</name></author><category term="trusty" /><category term="ubuntu" /><category term="daq" /><category term="snort" /><category term="pulledpork" /><category term="linux" /><summary type="html">Intro On past weekend I&amp;rsquo;ve packaged latest stable versions of snort and daq for Ubuntu Trusty. I&amp;rsquo;ve pushed the packages to my PPA. Enjoy and use it who it will be useful. Upgrading $ sudo service snort stop $ sudo apt-add-repository ppa:vardan-pogosyan/stable $ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade -y If you are using a PulledPork, go to the PulledPork config file in /etc/pulledpork/pulledpork.conf by default and change snort_version option to 2.9.7.0. Then go to terminal and run: $ sudo pulledpork.pl -c /etc/pulledpork/pulledpork.conf -l -m /etc/snort/sid-msg.map -P The above need to update a snort dynamic rules lying in shared libraries under /usr/lib/snort_dynamicrules to version 2.9.7.0 otherwise snort won&amp;rsquo;t start. After upgrading the snort rules restart snort service. If you are not using PulledPork for updating snort rules, you will need to do it manually.</summary></entry></feed>