Wednesday, September 14, 2016

Analyze http2 with Wireshark

Most of the time http2 requests are sent over TLS, which means that Wireshark needs to decrypt information before we can analyze it. Fortunately, Chrome allows to dump cryptographic keys in the file. To do that, before you start Chrome, export environmental variable SSLKEYLOGFILE:
export SSLKEYLOGFILE=/home/jsn/Downloads/sslkeys/sslkeys.log
Firefox also allows to do it, but as for now (48) it is disabled by default. Get more information Now we need to configure Wireshark to use exported keys. Go to Edit - Preferences - Protocols - SSL and point (Pre)-Master-Secret log filename to the file with keys (/home/jsn/Downloads/sslkeys/sslkeys.log) Now you can filter records by http2 and analyze them.

Wednesday, August 24, 2016

tar: Archives cheatsheet

Create archive:
tar -czvf compressed_file.tar.gz original_file.sql
Extract files:
tar -xzvf compressed_file.tar.gz

Tuesday, August 2, 2016

Number of connections to the specific port

To check how many connections are exists to the port 3306:
watch -n 1 "sudo netstat -anp | grep 3306 | wc -l"

Monday, June 27, 2016

fedora: Increase watches limit

Open configuration file:
sudo vim /usr/lib/sysctl.d/50-default.conf
Add the following line to the end of the file to increase watches limit:
fs.inotify.max_user_watches = 524288

Saturday, June 25, 2016

postgresql: How to fix ERROR: new encoding (UTF8) is incompatible

Sometimes I'm unable to create a database in UTF8 encoding because the template database is in the ASCII encoding. To fix it we need to recreate template database in UTF8. Start psql console:
psql -U postgres
Run the following commands:
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
\c template1

Tuesday, May 31, 2016

Preview docs

It is possible to preview apiary docs before pushing to the repository. To do that, install apiaryio CLI:
gem install apiaryio
The executable file of the installed application is located somewhere there:
Generate html file to preview docs and open it in the browser:
/home/jsn/.gem/ruby/gems/apiaryio-0.3.3/bin/apiary preview --output="preview.html"

Friday, May 13, 2016

fedora: Install HipChat 4

UPDATED: Atlassian team has a rpm repository which they do not mention on the official download page. To install hipchat4 from it, create a repository file:
sudo gedit /etc/yum.repos.d/hipchat4.repo
With the following content:
name=Atlassian Hipchat4
Install hipchat:
sudo dnf install hipchat4 --refresh
Atlassian team wasn't able to release rpm package for the latest hipchat for more than 2 months. Fortunately, it is possible to intsall hipchat from the debian package. Download the latest available debian package from here.

Install alien package which will convert deb package to the rpm package:
sudo dnf install alien
Convert hipchat debian package to rpm package:
sudo alien HipChat4-4.0.1635-Linux.deb -r
Install hipchat:
sudo dnf install hipchat4-4.0.1635-2.x86_64.rpm