Secured connection to network (Android + OpenVPN)

Maybe you are using free wifi hotspots in your favorite cafe, restaurant or on airport.

Maybe your GSM Carrier is tracking your traffic in internet, of course for profiling/ad cause (I’m looking at you T-Mobile, I remember that you inject your internet plans ads in Twitter app)

Security wise there is a lot more of danger waiting at you at those ‘free’ hotspots.

So what to do?

What if I told you that you can still can use those bad but free hotspot while having somekind of protection? That you could hide some of that sweet-sweet traffic for yourself…

The solution that I want to introduce to you is a VPN


You don’t have to root your android phone to use vpn.

“OpenVPN fo Android” will work with payed service as self-hosted one (this is how you can setup one)


Advanced settings that will save your battery:

To protect your connection VPN need to be connected all the time – vpn don’t know when your application will get push notification, or when your friend will make a wificall to you. So it can drain battery a bit more than without using it. But you don’t have to sacrifice your battery life that much. We can tweak some settings to make it less battery hungry.

Edit two options in your vpn server config file /etc/openvpn/server.conf:

Allow new TCP port to accept connection:

Now change one setting on your android openvpn client config:

Remember to restart/reload your openvpn server so the new config will be used.


small Warning: TCP Protocol wasn’t meant to be used with VPN connection, with unstable internet connection you can fell a bit discomfort, but still the battery drain will be significant lower than with UDP setting.


Make Firefox forget cache/redirections

This one is really tricky. You can spam CTRL + F5 all day but firefox will still remember Redirection 301.

You CTRL + H aka History Bar, look for page you want to forget of, Right-Click and pick “Forget about this page” which in Polish is “Usuń całą witrynę” which is “Remove whole site”. This is why I “love” translations.

If this fails because you where redirected to error page or something you can try:


Washed out black in OBS

From time to time we can have issues with colors after recording session in OBS. Colors are pale, washed out almost colorless. You can try to tweak those this way:

In OBS go to Settings > Advanced > YUV Color Range and switch it.

Im using Color Format: NV12, YUV Color Space: 601, YUV Color Range: Partial and it made huge difference for my setup. Others use Full.

If you using NVIDIA drivers there is also one more trick ti fix it. Go to NVIDIA Control Panel > Video > Adjust Video Color Settings > With the NVIDIA Settings > Advanced > Dynamic Range: Full (0-255).

I tried to tweak those and reboot OBS or even PC to be sure that new settings are used. It is a hit or miss but once you happy with results you don’t have to touch this setting ever again.

The best way to check it is to put static image in OBS Scene with Black and Colors and compare the recording in high bitrates to original image.


When ln -s is not an option, aka webdav shares

Sometime ago I tried to make a webdav share that was symlink to directory, but no matter what, webdav refused to work with symbolic link. But there is a workaround with it.

If you mount a filesystem with --bind, you create a second mountpoint for a device or filesystem. This solve the need to use ln -s while ln dont work with directories.


MySQL replace text

From time to time there is a need to replace some text inside database, there is no problem when its inside only one table, you can do something like this (from inside mysql cli):

But problem occurse when the text is spread onto multiply tables. But there is a clever trick for this, we can dump database to file, replace text and then import edited database:


Copy/duplicate mysql database

When you need make a working copy of your database for example to use with copy of your wordpress site, you need to make few things:

Now that we have a db, let us dump the original db to file:

This will dump database_to_copy database to file named db-copy.sql. Now we need to import this dump to our newly created database db_copy.


Installing PIP on Linux

One would think that installing Python for you favorite package manager would solve issue of missing PIP. But you are one step before achieving it.


Debugging bind zones and config files

While maintaining zones and config files by hand sometimes you can make typo. Nothing to worry. Let us start with basics:

First command check named.conf (if you use that one) for errors. Second check if everything is ok with given zone files for given domain. Third and last one show what bind output to log file that he didn’t like.

Common mistake is to update zones files manually while using signed dns. But there is an easy fix for that.


Migrating/copy WordPress site to new sub/domain by hand

From time to there is need to migrate or make a working copy of site that works on wordpress. There are many plugins for that but I will show you the manual way if you want to do it without 3rd party help.

I assume that you are able to connect to mysql via cli or with myphpadmin, and you are able to tell which database you use for you wordpress (wp_config.php). So lets get started

Just remember if you want to copy db and use new updated one edit wp-config.php to reflect those changes: