Tracking users by nickname on WordPress using Google Analytics

Some time ago I write article about tracking nicknames of users (from comments) on a WordPress blog with Piwik . This time I’m doing same but for Google Analytics. I’m using Google Analytics  external link plugin for WordPress so I’ve edited googleanalytics.php file to add some additional code for user tracking: <script type="text/javascript"> var i,x,y,ARRcookies=document.cookie.split(";"); var comment_author = ""; for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x.indexOf("comment_author") != -1 && x....

2014-01-07 · 1 min · timor

Apache - precompressing static files with gzip

Some time ago I’ve show how to precompress js and css file with gzip to be available for Nginx’s mod_gzip. In default configuration Apache don’t have such module but similar functionality could be achieved with few custom rewirtes. Basically we will start with these rewrites to serve gzipped CSS/JS files if they exist and the client accepts gzip compression: RewriteEngine on RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}\.gz -s RewriteRule ^(.*)\.(js|css)$ $1\.$2\.gz [QSA] Then we need to setup proper content types for such compressed files - I know how to do this in two ways:...

2013-12-27 · 2 min · timor

Android: Xposed + AppOps - reclaim control over installed applications permissions

I’m happy owner of Galaxy Nexus 7 and lately I updated my tablet to Android 4.4 Kitkat. One of features I most expected was ability to block some permissions of some applications. Such setting was available in 4.4 version but was removed in latest 4.4.2 - Google didn’t explain it exactly why. I don’t like when for ex. game need: camera or GPS access - for what I asked? But there is new app so called App Ops that unhides build-in interface allowing edit of application permissions....

2013-12-17 · 1 min · timor

Generate ECDSA key with OpenSSL

After the last NSA scandal I’ve found some time to read some texts about PFS and ECDSA keys lately. I always used RSA keys but wanted to give a try to ECDSA so I wanted to give it a try (test performance, etc). Here is how I’ve done it. Firstly find your favorite curve. A short tip about bit length and complexity could be found here. From it you will now that using 256 bit ECDSA key should be enough for next 10-20 years....

2013-12-17 · 5 min · timor

Delete audio track from mkv file

Lately I tried to remove some streams from MKV file - I wanted: video, audio in my language and no subtitles. I achieved it with mkvtoolnix utils. Firstly I have to identify streams in file: $ mkvmerge -i input_file.mkv File 'test.mkv': container: Matroska Track ID 0: video (V_MPEG4/ISO/AVC) Track ID 1: audio (A_DTS) Track ID 2: audio (A_AC3) Track ID 3: audio (A_DTS) Track ID 4: audio (A_AC3) Track ID 5: subtitles (S_TEXT/UTF8) Track ID 6: subtitles (S_TEXT/UTF8) Chapters: 16 entries You could use more verbose tool mkvinfo for that purpose too....

2013-12-16 · 1 min · timor

Preparing video files for streaming on website in MP4 and WEBM format

Some time ago I prepared a PC that was responsible for batch encoding of movies to formats suitable for web players (such as. Video.js  external link , JW Player  external link , Flowplayer  external link , etc.) I used HandBrake for conversion to MP4 format (becase this soft was the fastest one) and ffmpeg (aka avconv in new version) for two pass encoding to WEBM. Below are commands used by me for that conversion:...

2013-12-16 · 2 min · timor

Running Apache with mod_spdy and PHP-FPM

SPDY is new protocol proposed by Google as an alternative for HTTP(S). Currently Chrome and Firefox browsers are using it as default if available on server. It is faster in most cases by few to several percent. The side effect of using mod_spdy  external link is that it’s working well only with thread safe Apache’s modules. PHP module for Apache is not thread safe so we need to use PHP as CGI or FastCGI service....

2013-12-16 · 3 min · timor

Re-adding failed drive in mdadm

Yesterday I have problem with fglrx witch cause ugly system reset. After that, one of my drives was marked as failed in RAID5 array. Hotspare was automatically used to rebuild array. But this hotspare is the oldest and slowest drive I’ve got… After rebuild I’ve tested failed drive and it was fine - no bad block, no any other issue - so I wanted it running back in array. What I do:...

2013-12-12 · 2 min · timor

Ansible - Dynamicaly update /etc/hosts files on target servers

I was configuring GlusterFS on few servers using Ansible  external link and have a need to update /etc/hosts with hostnames for easier configuration. I found this one working: - name: Update /etc/hosts lineinfile: dest=/etc/hosts regexp='.*{{item}}$' line='{{hostvars.{{item}}.ansible_default_ipv4.address}} {{item}}' state=present with_items: '{{groups.somegroup}}' Source: http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html  external link

2013-12-11 · 1 min · timor
[Ghost.org](https://ghost.org/docs/logos/)

Reset user password in your own Ghost Blog

I’ve started testing new Ghost blogging platform for a while on a virtual machine before I take decision about switching to it (or maybe won’t)… After few days, I wanted to go forward with more testing and stuck on “e-mail and password” login prompt 😃 I’ve started looking into files and found ghost_dir/content/data/ghost-dev.db SQLite database. It can be opened like that: sqlite3 content/data/ghost-dev.db Then you could see whats your mail (and other info):...

2013-11-28 · 1 min · timor