jekyll build from Action e92847840f

This commit is contained in:
sahinakkayadev 2023-01-16 04:05:23 +00:00
parent 47150198e7
commit 93e0873f02
18 changed files with 1609 additions and 515 deletions

View File

@ -402,6 +402,53 @@ So here I am and welcome to my first blog. Having a personal space on the Intern
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -539,52 +586,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -623,7 +624,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -430,6 +430,53 @@ util.lua: highlight<span class="o">(</span>group, properties<span class="o">)
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -567,52 +614,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -651,7 +652,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -552,6 +552,53 @@ WantedBy=multi-user.target
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -689,52 +736,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -773,7 +774,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -391,6 +391,53 @@ ffmpeg <span class="nt">-f</span> concat <span class="nt">-i</span> mylist.txt <
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -528,52 +575,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -612,7 +613,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -410,6 +410,53 @@ ssh <span class="nt">-p</span> 7777 homeuser@localhost
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -547,52 +594,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -631,7 +632,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -400,6 +400,53 @@ uselessuser@remote.host<span class="se">\'</span>s password:
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -537,52 +584,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
@ -621,7 +622,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -435,6 +435,53 @@ grub-install <span class="nt">--efi-directory</span><span class="o">=</span>/boo
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -572,53 +619,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/02/27/creating-a-useless-user.html" rel="permalink">Creating a <em>Useless</em> User
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-02-27T13:40:00+00:00">February 27, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
1 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Story
In my previous post, I explained how to do port forwarding to access some machine behind private network. I will use this method to fix some issues in ...</p>
</article>
</div>
</div>
</div>
@ -657,7 +657,7 @@ In my previous post, I explained how to do port forwarding to access some machin
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -393,6 +393,53 @@
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -529,53 +576,6 @@ that they are making Github Copilot available for everyone. Previously, it was i
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/02/27/creating-a-useless-user.html" rel="permalink">Creating a <em>Useless</em> User
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-02-27T13:40:00+00:00">February 27, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
1 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Story
In my previous post, I explained how to do port forwarding to access some machine behind private network. I will use this method to fix some issues in ...</p>
</article>
</div>
</div>
</div>
@ -614,7 +614,7 @@ In my previous post, I explained how to do port forwarding to access some machin
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -399,6 +399,53 @@ problem. That is your problem not understanding how licenses work. Stop complain
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -535,53 +582,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/02/27/creating-a-useless-user.html" rel="permalink">Creating a <em>Useless</em> User
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-02-27T13:40:00+00:00">February 27, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
1 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Story
In my previous post, I explained how to do port forwarding to access some machine behind private network. I will use this method to fix some issues in ...</p>
</article>
</div>
</div>
</div>
@ -620,7 +620,7 @@ In my previous post, I explained how to do port forwarding to access some machin
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -361,7 +361,8 @@
">Previous</a>
<a href="#" class="pagination--pager disabled">Next</a>
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" class="pagination--pager" title="Hot-Reload Long Running Shell Scripts (feat. trap / kill)
">Next</a>
</nav>
@ -380,6 +381,53 @@
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -516,53 +564,6 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/02/27/creating-a-useless-user.html" rel="permalink">Creating a <em>Useless</em> User
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-02-27T13:40:00+00:00">February 27, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
1 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Story
In my previous post, I explained how to do port forwarding to access some machine behind private network. I will use this method to fix some issues in ...</p>
</article>
</div>
</div>
</div>
@ -601,7 +602,7 @@ In my previous post, I explained how to do port forwarding to access some machin
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -0,0 +1,840 @@
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose
Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin _includes/seo.html --><title>Hot-Reload Long Running Shell Scripts (feat. trap / kill) - Şahin Akkayas Personal Page</title>
<meta name="description" content="trap them and kill them!">
<meta name="author" content="Şahin Akkaya">
<meta property="article:author" content="Şahin Akkaya">
<meta property="og:type" content="article">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="Şahin Akkaya's Personal Page">
<meta property="og:title" content="Hot-Reload Long Running Shell Scripts (feat. trap / kill)">
<meta property="og:url" content="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html">
<meta property="og:description" content="trap them and kill them!">
<meta property="article:published_time" content="2023-01-15T21:48:08+00:00">
<link rel="canonical" href="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": null,
"url": "https://sahinakkaya.dev/"
}
</script>
<!-- end _includes/seo.html -->
<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Şahin Akkaya's Personal Page Feed">
<!-- https://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<!-- For all browsers -->
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css"></noscript>
<!-- start custom head snippets -->
<!-- insert favicons. use https://realfavicongenerator.net/ -->
<!-- end custom head snippets -->
</head>
<body class="layout--single">
<nav class="skip-links">
<ul>
<li><a href="#site-nav" class="screen-reader-shortcut">Skip to primary navigation</a></li>
<li><a href="#main" class="screen-reader-shortcut">Skip to content</a></li>
<li><a href="#footer" class="screen-reader-shortcut">Skip to footer</a></li>
</ul>
</nav>
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<a class="site-title" href="/">
/home/sahin/
</a>
<ul class="visible-links"><li class="masthead__menu-item">
<a href="/">Home</a>
</li><li class="masthead__menu-item">
<a href="/about/">About</a>
</li><li class="masthead__menu-item">
<a href="/contact/">Contact</a>
</li></ul>
<button class="search__toggle" type="button">
<span class="visually-hidden">Toggle search</span>
<i class="fas fa-search"></i>
</button>
<button class="greedy-nav__toggle hidden" type="button">
<span class="visually-hidden">Toggle menu</span>
<div class="navicon"></div>
</button>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
<div class="initial-content">
<div id="main" role="main">
<div class="sidebar sticky">
<div itemscope itemtype="https://schema.org/Person">
<div class="author__avatar">
<img src="/assets/images/logo.jpg" alt="Şahin Akkaya" itemprop="image">
</div>
<div class="author__content">
<h3 class="author__name" itemprop="name">Şahin Akkaya</h3>
<div class="author__bio" itemprop="description">
<p>A perfectionist who likes to tinker everything until it is just right.</p>
</div>
</div>
<div class="author__urls-wrapper">
<button class="btn btn--inverse">Follow</button>
<ul class="author__urls social-icons">
<li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name">Istanbul, Turkey</span>
</li>
<li><a href="https://github.com/sahinakkayadev" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">sahinakkayadev</span></a></li>
<li><a href="https://stackoverflow.com/users/9608759" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-stack-overflow" aria-hidden="true"></i><span class="label">Asocia</span></a></li>
<li><a href="https://twitter.com/sahinakkayadev" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i><span class="label">@sahinakkayadev</span></a></li>
<li><a href="mailto:sahin@sahinakkaya.dev" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-envelope" aria-hidden="true"></i><span class="label">sahin@sahinakkaya.dev</span></a></li>
<li><a href="/assets/docs/resume.pdf" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-id-card" aria-hidden="true"></i><span class="label">Resume</span></a></li>
<!--
<li>
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs" rel="nofollow noopener noreferrer">
<i class="fas fa-fw" aria-hidden="true"></i> Custom Social Profile Link
</a>
</li>
-->
</ul>
</div>
</div>
</div>
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="headline" content="Hot-Reload Long Running Shell Scripts (feat. trap / kill)">
<meta itemprop="description" content="trap them and kill them!">
<meta itemprop="datePublished" content="2023-01-15T21:48:08+00:00">
<div class="page__inner-wrap">
<header>
<h1 id="page-title" class="page__title" itemprop="headline">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</h1>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
</header>
<section class="page__content" itemprop="text">
<h2 id="trap-them-and-kill-them"><code class="language-plaintext highlighter-rouge">trap</code> them and <code class="language-plaintext highlighter-rouge">kill</code> them!</h2>
<p>There is a beautiful command in Linux called <a href="https://man7.org/linux/man-pages/man1/trap.1p.html"><code class="language-plaintext highlighter-rouge">trap</code></a> which <em>trap</em>s signals and let you run specific commands when they invoked. There is also good ol <a href="https://man7.org/linux/man-pages/man1/kill.1.html"><code class="language-plaintext highlighter-rouge">kill</code></a> command which not only kills processes but allows you to specify a signal to send. By combining these two, you can run specific functions from your scripts any time!</p>
<h3 id="basic-example">Basic Example</h3>
<p>Lets start by creating something very simple and build up from there. Create a script with the following contents:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="nb">echo</span> <span class="s2">"My pid is </span><span class="nv">$$</span><span class="s2">. Send me SIGUSR1!"</span>
func<span class="o">()</span> <span class="o">{</span>
<span class="nb">echo</span> <span class="s2">"Got SIGUSR1"</span>
<span class="o">}</span>
<span class="c"># here we are telling that run 'func' when USR1 signal is </span>
<span class="c"># received # you can run anything. Combine commands with ; etc.</span>
<span class="nb">trap</span> <span class="s2">"func"</span> USR1
<span class="c"># The while loop is important here otherwise our script will exit</span>
<span class="c"># before we manage to get a chance to send a signal.</span>
<span class="nv">i</span><span class="o">=</span>1
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
</span><span class="nb">echo</span> <span class="s2">"waiting SIGUSR1"</span>
<span class="nb">sleep </span>1
<span class="k">done</span>
</code></pre></div></div>
<p>Now make it executable and run it:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nb">chmod</span> +x trap_example
./trap_example
My pid is 2811137. Send me SIGUSR1!
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
</code></pre></div></div>
<p>Open another terminal and send your signal with <code class="language-plaintext highlighter-rouge">kill</code> to the specified pid.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nb">kill</span> <span class="nt">-s</span> USR1 2811137
</code></pre></div></div>
<p>You should receive <code class="language-plaintext highlighter-rouge">"Got SIGUSR!"</code> from the other process. Thats it! Now, imagine you write whatever thing you want to execute in <code class="language-plaintext highlighter-rouge">func</code> and then you can simply <code class="language-plaintext highlighter-rouge">kill -s ...</code> anytime and as many times you want!</p>
<p>Lets move the while loop into the <code class="language-plaintext highlighter-rouge">func</code> and add some variables so you can see how powerful this is.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="nb">echo</span> <span class="s2">"My pid is </span><span class="nv">$$</span><span class="s2">. Send me SIGUSR1!"</span>
func<span class="o">()</span> <span class="o">{</span>
<span class="nv">i</span><span class="o">=</span>1
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
</span><span class="nb">echo</span> <span class="s2">"i: </span><span class="nv">$i</span><span class="s2">"</span>
<span class="nv">i</span><span class="o">=</span><span class="k">$((</span> i <span class="o">+</span> <span class="m">1</span> <span class="k">))</span>
<span class="nb">sleep </span>1
<span class="k">done</span>
<span class="o">}</span>
<span class="nb">trap</span> <span class="s2">"echo 'Got SIGUSR1!'; func"</span> USR1
<span class="c"># we need to call the function once, otherwise script</span>
<span class="c"># will exit before we manage to send a signal</span>
func
</code></pre></div></div>
<p>Now run the script and send <code class="language-plaintext highlighter-rouge">SIGUSR1</code>. Here is the result:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> ./trap_example
My pid is 2880704. Send me SIGUSR1!
i: 1
i: 2
i: 3
i: 4
i: 5
i: 6
i: 7
Got SIGUSR1!
i: 1
i: 2
i: 3
i: 4
i: 5
Got SIGUSR1!
i: 1
i: 2
^C
</code></pre></div></div>
<p>Isnt this neat?</p>
<h3 id="more-useful-example">More useful example</h3>
<p>Lets imagine you have multiple long running (infinite loops basically) scripts and you want to restart them without manually searching for their pids and killing them. <code class="language-plaintext highlighter-rouge">trap</code> is for the rescue, again! <sup><a href="##" title="Yeah, I know you can run a systemd service if you want but I think it is an overkill for this situation. Plus, I don't like dealing with them.">*</a></sup> This command is awesome.</p>
<p>Without further ado, lets get started. Create a script called <code class="language-plaintext highlighter-rouge">script1</code> with the following contents:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="c"># file: script1</span>
<span class="nv">i</span><span class="o">=</span>1
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
</span><span class="nb">echo</span> <span class="s2">"Hello from </span><span class="nv">$0</span><span class="s2">. i is </span><span class="nv">$i</span><span class="s2">"</span>
<span class="nv">i</span><span class="o">=</span><span class="k">$((</span> i <span class="o">+</span> <span class="m">1</span> <span class="k">))</span>
<span class="nb">sleep </span>1
<span class="k">done</span>
</code></pre></div></div>
<p>And symlink it to another name just for fun:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nb">chmod</span> +x script1
<span class="nb">ln</span> <span class="nt">-s</span> script1 script2
</code></pre></div></div>
<p>Now we can pretend they are two different scripts as their outputs differ:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> ./script1
Hello from ./script1. i is 1
Hello from ./script1. i is 2
Hello from ./script1. i is 3
Hello from ./script1. i is 4
^C
./script2
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script2. i is 3
^C
</code></pre></div></div>
<p>Finally, create the main script which will start child scripts and restart them on our signals:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="nb">echo</span> <span class="s2">"My pid is </span><span class="nv">$$</span><span class="s2">. You know what to do ( ͡° ͜ʖ ͡°)"</span>
<span class="nb">echo</span> <span class="s2">"You can also send me signal with 'killall </span><span class="sb">`</span><span class="nb">basename</span> <span class="nv">$0</span><span class="sb">`</span><span class="s2"> ...'"</span>
<span class="nv">pids</span><span class="o">=()</span> <span class="c"># we will store the pid's of child scripts here</span>
<span class="nv">scripts_to_be_executed</span><span class="o">=(</span><span class="s2">"./script1"</span> <span class="s2">"./script2"</span><span class="o">)</span>
kill_childs<span class="o">(){</span> <span class="c"># wow, this sounded wild</span>
<span class="k">for </span>pid <span class="k">in</span> <span class="s2">"</span><span class="k">${</span><span class="nv">pids</span><span class="p">[@]</span><span class="k">}</span><span class="s2">"</span>
<span class="k">do
</span><span class="nb">echo </span>killing <span class="s2">"</span><span class="nv">$pid</span><span class="s2">"</span>
<span class="nb">kill</span> <span class="s2">"</span><span class="nv">$pid</span><span class="s2">"</span>
<span class="k">done
</span><span class="nv">pids</span><span class="o">=()</span>
<span class="o">}</span>
<span class="c"># kill childs and restart all the scripts</span>
restart_scripts<span class="o">(){</span>
kill_childs
<span class="c"># for each script in the list</span>
<span class="k">for </span>script <span class="k">in</span> <span class="s2">"</span><span class="k">${</span><span class="nv">scripts_to_be_executed</span><span class="p">[@]</span><span class="k">}</span><span class="s2">"</span>
<span class="k">do</span>
<span class="c"># run the script and store its pid.</span>
<span class="c"># '&amp;' at the end of command is important otherwise</span>
<span class="c"># the script will block until its execution is finished.</span>
<span class="nv">$script</span> &amp;
<span class="nv">pid</span><span class="o">=</span><span class="nv">$!</span>
pids+<span class="o">=(</span><span class="s2">"</span><span class="nv">$pid</span><span class="s2">"</span><span class="o">)</span>
<span class="k">done</span>
<span class="o">}</span>
<span class="c"># we will restart_scripts with SIGUSR1 signal</span>
<span class="nb">trap</span> <span class="s1">'echo "restarting scripts"; restart_scripts'</span> USR1
<span class="c"># we will kill all the childs and exit the main script with SIGINT</span>
<span class="c"># which is same signal as when you press &lt;Control-C&gt; on your terminal</span>
<span class="nb">trap</span> <span class="s1">'echo exiting; kill_childs; exit'</span> INT
<span class="c"># run the function once</span>
restart_scripts
<span class="c"># infinite loop, otherwise main script will exit before we send signal.</span>
<span class="c"># remember, we started child processes with '&amp;' so they won't block this script</span>
<span class="k">while </span><span class="nb">true</span><span class="p">;</span> <span class="k">do
</span><span class="nb">sleep </span>1
<span class="k">done</span>
</code></pre></div></div>
<p>Now, you can run your main script and reload your child scripts any time with <code class="language-plaintext highlighter-rouge">killall main_script -USR1</code></p>
<p>Here is an example run:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> ./trap_multiple
My pid is 3124123. You know what to do ( ͡° ͜ʖ ͡°)
You can also send me signal with 'killall trap_multiple ...'
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script1. i is 2
Hello from ./script2. i is 3
Hello from ./script1. i is 3
restarting scripts
killing 3124125
killing 3124126
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script1. i is 2
Hello from ./script2. i is 3
Hello from ./script1. i is 3
Hello from ./script2. i is 4
Hello from ./script1. i is 4
restarting scripts
killing 3124304
killing 3124305
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script1. i is 2
Hello from ./script2. i is 2
^Cexiting
killing 3124875
killing 3124876
</code></pre></div></div>
<h3 id="final-words">Final words</h3>
<p>I think I am started to getting obsessed with <code class="language-plaintext highlighter-rouge">trap</code> command because it has such a good name. FOSS folks are at something when it comes to naming. Here is another good one:</p>
<blockquote>
<p>- How can you see the contents of a file? <br />
+ You <em><code class="language-plaintext highlighter-rouge">cat</code></em> it. <br />
- What if you want to see them in reverse order? <br />
+ You <em><code class="language-plaintext highlighter-rouge">tac</code></em> it. <br /></p>
</blockquote>
<p>No, it is not just a joke. Try it… Man I love Gnoo slash Linux.</p>
<p>Anyway, I hope now you know how to <code class="language-plaintext highlighter-rouge">trap</code> and <code class="language-plaintext highlighter-rouge">kill</code>. Next week I will explain how to <code class="language-plaintext highlighter-rouge">unzip; strip; touch; finger; grep; mount; fsck; more; yes; fsck; fsck; umount; clean; sleep</code> <nobr>(° ͜ʖ ͡°)</nobr>. <sup><a href="##" title="jk :D">*</a></sup></p>
</section>
<footer class="page__meta">
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> Updated:</strong> <time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time></p>
</footer>
<section class="page__share">
<a href="https://twitter.com/intent/tweet?text=Hot-Reload+Long+Running+Shell+Scripts+%28feat.+trap+%2F+kill%29%20https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--twitter" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Twitter"><i class="fab fa-fw fa-twitter" aria-hidden="true"></i><span> Twitter</span></a>
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--facebook" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Facebook"><i class="fab fa-fw fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--linkedin" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on LinkedIn"><i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
</section>
<nav class="pagination">
<a href="/2022/12/29/recap-of-2022.html" class="pagination--pager" title="Recap of 2022
">Previous</a>
<a href="#" class="pagination--pager disabled">Next</a>
</nav>
</div>
</article>
<div class="page__related">
<h4 class="page__related-title">You May Also Enjoy</h4>
<div class="grid__wrapper">
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/12/29/recap-of-2022.html" rel="permalink">Recap of 2022
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-12-29T20:22:08+00:00">December 29, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
1 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Its been a while… It has been so long that I forgot how I was writing my blogs back then. My life didnt change that much. Actually, it is getting worse.
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/06/22/rant-on-peoples-reaction-to-copilot.html" rel="permalink">Rant: Stop whatever you are doing and learn how licenses work
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-06-22T07:46:00+00:00">June 22, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
2 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Recently, Github announced
that they are making Github Copilot available for everyone. Previously, it was in Beta and you could get it through the waiting l...</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/04/08/confession-time.html" rel="permalink">Confession Time
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-04-08T15:46:00+00:00">April 8, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
2 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">A failure story
Last week, I received an email from Lets Encrypt reminding me to renew my certificates. I forgot to renew it and the certificate expired. No...</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2022/03/03/never-get-trapped-in-grub-rescue-again.html" rel="permalink">Never Get Trapped in Grub Rescue Again!
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2022-03-03T00:46:00+00:00">March 3, 2022</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-fw fa-clock" aria-hidden="true"></i>
4 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">Anytime I install a new system on my machine, I pray God for nothing bad happens. But it usually happens. When I reboot, I find myself in the “Grub rescue” m...</p>
</article>
</div>
</div>
</div>
</div>
</div>
<div class="search-content">
<div class="search-content__inner-wrap"><form class="search-content__form" onkeydown="return event.key != 'Enter';">
<label class="sr-only" for="search">
Enter your search term...
</label>
<input type="search" id="search" class="search-input" tabindex="-1" placeholder="Enter your search term..." />
</form>
<div id="results" class="results"></div></div>
</div>
<div id="footer" class="page__footer">
<footer>
<!-- start custom footer snippets -->
<!-- end custom footer snippets -->
<div class="page__footer-follow">
<ul class="social-icons">
<li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
</ul>
</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>
</footer>
</div>
<script src="/assets/js/main.min.js"></script>
<script src="/assets/js/lunr/lunr.min.js"></script>
<script src="/assets/js/lunr/lunr-store.js"></script>
<script src="/assets/js/lunr/lunr-en.js"></script>
</body>
</html>

View File

@ -190,7 +190,7 @@
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -369,7 +369,7 @@ me.</li>
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -58,4 +58,10 @@ var store = [{
"tags": [],
"url": "/2022/12/29/recap-of-2022.html",
"teaser": null
},{
"title": "Hot-Reload Long Running Shell Scripts (feat. trap / kill)",
"excerpt":"trap them and kill them! There is a beautiful command in Linux called trap which traps signals and let you run specific commands when they invoked. There is also good ol kill command which not only kills processes but allows you to specify a signal to send. By combining these...","categories": [],
"tags": ["trap","kill","linux"],
"url": "/2023/01/15/hot-reloading-with-trap-and-kill.html",
"teaser": null
}]

View File

@ -352,7 +352,7 @@
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

260
feed.xml
View File

@ -1,4 +1,227 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="https://sahinakkaya.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sahinakkaya.dev/" rel="alternate" type="text/html" /><updated>2022-12-29T22:25:48+00:00</updated><id>https://sahinakkaya.dev/feed.xml</id><title type="html">Şahin Akkayas Personal Page</title><subtitle>Şahin Akkaya's personal blog - a perfectionist who likes to tinker everything until it is just right. Get ready to find some sweet tips that will boost your productivity and make you fall in love with your computer.</subtitle><author><name>Şahin Akkaya</name></author><entry><title type="html">Recap of 2022</title><link href="https://sahinakkaya.dev/2022/12/29/recap-of-2022.html" rel="alternate" type="text/html" title="Recap of 2022" /><published>2022-12-29T20:22:08+00:00</published><updated>2022-12-29T20:22:08+00:00</updated><id>https://sahinakkaya.dev/2022/12/29/recap-of-2022</id><content type="html" xml:base="https://sahinakkaya.dev/2022/12/29/recap-of-2022.html">&lt;p&gt;Its been a while… It has been so long that I forgot how I was writing my blogs back then. My life didnt change that much. Actually, it is getting worse.&lt;/p&gt;
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="https://sahinakkaya.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sahinakkaya.dev/" rel="alternate" type="text/html" /><updated>2023-01-16T04:05:22+00:00</updated><id>https://sahinakkaya.dev/feed.xml</id><title type="html">Şahin Akkayas Personal Page</title><subtitle>Şahin Akkaya's personal blog - a perfectionist who likes to tinker everything until it is just right. Get ready to find some sweet tips that will boost your productivity and make you fall in love with your computer.</subtitle><author><name>Şahin Akkaya</name></author><entry><title type="html">Hot-Reload Long Running Shell Scripts (feat. trap / kill)</title><link href="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="alternate" type="text/html" title="Hot-Reload Long Running Shell Scripts (feat. trap / kill)" /><published>2023-01-15T21:48:08+00:00</published><updated>2023-01-15T21:48:08+00:00</updated><id>https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill</id><content type="html" xml:base="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html">&lt;h2 id=&quot;trap-them-and-kill-them&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trap&lt;/code&gt; them and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kill&lt;/code&gt; them!&lt;/h2&gt;
&lt;p&gt;There is a beautiful command in Linux called &lt;a href=&quot;https://man7.org/linux/man-pages/man1/trap.1p.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trap&lt;/code&gt;&lt;/a&gt; which &lt;em&gt;trap&lt;/em&gt;s signals and let you run specific commands when they invoked. There is also good ol &lt;a href=&quot;https://man7.org/linux/man-pages/man1/kill.1.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kill&lt;/code&gt;&lt;/a&gt; command which not only kills processes but allows you to specify a signal to send. By combining these two, you can run specific functions from your scripts any time!&lt;/p&gt;
&lt;h3 id=&quot;basic-example&quot;&gt;Basic Example&lt;/h3&gt;
&lt;p&gt;Lets start by creating something very simple and build up from there. Create a script with the following contents:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My pid is &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;. Send me SIGUSR1!&quot;&lt;/span&gt;
func&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Got SIGUSR1&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# here we are telling that run 'func' when USR1 signal is &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# received # you can run anything. Combine commands with ; etc.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;func&quot;&lt;/span&gt; USR1
&lt;span class=&quot;c&quot;&gt;# The while loop is important here otherwise our script will exit&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# before we manage to get a chance to send a signal.&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;waiting SIGUSR1&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now make it executable and run it:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;chmod&lt;/span&gt; +x trap_example
./trap_example
My pid is 2811137. Send me SIGUSR1!
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
waiting SIGUSR1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Open another terminal and send your signal with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kill&lt;/code&gt; to the specified pid.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; USR1 2811137
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You should receive &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;Got SIGUSR!&quot;&lt;/code&gt; from the other process. Thats it! Now, imagine you write whatever thing you want to execute in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;func&lt;/code&gt; and then you can simply &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kill -s ...&lt;/code&gt; anytime and as many times you want!&lt;/p&gt;
&lt;p&gt;Lets move the while loop into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;func&lt;/code&gt; and add some variables so you can see how powerful this is.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My pid is &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;. Send me SIGUSR1!&quot;&lt;/span&gt;
func&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;i: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; i &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;echo 'Got SIGUSR1!'; func&quot;&lt;/span&gt; USR1
&lt;span class=&quot;c&quot;&gt;# we need to call the function once, otherwise script&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# will exit before we manage to send a signal&lt;/span&gt;
func
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now run the script and send &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SIGUSR1&lt;/code&gt;. Here is the result:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ./trap_example
My pid is 2880704. Send me SIGUSR1!
i: 1
i: 2
i: 3
i: 4
i: 5
i: 6
i: 7
Got SIGUSR1!
i: 1
i: 2
i: 3
i: 4
i: 5
Got SIGUSR1!
i: 1
i: 2
^C
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Isnt this neat?&lt;/p&gt;
&lt;h3 id=&quot;more-useful-example&quot;&gt;More useful example&lt;/h3&gt;
&lt;p&gt;Lets imagine you have multiple long running (infinite loops basically) scripts and you want to restart them without manually searching for their pids and killing them. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trap&lt;/code&gt; is for the rescue, again! &lt;sup&gt;&lt;a href=&quot;##&quot; title=&quot;Yeah, I know you can run a systemd service if you want but I think it is an overkill for this situation. Plus, I don't like dealing with them.&quot;&gt;*&lt;/a&gt;&lt;/sup&gt; This command is awesome.&lt;/p&gt;
&lt;p&gt;Without further ado, lets get started. Create a script called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;script1&lt;/code&gt; with the following contents:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# file: script1&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello from &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$0&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;. i is &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt; i &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And symlink it to another name just for fun:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;chmod&lt;/span&gt; +x script1
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; script1 script2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now we can pretend they are two different scripts as their outputs differ:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ./script1
Hello from ./script1. i is 1
Hello from ./script1. i is 2
Hello from ./script1. i is 3
Hello from ./script1. i is 4
^C
./script2
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script2. i is 3
^C
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, create the main script which will start child scripts and restart them on our signals:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My pid is &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;. You know what to do ( ͡° ͜ʖ ͡°)&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;You can also send me signal with 'killall &lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$0&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ...'&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;pids&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=()&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# we will store the pid's of child scripts here&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;scripts_to_be_executed&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;./script1&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./script2&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
kill_childs&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# wow, this sounded wild&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;pid &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pids&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[@]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;killing &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pid&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pid&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pids&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# kill childs and restart all the scripts&lt;/span&gt;
restart_scripts&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
kill_childs
&lt;span class=&quot;c&quot;&gt;# for each script in the list&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;script &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;scripts_to_be_executed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[@]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# run the script and store its pid.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# '&amp;amp;' at the end of command is important otherwise&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# the script will block until its execution is finished.&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$script&lt;/span&gt; &amp;amp;
&lt;span class=&quot;nv&quot;&gt;pid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$!&lt;/span&gt;
pids+&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pid&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# we will restart_scripts with SIGUSR1 signal&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'echo &quot;restarting scripts&quot;; restart_scripts'&lt;/span&gt; USR1
&lt;span class=&quot;c&quot;&gt;# we will kill all the childs and exit the main script with SIGINT&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# which is same signal as when you press &amp;lt;Control-C&amp;gt; on your terminal&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'echo exiting; kill_childs; exit'&lt;/span&gt; INT
&lt;span class=&quot;c&quot;&gt;# run the function once&lt;/span&gt;
restart_scripts
&lt;span class=&quot;c&quot;&gt;# infinite loop, otherwise main script will exit before we send signal.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# remember, we started child processes with '&amp;amp;' so they won't block this script&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now, you can run your main script and reload your child scripts any time with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;killall main_script -USR1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here is an example run:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ./trap_multiple
My pid is 3124123. You know what to do ( ͡° ͜ʖ ͡°)
You can also send me signal with 'killall trap_multiple ...'
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script1. i is 2
Hello from ./script2. i is 3
Hello from ./script1. i is 3
restarting scripts
killing 3124125
killing 3124126
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script2. i is 2
Hello from ./script1. i is 2
Hello from ./script2. i is 3
Hello from ./script1. i is 3
Hello from ./script2. i is 4
Hello from ./script1. i is 4
restarting scripts
killing 3124304
killing 3124305
Hello from ./script1. i is 1
Hello from ./script2. i is 1
Hello from ./script1. i is 2
Hello from ./script2. i is 2
^Cexiting
killing 3124875
killing 3124876
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3 id=&quot;final-words&quot;&gt;Final words&lt;/h3&gt;
&lt;p&gt;I think I am started to getting obsessed with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trap&lt;/code&gt; command because it has such a good name. FOSS folks are at something when it comes to naming. Here is another good one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;- How can you see the contents of a file? &lt;br /&gt;
+ You &lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat&lt;/code&gt;&lt;/em&gt; it. &lt;br /&gt;
- What if you want to see them in reverse order? &lt;br /&gt;
+ You &lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tac&lt;/code&gt;&lt;/em&gt; it. &lt;br /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No, it is not just a joke. Try it… Man I love Gnoo slash Linux.&lt;/p&gt;
&lt;p&gt;Anyway, I hope now you know how to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trap&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kill&lt;/code&gt;. Next week I will explain how to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unzip; strip; touch; finger; grep; mount; fsck; more; yes; fsck; fsck; umount; clean; sleep&lt;/code&gt; &lt;nobr&gt;(° ͜ʖ ͡°)&lt;/nobr&gt;. &lt;sup&gt;&lt;a href=&quot;##&quot; title=&quot;jk :D&quot;&gt;*&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</content><author><name>Şahin Akkaya</name></author><category term="trap" /><category term="kill" /><category term="linux" /><summary type="html">trap them and kill them!</summary></entry><entry><title type="html">Recap of 2022</title><link href="https://sahinakkaya.dev/2022/12/29/recap-of-2022.html" rel="alternate" type="text/html" title="Recap of 2022" /><published>2022-12-29T20:22:08+00:00</published><updated>2022-12-29T20:22:08+00:00</updated><id>https://sahinakkaya.dev/2022/12/29/recap-of-2022</id><content type="html" xml:base="https://sahinakkaya.dev/2022/12/29/recap-of-2022.html">&lt;p&gt;Its been a while… It has been so long that I forgot how I was writing my blogs back then. My life didnt change that much. Actually, it is getting worse.&lt;/p&gt;
&lt;p&gt;The biggest problem of my life is the graduation project. Oh, God it is making me sick! I simply dont have any interest for the subject I am supposed to work on. One part of me saying that “come on, you came this far. You are nearly finished. One last push!” and other part of me saying “oh no, dont do it. You have never done something you dont like in your entire life. F*ck it!”. So I am wasting my time each term with the dilemma I just described. I really dont know what to do. This thing is fed up.&lt;/p&gt;
@ -462,37 +685,4 @@ util.lua: highlight&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;group, prope
&lt;ul&gt;
&lt;li&gt;I figured that out only after using wild card in the second command. So I think it is does not feel natural.&lt;/li&gt;
&lt;li&gt;It is still not giving the same output. Try and see the difference! &lt;a href=&quot;##&quot; title=&quot;You will not be able to see which file contains which line. 'cat' will just concatenate all the input.&quot;&gt;*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Şahin Akkaya</name></author><category term="cat" /><category term="grep" /><category term="linux" /><category term="command-line" /><summary type="html">cat some_file | grep some_pattern Im sure that you run a command something like above at least once if you are using terminal. You know how cat and grep works and you also know what pipe (|) does. So you naturally combine all of these to make the job done. I was also doing it this way. What I didnt know is that grep already accepts file as an argument. So the above command could be rewritten as: grep some_pattern some_file</summary></entry><entry><title type="html">First blog post</title><link href="https://sahinakkaya.dev/2021/12/24/first-blog-post.html" rel="alternate" type="text/html" title="First blog post" /><published>2021-12-24T23:54:08+00:00</published><updated>2021-12-24T23:54:08+00:00</updated><id>https://sahinakkaya.dev/2021/12/24/first-blog-post</id><content type="html" xml:base="https://sahinakkaya.dev/2021/12/24/first-blog-post.html">&lt;style&gt;
.ab {
font-size: 1.3em;
line-height:0;
top:0;
}
.cd {
text-decoration: none;
}
&lt;/style&gt;
&lt;p&gt;&lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Hello, World!&lt;/code&gt;&lt;/em&gt;&lt;a href=&quot;##&quot; title=&quot;I think I just wrote the best first sentence I could write as a programmer :D&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;
So here I am and welcome to my first blog. Having a personal space on the Internet has been a dream for me for years and I am happy that it finally have come true. You might think that I could sign-up for a social media platform and my profile would be a personal space for me but no. I just dont feel comfortable with that way. This has been the case since my childhood and also the reason why I dont use Facebook, Instagram or any other social media. If you think you found me on these platforms, I would say it is not me. I might write another post about why I dont like social media but I will cut this one here.&lt;/p&gt;
&lt;h2 id=&quot;why-i-wanted-to-start-blogging&quot;&gt;Why I wanted to start blogging?&lt;/h2&gt;
&lt;p&gt;There are several reasons for starting my own site and blogging, but I can list the most important ones as follows:&lt;/p&gt;
&lt;h3 id=&quot;giving-back-to-community&quot;&gt;Giving back to community&lt;/h3&gt;
&lt;p&gt;I use the software developed and brought by the community every day. The moment I power on my computer I start using Free Software. It really amazes me to see the work produced by people who do not know each other at all. For example, I did not even write a single line of code for this site. If Free Software didnt exist, Id either have to spend money and use a platform that I have limited control over, or waste my time and build a site with a possibly worse design than this one&lt;a href=&quot;##&quot; title=&quot;swh&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;. In return for this, I want to give back to the community. For me, the way to give back to the community so far has been to share the projects Ive done and archive the things I learn every day in a repository called &lt;a href=&quot;https://github.com/Asocia/til&quot;&gt;TIL&lt;/a&gt;&lt;a href=&quot;##&quot; title=&quot;Today I Learned&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;. But some of the tils Ive written recently are getting lengthy and I think they deserve their own posts. So instead of writing long tils, I will blog what I learned here.&lt;/p&gt;
&lt;h3 id=&quot;archiving-the-memories&quot;&gt;Archiving the memories&lt;/h3&gt;
&lt;p&gt;I like to go over what I have done in the past once in a while. Blogging is perfect way to do this. I still read my diaries that I wrote in the past and they are fun. But I promise I will keep these posts more formal than my diaries&lt;a href=&quot;##&quot; title=&quot;swh&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;pushing-myself-to-do-something-useful&quot;&gt;Pushing myself to do something useful&lt;/h3&gt;
&lt;p&gt;At the end of every year, I sit on my desk and think about what I did in that year. I generally dont like the result because I fail to keep some of my resolutions for that year. Setting up a personal website was one of my resolutions for 2021 and it looks like I manage to keep it&lt;a href=&quot;##&quot; title=&quot;hooray!&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;&lt;a href=&quot;##&quot; title=&quot;swh&quot; class=&quot;cd&quot;&gt;&lt;sup class=&quot;ab&quot;&gt;*&lt;/sup&gt;&lt;/a&gt;. Unfortunately, I cant always keep my spirits up. Sometimes I just do nothing and all the time passes. Hopefully, the feeling that I have to write something will help me get out of bad mood at such times.&lt;/p&gt;
&lt;h3 id=&quot;improving-my-writing-skills&quot;&gt;Improving my writing skills&lt;/h3&gt;
&lt;p&gt;Last but not least, I want to improve my writing. Even though I dont use a formal language while writing here, I think it will help me improve my writing skills.&lt;/p&gt;
&lt;h2 id=&quot;final-words&quot;&gt;Final words&lt;/h2&gt;
&lt;p&gt;While writing this post I already come up with some new topics to write but I think they need their own posts.&lt;/p&gt;
&lt;p&gt;Subscribe to my &lt;a href=&quot;/feed.xml&quot;&gt;&lt;i class=&quot;fas fa-fw fa-rss-square&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;RSS Feed&lt;/a&gt; to not miss them. You know RSS, right? I recently started using it and it is the best way to consume content. Do yourself a favor and search it if you dont know. I will probably write something about it in the following blog posts. Thats all from me and thank you for reading. See you next time!&lt;/p&gt;</content><author><name>Şahin Akkaya</name></author><summary type="html">Hello, World!* So here I am and welcome to my first blog. Having a personal space on the Internet has been a dream for me for years and I am happy that it fi...</summary></entry></feed>
&lt;/ul&gt;</content><author><name>Şahin Akkaya</name></author><category term="cat" /><category term="grep" /><category term="linux" /><category term="command-line" /><summary type="html">cat some_file | grep some_pattern Im sure that you run a command something like above at least once if you are using terminal. You know how cat and grep works and you also know what pipe (|) does. So you naturally combine all of these to make the job done. I was also doing it this way. What I didnt know is that grep already accepts file as an argument. So the above command could be rewritten as: grep some_pattern some_file</summary></entry></feed>

View File

@ -284,6 +284,53 @@
<div class="list__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h2 class="archive__item-title no_toc" itemprop="headline">
<a href="/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="permalink">Hot-Reload Long Running Shell Scripts (feat. trap / kill)
</a>
</h2>
<p class="page__meta">
<span class="page__meta-date">
<i class="far fa-calendar-alt" aria-hidden="true"></i>
<time datetime="2023-01-15T21:48:08+00:00">January 15, 2023</time>
</span>
<span class="page__meta-sep"></span>
<span class="page__meta-readtime">
<i class="far fa-clock" aria-hidden="true"></i>
5 minute read
</span>
</p>
<p class="archive__item-excerpt" itemprop="description">trap them and kill them!
</p>
</article>
</div>
<div class="list__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
@ -788,7 +835,7 @@ Im sure that you run a command something like above at least once if you are
</ul>
</div>
<div class="page__footer-copyright">&copy; 2022 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>

View File

@ -41,6 +41,10 @@
<lastmod>2022-12-29T20:22:08+00:00</lastmod>
</url>
<url>
<loc>https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html</loc>
<lastmod>2023-01-15T21:48:08+00:00</lastmod>
</url>
<url>
<loc>https://sahinakkaya.dev/about/</loc>
</url>
<url>
@ -51,6 +55,6 @@
</url>
<url>
<loc>https://sahinakkaya.dev/assets/docs/resume.pdf</loc>
<lastmod>2022-12-29T22:25:41+00:00</lastmod>
<lastmod>2023-01-16T04:00:03+00:00</lastmod>
</url>
</urlset>