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. I strongly suggest to install it. ...

2013-12-17 · 1 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.) ...

2013-12-16 · 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

Learn how to reset a user password in your own Ghost Blog by accessing the SQLite database and updating the password hash.

2013-11-28 · 1 min · timor
Disk usage visualisation

Inodes exhaustion on XFS

Learn about inodes exhaustion on XFS, how to check inode limits, and how to adjust the inode percentage to prevent issues on your Linux filesystem.

2013-11-27 · 1 min · timor

Kill with SIGSTOP and SIGCONT

I’ve bought a NAS and customized it a little. But there was one thing which make my nights sleepless. NAS was seeking disks every 5~10 seconds - these was really irritating - especially when it was silent in room. I found that part of firmware was indexing or logging something so I wanted it dead! kill -9 was unsuccessful - process restarted after a while…. wrrr… I googled a little and found another signal I could use SIGSTOP, which will freeze process until I send SIGCONT to it - that was exactly what I need (because I normally use NFS/Samba and don’t need nothing more running on this device). ...

2013-11-21 · 1 min · timor

My new toy - Iomega StorCenter ix2-200 Cloud Edition

I’ve just bought new toy - Iomega StorCenter ix2-200 Cloud Edition. I have to play with few options before I could start using it. First thing - Firmware upgrade. Firmware upgrade I’ve started searching for latest firmware for ix2-200 Cloud and found that I have to register on Lenovo site to get firmware… I don’t like such sites where they force me to give all private data, but after few clicks on “Recommended articles” on that site I landed here: https://lenovo-eu-en.custhelp.com/app/answers/detail/a_id/26790  external link So it looks that I don’t need to register - point for me. ...

2013-11-19 · 1 min · timor

Debian - zablokowanie aktualizacji pakietu

W teorii nie powinno się blokować aktualizacji pakietów bo łatają dziury itd…. Ale! Zdarzyły mi się ostatnio dwie sytuacje, które do tego mnie zmusiły: aktualizacja hudsona kończyła się błędem przy starcie usługi, aktualizacja domU Xen skończyła się problemem z kompatybilnością mechanizmu udev w systemie i jądrze (hypervisor miał starsze jądro niż spodziewało się DomU). W takich sytuacjach bardzo przydaje się możliwość zablokowania aktualizacji jednej “psującej” paczki na pewien okres czasu by nie opóźniać innych aktualizacji a sobie dać czas na rozpracowanie problemu. ...

2013-11-05 · 1 min · timor