<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Reffffference</title>
		<link>https://ivan.reallusiondesign.com/</link>
		<description>Recent content on Reffffference</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Thu, 05 Nov 2026 23:10:21 +0000</lastBuildDate>
		
			<atom:link href="https://ivan.reallusiondesign.com/feed.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Ubuntu 20.04 Command ‘python’ not found</title>
				<link>https://ivan.reallusiondesign.com/ubuntu-20-04-command-python-not-found/</link>
				<pubDate>Sun, 30 Aug 2020 21:22:48 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/ubuntu-20-04-command-python-not-found/</guid>
				<description>&lt;p&gt;Canonical decided to move to python 3 for Ubuntu 20.04, which is great, you can start it with the command python3.&lt;/p&gt;&#xA;&lt;p&gt;However there is programs that look for /usr/bin/python and this is not a binary found on the server.&lt;/p&gt;&#xA;&lt;p&gt;So how do you solve this little problem? The idea behind that is that you might need either python 2 or python 3 for your programs so you can install either of them to be the default one, with two respective packages called:&lt;/p&gt;</description>
			</item>
			<item>
				<title>i3wm brightness control on T480s</title>
				<link>https://ivan.reallusiondesign.com/i3wm-brightness-control-on-t480s/</link>
				<pubDate>Mon, 19 Aug 2019 16:54:52 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/i3wm-brightness-control-on-t480s/</guid>
				<description>&lt;p&gt;I got a new laptop – Thinkpad t480s – it is a great machine!&lt;br&gt;&#xA;But since I like to use i3wm for my work, there was a bit of a problem with the way I control the brightness on my old machine. I had two scripts which were triggering when I press the function keys which were detected as &lt;code&gt;XF86MonBrightnessDown&lt;/code&gt; and &lt;code&gt;XF86MonBrightnessUp&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The problem is that this newer machine was not detecting these keys with &lt;code&gt;xev&lt;/code&gt; and when I was using the function keys for the screen brightness acpi events were triggered, so I needed to find how to catch the key presses.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Pipe mysqldump to ssh/sftp</title>
				<link>https://ivan.reallusiondesign.com/pipe-mysqldump-to-ssh-sftp/</link>
				<pubDate>Mon, 08 Jul 2019 15:24:42 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/pipe-mysqldump-to-ssh-sftp/</guid>
				<description>&lt;p&gt;If you need to send mysqldump over ssh on different server without creating any files on the local server, mostly if you are low on space you can use this:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;mysqldump -u MYSQL_USERNAME -p DATABASE | gzip -c | ssh USER@HOST &amp;#39;cat &amp;gt; ~/dump.sql.gz&amp;#39;&lt;/pre&gt;&#xA;&lt;p&gt;And for the restore from remote location:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;ssh USER@HOST &amp;#34;cat /path/to/db.sql&amp;#34; | mysql -uUSER  -pPASSWORD DATABASE&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Enabling query cache for MariaDB/MySQL</title>
				<link>https://ivan.reallusiondesign.com/enabling-query-cache-for-mariadb-mysql/</link>
				<pubDate>Thu, 27 Jun 2019 00:47:10 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/enabling-query-cache-for-mariadb-mysql/</guid>
				<description>&lt;p&gt;Query cache can speed up to 2-3 times queries that are often run.&lt;br&gt;&#xA;It is pretty easy to set up. First you need to check if query cache is supported for your system:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;show variables like &amp;#39;have_query_cache&amp;#39;;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That should return:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;&amp;#43;------------------&amp;#43;-------&amp;#43;&#xA;| Variable_name    | Value |&#xA;&amp;#43;------------------&amp;#43;-------&amp;#43;&#xA;| have_query_cache | YES   |&#xA;&amp;#43;------------------&amp;#43;-------&amp;#43;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then you need to check some variables related to query caching. I will explain each of them:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;mysql&amp;gt; show variables like &amp;#39;query_cache_%&amp;#39; ;&#xA;&amp;#43;------------------------------&amp;#43;----------&amp;#43;&#xA;| Variable_name                | Value    |&#xA;&amp;#43;------------------------------&amp;#43;----------&amp;#43;&#xA;| query_cache_limit            | 262144   |&#xA;| query_cache_min_res_unit     | 4096     |&#xA;| query_cache_size             | 10485760 |&#xA;| query_cache_type             | ON       |&#xA;| query_cache_wlock_invalidate | OFF      |&#xA;&amp;#43;------------------------------&amp;#43;----------&amp;#43;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;query_cache_limit – the total size each individual query can be. In my case that is 262144&lt;br&gt;&#xA;query_cache_min_res_unit – how large is each chunk/block of cached data&lt;br&gt;&#xA;query_cache_size – the total amount of cached queries, 0 disables it, and it needs to be at least 40kb at the lowest to work. Usually the default is 16,777,216&lt;br&gt;&#xA;query_cache_type – if the value is ON it means cache query is enabled. If it is OFF it means it is disabled.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CentOS Configure account to never expire / fix cron problem</title>
				<link>https://ivan.reallusiondesign.com/centos-configure-account-to-never-expire-fix-cron-problem/</link>
				<pubDate>Fri, 15 Feb 2019 15:47:08 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/centos-configure-account-to-never-expire-fix-cron-problem/</guid>
				<description>&lt;p&gt;CentOS have security measure to force users password expiration which can cause problems.&lt;br&gt;&#xA;For example – you do not use passwords to log in to machines, and you prefer ssh keys. And the day the password for that user expires its cron jobs will stop working.&lt;/p&gt;&#xA;&lt;p&gt;You can fix it with one of these, I prefer removing the expiration with chage:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;chage -M -1 root&lt;/pre&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;passwd -x -1 root&lt;/pre&gt;&#xA;&lt;p&gt;You can confirm with:&lt;/p&gt;</description>
			</item>
			<item>
				<title>MariaDB master-slave cluster on Ubuntu</title>
				<link>https://ivan.reallusiondesign.com/mariadb-master-slave-cluster-on-ubuntu/</link>
				<pubDate>Fri, 08 Feb 2019 19:01:48 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/mariadb-master-slave-cluster-on-ubuntu/</guid>
				<description>&lt;p&gt;This article explains how to run MariaDB SQL server in as master/slave replication cluster on two Ubuntu virtual machines.&lt;/p&gt;&#xA;&lt;p&gt;master: 192.168.122.25&lt;br&gt;&#xA;slave: 192.168.122.26&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Before anything else you need to update all packages on the two machines:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;sudo apt update&#xA;sudo apt upgrade&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; First thing is to add the official MariaDB repo for the stable release from here – &lt;a href=&#34;https://downloads.mariadb.org/mariadb/repositories/&#34;&gt;https://downloads.mariadb.org/mariadb/repositories/&lt;/a&gt;&lt;br&gt;&#xA;In my case, for Ubuntu 18.04 I had to use this:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Top linux commands to use.</title>
				<link>https://ivan.reallusiondesign.com/top-linux-commands-to-use/</link>
				<pubDate>Mon, 24 Dec 2018 08:27:44 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/top-linux-commands-to-use/</guid>
				<description>&lt;p&gt;Table with the command I most often use and think are essential. Or some that are cool, but easy to forget/not so often used.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+r&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Search in bash history&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+e&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Go to the end of the line&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+u&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Cut the characters before the cursor&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+y&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Yank/paste, it can paste what you cut with ctrl+u&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+shift+c&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Copy the marked text&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+shift+v&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Paste the text from the previous command&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+d&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Close bash sessions, same as to type exit&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;!$&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Get the last argument from the previous command&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;!*&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Get all the arguments from the previous command&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;history&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Don’t add command to bash history. There is space in front of the command&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;disown -a &amp;amp;&amp;amp; exit&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Exit terminal, detach all background process, so they can run. Useful for long tasks.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;fc&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Open last command in editor. Fix very long one-liners if you mess them up.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ctrl+x+e&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Compose command in the default editor and execute it on save.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;curl ifconfig.me&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Get your public IP from CLI.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;very_long_command # label&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Label long commands, so it it easier to find in history. Everything after # is not executed as it is bash comment.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;rm !(*.foo|*.bar|*.html)&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Remove all files except the ones with these extensions.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;vim -x &amp;lt;FILENAME&amp;gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Encrypt file in vim.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;man hier&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Show filesystem hierarchy.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;cat /etc/issue&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Get distro name.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;ps aux | grep [p]rocess-name&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Find the process you are looking for, without showing the grep command itself.&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;</description>
			</item>
			<item>
				<title>Remap print key to Super(windows) in i3wm</title>
				<link>https://ivan.reallusiondesign.com/remap-print-key-to-superwindows-in-i3wm/</link>
				<pubDate>Tue, 16 Oct 2018 22:52:03 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/remap-print-key-to-superwindows-in-i3wm/</guid>
				<description>&lt;p&gt;My laptop keyboard is little annoying – it have a Print Screen(PrtSc) button between my right control and alt keys – usually around that area you will find the windows(super) key, so I wanted to remap it, when i am using i3wm.&lt;/p&gt;&#xA;&lt;p&gt;So first of all you need to make sure what is your key “called”, you can to that with the &lt;code&gt;xev&lt;/code&gt; program.&lt;/p&gt;&#xA;&lt;p&gt;Then you need to get your modifier map with: &lt;code&gt;xmodmap -pm&lt;/code&gt;&lt;br&gt;&#xA;In my case my output was this:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Mount directory into the RAM</title>
				<link>https://ivan.reallusiondesign.com/mount-directory-into-the-ram/</link>
				<pubDate>Thu, 05 Jul 2018 20:20:44 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/mount-directory-into-the-ram/</guid>
				<description>&lt;p&gt;Needed to mount WordPress cache folder into the RAM of one VPS, to get that little bit of extra speed.&lt;br&gt;&#xA;To mount it temporary and see how it works for you, you can use:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;mount -t tmpfs -o size=64M tmpfs /absolute/path/to/your/folder/&lt;/pre&gt;&#xA;&lt;p&gt;To make it permanent you need to add this in the /etc/fstab file:&lt;/p&gt;&#xA;&lt;pre class=&#34;qoate-code&#34;&gt;tmpfs /absolute/path/to/your/folder tmpfs defaults,size=64M 0 0&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Systemd simple service</title>
				<link>https://ivan.reallusiondesign.com/systemd-simple-service/</link>
				<pubDate>Sat, 09 Jun 2018 22:46:13 +0000</pubDate>
				<guid>https://ivan.reallusiondesign.com/systemd-simple-service/</guid>
				<description>&lt;p&gt;This a template for simple sysmtemd service to change the ownership of a file, since in my case the file is in /sys and it is generated on boot, so using acl didn’t help me. I had to use this hack to change the ownership of a file on each boot.&lt;br&gt;&#xA;What I need is a write permissions to a file in order to change the brightness on my laptop with i3wm.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
