<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>mdoff&#39;s blog</title>
    <link>https://blog.mdoff.net/</link>
    <description>Recent content on mdoff&#39;s blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 16 Apr 2024 21:03:32 +0000</lastBuildDate><atom:link href="https://blog.mdoff.net/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>tmux, nvim and colors</title>
      <link>https://blog.mdoff.net/posts/2024/tmux-nvim-and-colors/</link>
      <pubDate>Tue, 16 Apr 2024 21:03:32 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2024/tmux-nvim-and-colors/</guid>
      <description>Recently, I installed Ubuntu on my old laptop. Since I use Neovim together with Tmux for my daily work, I wanted to duplicate my environment. So I copied both my configs to new system.
It looked like it worked! Both Neovim and Tmux had the correct color schemes, and all plugins were in place. However, only after I ran Neovim inside Tmux did I realize that something was off – the colorscheme was a mess!</description>
    </item>
    
    <item>
      <title>Clone git repo with submodules</title>
      <link>https://blog.mdoff.net/posts/2023/clone-git-repo-with-submodules/</link>
      <pubDate>Mon, 26 Jun 2023 11:09:19 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2023/clone-git-repo-with-submodules/</guid>
      <description>I&amp;rsquo;m using hugo-paper as my blog theme. To avoid manually cloning theme files it&amp;rsquo;s recommended to install it via git submodule by using this command:
git submodule add https://github.com/nanxiaobei/hugo-paper themes/paper But if you will forget to pull submodule with your blog theme on freshly cloned repo, hugo will welcome us with this error message:
WARN 2023/06/26 22:07:33 found no layout file for &amp;#34;HTML&amp;#34; for kind &amp;#34;home&amp;#34;: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.</description>
    </item>
    
    <item>
      <title>Use dockerized DB for local development</title>
      <link>https://blog.mdoff.net/posts/2023/use-dockerized-db-for-local-development/</link>
      <pubDate>Sat, 25 Feb 2023 11:09:19 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2023/use-dockerized-db-for-local-development/</guid>
      <description>Working with local backend have many advantages, response time are fast, you can work offline and no one is messing with your data.
While usually it&amp;rsquo;s a good idea to write docker-compose.yml file containing all infrastructure needed, sometimes I just need some database right now.
Of course installing each kind of database is a hussle (and they have different versions as well!). So lets&amp;rsquo;s just use docker image to quickly spin up DB and remove it when it won&amp;rsquo;t be needed anymore.</description>
    </item>
    
    <item>
      <title>Blog redesign and move away from Gatsby</title>
      <link>https://blog.mdoff.net/posts/2023/blog-redesign-and-move-away-from-gatsby/</link>
      <pubDate>Mon, 09 Jan 2023 21:10:29 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2023/blog-redesign-and-move-away-from-gatsby/</guid>
      <description>After seeing Get Blogging! website I decided to take a dedust my own blog. So after changing node version to some ancient one (like 8.x!), installing dependencies and upgrading some packages, I decided it was time to move on from the current solution.
Current stack Current Past solution was based on gatsby-starter-blog template. I also created my own comment module inspired by blog post written by Tania Rascia.
Hosting was provided by Netlify with automatic deployments from Github.</description>
    </item>
    
    <item>
      <title>Custom alises with Parcel and React</title>
      <link>https://blog.mdoff.net/posts/2022/custom-aliases-with-parcel/</link>
      <pubDate>Mon, 31 Jan 2022 18:40:22 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2022/custom-aliases-with-parcel/</guid>
      <description>Recently I migrated from snowpack (which works great until it doesn&amp;rsquo;t) to Parcel JS, and so far I love the simplicity. All I needed to do was point Parcel to source html file and it just worked!
But I needed one more thing to became fully satisfied and happy: some aliases. There is some documentation on this topic, but it didn&amp;rsquo;t cover all my needs.
My case is pretty straightforward: I need one alias @components to point to directory with, well, components.</description>
    </item>
    
    <item>
      <title>How add custom DNS entries in pi-hole</title>
      <link>https://blog.mdoff.net/posts/2019/how-add-custom-dns-entries-in-pi-hole/</link>
      <pubDate>Sun, 13 Oct 2019 18:20:11 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2019/how-add-custom-dns-entries-in-pi-hole/</guid>
      <description>Currently UI does not provide this function, unless you have enabled DHCP server, then you can assign local ip addresses to custom domain names.
To have ability to add various custom names to DNS server I followed advice from this comment on github.
I created file /etc/dnsmasq.d/03-custom-dns-names.conf and put there all my custom domains.
address=/server.lan/192.168.1.12 address=/smart-switch.lan/192.168.1.10 Other comment suggested usage of command line tool, but solution with custom config file worked for me really great.</description>
    </item>
    
    <item>
      <title>Enable ssh on raspberry pi on boot in raspbian</title>
      <link>https://blog.mdoff.net/posts/2019/enable-ssh-on-raspberry-pi-on-boot/</link>
      <pubDate>Sun, 13 Oct 2019 17:50:11 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2019/enable-ssh-on-raspberry-pi-on-boot/</guid>
      <description>To enable ssh on raspberry pi in raspbian you have to create empty file with name ssh.txt on boot parition.
To flash fresh image of raspbian on SD card use etcher</description>
    </item>
    
    <item>
      <title>React onChange does not show last typed character</title>
      <link>https://blog.mdoff.net/posts/2019/react-onchange-does-not-show-last-typed-character/</link>
      <pubDate>Thu, 12 Sep 2019 20:46:55 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2019/react-onchange-does-not-show-last-typed-character/</guid>
      <description>Recently a colleague of mine ask me for a help with more less similar code:
const FormWithValidation = ({ onSubmit }) =&amp;gt; { const [inputValue, setInputValue] = useState(&amp;#34;&amp;#34;); const [error, setError] = useState(false); const validate = () =&amp;gt; { if (inputValue.length &amp;lt; 5) { // too short setError(true); } else { setError(false); } }; return ( &amp;lt;form onSubmit={(e) =&amp;gt; { e.preventDefault(); onSubmit({ inputValue }); }} &amp;gt; &amp;lt;input style={error ? { border: &amp;#34;2px solid red&amp;#34; } : undefined} value={inputValue} onChange={(e) =&amp;gt; { setInputValue(e.</description>
    </item>
    
    <item>
      <title>Cool your Raspberry Pi with GPIO controlled fan</title>
      <link>https://blog.mdoff.net/posts/2019/cool-your-raspberry-pi-with-gpio-controlled-fan/</link>
      <pubDate>Thu, 28 Feb 2019 16:46:55 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2019/cool-your-raspberry-pi-with-gpio-controlled-fan/</guid>
      <description>Recently I bought enclosure for my Raspberry Pi 3 B+ with included fan. Instruction said that it should be connected to GPIO pins 4 and 6 (5V and GND). Problem with that is fan works constantly and it&amp;rsquo;s quite loud.
I was googling a solution and found this post on hackernoon and it was almost exactly what I was looking for.
The only thing that I didn&amp;rsquo;t like was using python and configuring this program as a service (which normally is really good solution), so I decided to write bash script to do exactly same thing.</description>
    </item>
    
    <item>
      <title>Processing files after finished download in Transmission</title>
      <link>https://blog.mdoff.net/posts/2016/processing-files-after-finished-download-in-transmission/</link>
      <pubDate>Sun, 23 Oct 2016 13:06:46 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2016/processing-files-after-finished-download-in-transmission/</guid>
      <description>Transmission provides a way to run a script, after downloading torrent is finished. But surprisingly you cannot simply get a list of downloaded files, you have to use a transmission-remote command to get it. Script allow to perform any action on all downloaded files.
#!/bin/bash MOVIE_FILES=`transmission-remote http://localhost:9000/transmission -t $TR_TORRENT_ID -if | tail -n +3 | cut -c 35-` for FILE in $MOVIE_FILES; do example_command &amp;#34;$TR_TORRENT_DIR/$FILE&amp;#34; done </description>
    </item>
    
    <item>
      <title>MQTT IR universal remote</title>
      <link>https://blog.mdoff.net/posts/2016/mqtt-ir-universal-remote/</link>
      <pubDate>Sat, 01 Oct 2016 11:41:29 +0000</pubDate>
      
      <guid>https://blog.mdoff.net/posts/2016/mqtt-ir-universal-remote/</guid>
      <description>IR remotes are great. You don&amp;rsquo;t have to get up from the couch to switch channel, they are cheap or you can always buy some universal ones. But they also have some downsides, you have to see the reciever, they are restricted by range, and somtimes you just can&amp;rsquo;t find that thing ;)
I had some ESP8266 laying around so why not use it to replace my old remotes?
First I used arduino, IR reciever and IRrecvDumpV2 to decode my radio and TV remote signals.</description>
    </item>
    
  </channel>
</rss>
