diff --git a/_posts/2016-07-12-installing-gentoo-on-a-thinkpad-x60s.md b/_posts/2016-07-12-installing-gentoo-on-a-thinkpad-x60s.md index f6fcb81..f2f0380 100644 --- a/_posts/2016-07-12-installing-gentoo-on-a-thinkpad-x60s.md +++ b/_posts/2016-07-12-installing-gentoo-on-a-thinkpad-x60s.md @@ -12,9 +12,9 @@ My only laptop is a [IBM/Lenovo ThinkPad X60s](http://www.thinkwiki.org/wiki/Cat * 60GB of SATA1 hard drive; * Wifi, Bluetooth, trackpoint mouse only, 56k modem, and a decent set of I/0 ports (including a CardBus slot!). -![Think1](https://dl.dropboxusercontent.com/content_link/JzTZf5zYyBkpLDDOz1vtSMvPga8OIM1SBjID6G6R7jMplbaidXTSWjwqClip3RaL/file) +![Think1](https://dl.dropboxusercontent.com/s/vkm6phz5yb2k4oq/IMG_20160712_143708.jpg?dl=0) -![Think2](https://dl.dropboxusercontent.com/content_link/t6IewbrmvdhYQBREpdr5r9F61SUFSK0uEZMA30LcLOE5Th6CTd5mdXBH8Ju2CFa8/file) +![Think2](https://dl.dropboxusercontent.com/s/wfjj1wih90lrzax/IMG_20160712_143618.jpg?dl=0) This machine had an installation on Arch Linux, and I was using it for school stuff. It runned smoothly KDE5, Atom (great editor, I'm using it to write this article), and it was usable even with Phpstorm. Pretty impressive for such an old thing, right? @@ -32,6 +32,6 @@ I had another problem with `make menuconfig`, the tool used to specify what feat At the end, I made it! I only have a base install, but i can show you `screenfetch`: -![Screenfetch](https://dl.dropboxusercontent.com/content_link/IPYdz4IcrWSE7MkHCcT3om38HrmEJCHMTifZa2apowHsiV7mlfMCUJ0ciYzk4Izz/file) +![Screenfetch](https://dl.dropboxusercontent.com/s/fbysnd58sj4g3kl/IMG_20160711_162733.jpg?dl=0) I've not installed Gentoo in dual boot because I didn't figured out how to switch my bluetooth dongle in HID mode yet, so I can't select the OS with `rEFInd`. Hope this rambling was, if not useful, at least entertaining! diff --git a/_posts/2016-08-15-my-archery-setup.md b/_posts/2016-08-15-my-archery-setup.md new file mode 100644 index 0000000..5e5c6f2 --- /dev/null +++ b/_posts/2016-08-15-my-archery-setup.md @@ -0,0 +1,25 @@ +--- +layout: post +title: "My archery setup!" +date: 2016-08-15 12:00:00 +0200 +categories: archery +--- +Hey there! This is my first post about archery, so I thought that I could have done a tour of my setup. As I wrote in the about page, I'm a Olmpic recurve archer based in Italy. I do this for almost five years! If you don't understand everything I say, you can check out the youtube channel [Nusensei](https://www.youtube.com/user/NUSensei/). It's a very good source, especially for beginners. + +![Bow1](https://dl.dropboxusercontent.com/s/efmap2qqvz6yapn/IMG_20160809_164942.jpg?dl=0) + +Ok, the setup. I own a *Fiberbow 5.99* LH (yes, I'm left handed) as my `riser`, the *central* part of the bow. It's made by carbon fiber so it's very lightweight. And is not painted too: It looks kinda cool. Many experienced archers could complain saying that carbon fiber bends and this is a bad thing. Instead, I think this gives you a nice feedback when you release. Also I tried to raise a friend's *Hoyt Prodigy XT*, and there's no way I'm going to lift such a weight on a regular base. Both the risers mentioned are high-range ones: I got mine 50% off because it wasn't the latest model and it had some minor ahestetic flaws. Also, this isn't my first one. In fact, I used to shoot with an Orange SF Premium: great bow for beginners! + +As limbs, I use a pair of *EXE College* rated at 34 pounds. Since I'm quite tall (limbs and riser toghether make a 70" tall bow), my draw length is around 29.5" and my draw weight is around 38 pounds. + +The sight is a *Shibuya Dual Click*. You can check out [this](https://www.youtube.com/watch?v=_ZvAnyxazpY) review by Nusensei (by the way, I knew his channel from this very video). + +As stabilizers, I use a set of *Fiberbow S.3* ones with yellow dampeners (for those who know the difference between the colours). + +As plunger button, I use a *EXE* one. It's a middle range one, but it seems very well built and it works fine! Also, I'm not going to spend 90€ for a `Cartel` one. + +My current arrows are a set of *Easton X7 Eclipse* spined at 2213. These are winter alluminium arrows, but since they are cheaper than carbon ones, I bought these as a total replacement of my *VAP V6* 600. Those, due to form flaws, were 2 inches too short. Oh, and I always used *Spin Wings* and *Elivanes*, a stiffer plastic italian replacement. + +Here's an image of the complete bow at the archery range: + +![Bow2](https://dl.dropboxusercontent.com/s/ril7kk9zd0l4vrf/IMG_20160809_175554.jpg?dl=0) diff --git a/_site/2016/07/28/2016-07-28-how-to-rickroll-people-launching-rm-rf-on-your-system.html b/_site/2016/07/28/2016-07-28-how-to-rickroll-people-launching-rm-rf-on-your-system.html deleted file mode 100644 index 4a87b80..0000000 --- a/_site/2016/07/28/2016-07-28-how-to-rickroll-people-launching-rm-rf-on-your-system.html +++ /dev/null @@ -1 +0,0 @@ -

WARNING: this

diff --git a/_site/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html b/_site/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html deleted file mode 100644 index 72fb118..0000000 --- a/_site/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html +++ /dev/null @@ -1,8 +0,0 @@ -
-

layout: post -title: “How to rickroll people that run “rm -rf” on your system” -date: 2016-07-28 18:00:00 +0200 -categories: linux -—-

- -

WARNING: this

diff --git a/_site/linux/2016/12/07/installing-gentoo-on-a-thinkpad-x60s.html b/_site/archery/2016/08/15/my-archery-setup.html similarity index 66% rename from _site/linux/2016/12/07/installing-gentoo-on-a-thinkpad-x60s.html rename to _site/archery/2016/08/15/my-archery-setup.html index 241259e..67c8e1f 100644 --- a/_site/linux/2016/12/07/installing-gentoo-on-a-thinkpad-x60s.html +++ b/_site/archery/2016/08/15/my-archery-setup.html @@ -5,12 +5,12 @@ - Installing Gentoo on a Lenovo ThinkPad X60s - + My archery setup! + - + @@ -75,20 +75,30 @@
-

Installing Gentoo on a Lenovo ThinkPad X60s

- +

My archery setup!

+
-

My only laptop is a IBM/Lenovo ThinkPad X60s, a top line “ultrabook” from 2006 that features: -- An Intel Core Duo L2400 dual core 32 bit CPU, clocked at 1.66 Ghz; -- 2GB of RAM; -- 60GB of SATA1 hard drive; -- Wifi, Bluetooth, trackpoint mouse only, 56k modem, and a decent set of I/0 ports (including a CardBus slot!).

+

Hey there! This is my first post about archery, so I thought that I could have done a tour of my setup. As I wrote in the about page, I’m a Olmpic recurve archer based in Italy. I do this for almost five years! If you don’t understand everything I say, you can check out the youtube channel Nusensei. It’s a very good source, especially for beginners.

-

This machine had an installation on Arch Linux, and I was using it for school stuff. It runned smoothly KDE5, Atom (great editor, I’m using it to write this article), and it was usable even with Phpstorm. Pretty impressive for such an old machine, right?

+

Bow1

-

Since now I don’t need this laptop every day I decided to give a try at Gentoo, another rolling relase, DIY install distro. This was both a test of my skills, my patience and the performances of the machine. For those of you that don’t know, Gentoo hasn’t binary packages: imagine using Arch with just a developer mantained AUR.

+

Ok, the setup. I own a Fiberbow 5.99 LH (yes, I’m left handed) as my riser, the central part of the bow. It’s made by carbon fiber so it’s very lightweight. And is not painted too: It looks kinda cool. Many experienced archers could complain saying that carbon fiber bends and this is a bad thing. Instead, I think this gives you a nice feedback when you release. Also I tried to raise a friend’s Hoyt Prodigy XT, and there’s no way I’m going to lift such a weight on a regular base. Both the risers mentioned are high-range ones: I got mine 50% off because it wasn’t the latest model and it had some minor ahestetic flaws. Also, this isn’t my first one. In fact, I used to shoot with an Orange SF Premium: great bow for beginners!

+ +

As limbs, I use a pair of EXE College rated at 34 pounds. Since I’m quite tall (limbs and riser toghether make a 70” tall bow), my draw length is around 29.5” and my draw weight is around 38 pounds.

+ +

The sight is a Shibuya Dual Click. You can check out this review by Nusensei (by the way, I knew his channel from this very video).

+ +

As stabilizers, I use a set of Fiberbow S.3 ones with yellow dampeners (for those who know the difference between the colours).

+ +

As plunger button, I use a EXE one. It’s a middle range one, but it seems very well built and it works fine! Also, I’m not going to spend 90€ for a Cartel one.

+ +

My current arrows are a set of Easton X7 Eclipse spined at 2213. These are winter alluminium arrows, but since they are cheaper than carbon ones, I bought these as a total replacement of my VAP V6 600. Those, due to form flaws, were 2 inches too short. Oh, and I always used Spin Wings and Elivanes, a stiffer plastic italian replacement.

+ +

Here’s an image of the complete bow at the archery range:

+ +

Bow2

diff --git a/_site/feed.xml b/_site/feed.xml index 590c04e..2091229 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -6,9 +6,40 @@ http://praticamentetilde.github.io/ - Thu, 28 Jul 2016 15:51:30 +0200 - Thu, 28 Jul 2016 15:51:30 +0200 - Jekyll v3.1.6 + Mon, 15 Aug 2016 10:44:41 +0200 + Mon, 15 Aug 2016 10:44:41 +0200 + Jekyll v3.2.1 + + + My archery setup! + <p>Hey there! This is my first post about archery, so I thought that I could have done a tour of my setup. As I wrote in the about page, I’m a Olmpic recurve archer based in Italy. I do this for almost five years! If you don’t understand everything I say, you can check out the youtube channel <a href="https://www.youtube.com/user/NUSensei/">Nusensei</a>. It’s a very good source, especially for beginners.</p> + +<p><img src="https://dl.dropboxusercontent.com/s/efmap2qqvz6yapn/IMG_20160809_164942.jpg?dl=0" alt="Bow1" /></p> + +<p>Ok, the setup. I own a <em>Fiberbow 5.99</em> LH (yes, I’m left handed) as my <code class="highlighter-rouge">riser</code>, the <em>central</em> part of the bow. It’s made by carbon fiber so it’s very lightweight. And is not painted too: It looks kinda cool. Many experienced archers could complain saying that carbon fiber bends and this is a bad thing. Instead, I think this gives you a nice feedback when you release. Also I tried to raise a friend’s <em>Hoyt Prodigy XT</em>, and there’s no way I’m going to lift such a weight on a regular base. Both the risers mentioned are high-range ones: I got mine 50% off because it wasn’t the latest model and it had some minor ahestetic flaws. Also, this isn’t my first one. In fact, I used to shoot with an Orange SF Premium: great bow for beginners!</p> + +<p>As limbs, I use a pair of <em>EXE College</em> rated at 34 pounds. Since I’m quite tall (limbs and riser toghether make a 70” tall bow), my draw length is around 29.5” and my draw weight is around 38 pounds.</p> + +<p>The sight is a <em>Shibuya Dual Click</em>. You can check out <a href="https://www.youtube.com/watch?v=_ZvAnyxazpY">this</a> review by Nusensei (by the way, I knew his channel from this very video).</p> + +<p>As stabilizers, I use a set of <em>Fiberbow S.3</em> ones with yellow dampeners (for those who know the difference between the colours).</p> + +<p>As plunger button, I use a <em>EXE</em> one. It’s a middle range one, but it seems very well built and it works fine! Also, I’m not going to spend 90€ for a <code class="highlighter-rouge">Cartel</code> one.</p> + +<p>My current arrows are a set of <em>Easton X7 Eclipse</em> spined at 2213. These are winter alluminium arrows, but since they are cheaper than carbon ones, I bought these as a total replacement of my <em>VAP V6</em> 600. Those, due to form flaws, were 2 inches too short. Oh, and I always used <em>Spin Wings</em> and <em>Elivanes</em>, a stiffer plastic italian replacement.</p> + +<p>Here’s an image of the complete bow at the archery range:</p> + +<p><img src="https://dl.dropboxusercontent.com/s/ril7kk9zd0l4vrf/IMG_20160809_175554.jpg?dl=0" alt="Bow2" /></p> + + Mon, 15 Aug 2016 12:00:00 +0200 + http://praticamentetilde.github.io/archery/2016/08/15/my-archery-setup.html + http://praticamentetilde.github.io/archery/2016/08/15/my-archery-setup.html + + + archery + + How to rickroll people that try to run "rm -rf" on your system @@ -23,16 +54,16 @@ <p>The method that I’ll show will lock any <code class="highlighter-rouge">rm</code> command runned in both recursive and force mode, so <code class="highlighter-rouge">rm -rf</code>, <code class="highlighter-rouge">rm -f -r</code> and <code class="highlighter-rouge">rm -r --force</code> are all blocked, even if they are launched by <code class="highlighter-rouge">sudo</code>. I’m going to alias the rm command in <code class="highlighter-rouge">/etc/profile</code> <code class="highlighter-rouge">/etc/bash.bashrc</code> and in <code class="highlighter-rouge">/etc/zsh/zshrc</code> (I’m a zsh user) so that the rickroll will be possible from all users, even root and the ones with a brand new <code class="highlighter-rouge">bashrc</code> or <code class="highlighter-rouge">zshrc</code>. Here is the code I appended to those files:</p> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nb">alias </span><span class="nv">rm</span><span class="o">=</span>/bin/rmAlias -<span class="nb">alias </span><span class="nv">sudo</span><span class="o">=</span><span class="s1">'sudo '</span> <span class="c"># this enables aliases in sudo, see http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo</span></code></pre></figure> +<span class="nb">alias </span><span class="nv">sudo</span><span class="o">=</span><span class="s1">'sudo '</span> <span class="c"># this enables aliases in sudo, see http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo</span></code></pre></figure> -<p>Since <code class="highlighter-rouge">alias</code> is not able to control flags of the aliases (see <a href="http://apple.stackexchange.com/questions/50963/how-do-i-add-a-flag-to-an-alias">here</a>), we’re going to redirect each call of <code class="highlighter-rouge">rm</code> to <code class="highlighter-rouge">/bin/rmAlias</code>, that would run the command if it’s safe. I didn’t use a function because it’s a bit tricky to make that work with <code class="highlighter-rouge">sudo</code>. So, let’s see the code I put in <code class="highlighter-rouge">rmAlias</code>:</p> +<p>Since <code class="highlighter-rouge">alias</code> is not able to control the flags of the aliases (see <a href="http://apple.stackexchange.com/questions/50963/how-do-i-add-a-flag-to-an-alias">here</a>), we’re going to redirect each call of <code class="highlighter-rouge">rm</code> to <code class="highlighter-rouge">/bin/rmAlias</code>, that would run the command if it’s safe. I didn’t use a function because it’s a bit tricky to make that work with <code class="highlighter-rouge">sudo</code>. So, let’s see the code I put in <code class="highlighter-rouge">rmAlias</code>:</p> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#! /bin/bash</span> <span class="c"># Rickroll whoever tries to desert this system, even root.</span> <span class="c"># To achieve this, set the appropriate aliases even in /etc/profile and similars.</span> <span class="c"># Video played when rickrolling</span> -<span class="nv">ROLLVIDEO</span><span class="o">=</span>/opt/anti-rm/serious-video.mkv <span class="c"># it's just Never Gonna Give You Up on my system, but be free to customize this!</span> +<span class="nv">ROLLVIDEO</span><span class="o">=</span>/opt/anti-rm/serious-video.mkv <span class="c"># it's just Never Gonna Give You Up on my system, but be free to customize this!</span> rickroll<span class="o">(){</span> <span class="nb">echo</span> <span class="s2">"Never gonna desert this system..."</span> @@ -41,7 +72,7 @@ rickroll<span class="o">(){</span> <span class="o">}</span> <span class="k">while </span><span class="nb">getopts</span> <span class="s2">":rf-"</span> opt; <span class="k">do</span> - <span class="c"># Prevent '--force' to be detected as -r and -f</span> + <span class="c"># Prevent '--force' to be detected as -r and -f</span> <span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$opt</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"-"</span> <span class="o">]</span>; <span class="k">then </span><span class="nv">OPTIND</span><span class="o">=</span><span class="nv">$OPTIND</span>+1 <span class="k">continue @@ -63,7 +94,7 @@ for </span>var <span class="k">in</span> <span cl <span class="k">fi done</span> -<span class="c"># If it's safe, just run rm</span> +<span class="c"># If it's safe, just run rm</span> /bin/rm <span class="s2">"</span><span class="nv">$@</span><span class="s2">"</span> <span class="nb">exit</span> <span class="nv">$?</span></code></pre></figure> @@ -97,15 +128,15 @@ done</span> <li>Wifi, Bluetooth, trackpoint mouse only, 56k modem, and a decent set of I/0 ports (including a CardBus slot!).</li> </ul> -<p><img src="https://dl.dropboxusercontent.com/content_link/JzTZf5zYyBkpLDDOz1vtSMvPga8OIM1SBjID6G6R7jMplbaidXTSWjwqClip3RaL/file" alt="Think1" /></p> +<p><img src="https://dl.dropboxusercontent.com/s/vkm6phz5yb2k4oq/IMG_20160712_143708.jpg?dl=0" alt="Think1" /></p> -<p><img src="https://dl.dropboxusercontent.com/content_link/t6IewbrmvdhYQBREpdr5r9F61SUFSK0uEZMA30LcLOE5Th6CTd5mdXBH8Ju2CFa8/file" alt="Think2" /></p> +<p><img src="https://dl.dropboxusercontent.com/s/wfjj1wih90lrzax/IMG_20160712_143618.jpg?dl=0" alt="Think2" /></p> <p>This machine had an installation on Arch Linux, and I was using it for school stuff. It runned smoothly KDE5, Atom (great editor, I’m using it to write this article), and it was usable even with Phpstorm. Pretty impressive for such an old thing, right?</p> <p>Since now I don’t need this laptop every day I decided to give a try at Gentoo, another rolling relase, DIY install distro. This was both a test of my skills, my patience and the performances of the machine. For those of you that don’t know, Gentoo hasn’t binary packages: imagine using Arch with just a developer mantained AUR.</p> -<p>I followed the <a href="https://wiki.gentoo.org/wiki/Handbook:Main_Page">installation guide</a> without any problem until I had to emerge and install 309 packets from my <code class="highlighter-rouge">@world</code> set: it took 15 hours! The compilation of <code class="highlighter-rouge">cmake</code> crashed because of memory starvation, and so I had to use a spare USB stick as swap (the root file system wasn’t resizable as it was JFS). After some research and a couple of seconds in <code class="highlighter-rouge">top</code> I discovered that <a href="https://en.wikipedia.org/wiki/Physical_Address_Extension">PAE</a> was not implemented in the install disk kernel. TIP: if you want to use a nicer install enviroment, use the Arch ISO. With gentoo, the initialisation of the file system is made with a <a href="https://wiki.gentoo.org/wiki/Stage_tarball#Stage_3">stage 3 tarball</a> and not by tools like <a href="https://wiki.archlinux.org/index.php/beginners'_guide#Install_the_base_packages">pacstrap</a>.</p> +<p>I followed the <a href="https://wiki.gentoo.org/wiki/Handbook:Main_Page">installation guide</a> without any problem until I had to emerge and install 309 packets from my <code class="highlighter-rouge">@world</code> set: it took 15 hours! The compilation of <code class="highlighter-rouge">cmake</code> crashed because of memory starvation, and so I had to use a spare USB stick as swap (the root file system wasn’t resizable as it was JFS). After some research and a couple of seconds in <code class="highlighter-rouge">top</code> I discovered that <a href="https://en.wikipedia.org/wiki/Physical_Address_Extension">PAE</a> was not implemented in the install disk kernel. TIP: if you want to use a nicer install enviroment, use the Arch ISO. With gentoo, the initialisation of the file system is made with a <a href="https://wiki.gentoo.org/wiki/Stage_tarball#Stage_3">stage 3 tarball</a> and not by tools like <a href="https://wiki.archlinux.org/index.php/beginners'_guide#Install_the_base_packages">pacstrap</a>.</p> <p>I had another problem with <code class="highlighter-rouge">make menuconfig</code>, the tool used to specify what features add or remove in your compiled from source Linux kernel. The ncurses menu showed me 64bit options, even if the install disk and the CPU were both 32 bit. If you have this issue too, you can set the <code class="highlighter-rouge">ARCH</code> variable by your own:</p> @@ -115,7 +146,7 @@ done</span> <p>At the end, I made it! I only have a base install, but i can show you <code class="highlighter-rouge">screenfetch</code>:</p> -<p><img src="https://dl.dropboxusercontent.com/content_link/IPYdz4IcrWSE7MkHCcT3om38HrmEJCHMTifZa2apowHsiV7mlfMCUJ0ciYzk4Izz/file" alt="Screenfetch" /></p> +<p><img src="https://dl.dropboxusercontent.com/s/fbysnd58sj4g3kl/IMG_20160711_162733.jpg?dl=0" alt="Screenfetch" /></p> <p>I’ve not installed Gentoo in dual boot because I didn’t figured out how to switch my bluetooth dongle in HID mode yet, so I can’t select the OS with <code class="highlighter-rouge">rEFInd</code>. Hope this rambling was, if not useful, at least entertaining!</p> diff --git a/_site/index.html b/_site/index.html index 51bfa01..f6e91fa 100644 --- a/_site/index.html +++ b/_site/index.html @@ -124,6 +124,14 @@
    +
  • + + +

    + My archery setup! +

    +
  • +
  • diff --git a/_site/linux/2016/07/12/how-to-rickroll-people-launching-rm-rf-on-your-system.html b/_site/linux/2016/07/12/how-to-rickroll-people-launching-rm-rf-on-your-system.html deleted file mode 100644 index a138ad7..0000000 --- a/_site/linux/2016/07/12/how-to-rickroll-people-launching-rm-rf-on-your-system.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - How to rickroll people that try to run "rm -rf" on your system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -

    How to rickroll people that try to run "rm -rf" on your system

    - -
    - -
    -

    WARNING: The method showed here could not prevent the actual execution of “rm -rf” if the “UNIX vandal” is clever enough. Proceed at your own risk, and make backups!

    - -

    I like Rick Astley late 80’s songs, and you can see them here in my Spotify:

    - -

    dQw4w9WgXcQ

    - -

    I like rickrolling people myself too, especially if they’re trying to delete my entire /home directory or, even worse, /. Since I learned how to use the alias built-in, I wanted a way to prevent that random people tinkering with my laptop (that I may forgot to lock) could delete potentially important stuff, just for fun or boredom.

    - -

    The method that I’ll show will lock any rm command runned in both recursive and force mode, so rm -rf, rm -f -r and rm -r --force are all blocked, even if they are launched by sudo. I’m going to alias the rm command in /etc/profile /etc/bash.bashrc and in /etc/zsh/zshrc (I’m a zsh user) so that the rickroll will be possible from all users, even root and the ones with a brand new bashrc or zshrc. Here is the code I appended to those files:

    - -
    alias rm=/bin/rmAlias
    -alias sudo='sudo ' # this enables aliases in sudo, see http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo
    - -

    Since alias is not able to control flags of the aliases (see here), we’re going to redirect each call of rm to /bin/rmAlias, that would run the command if it’s safe. I didn’t use a function because it’s a bit tricky to make that work with sudo. So, let’s see the code I put in rmAlias:

    - -
    #! /bin/bash
    -# Rickroll whoever tries to desert this system, even root.
    -# To achieve this, set the appropriate aliases even in /etc/profile and similars.
    -
    -# Video played when rickrolling
    -ROLLVIDEO=/opt/anti-rm/serious-video.mkv # it's just Never Gonna Give You Up on my system, but be free to customize this!
    -
    -rickroll(){
    -  echo "Never gonna desert this system..."
    -  xdg-open $ROLLVIDEO 2>&1 &
    -  exit 0
    -}
    -
    -while getopts ":rf-" opt; do
    -  # Prevent '--force' to be detected as -r and -f
    -  if [ "$opt" = "-" ]; then
    -    OPTIND=$OPTIND+1
    -    continue
    -  fi
    -  if [ "$opt" = "r" ] || [ "$opt" = "f" ]; then
    -    if [ "$tmp" = "" ]; then
    -      tmp=$opt
    -      continue
    -    elif [ "$tmp" != "$opt" ]; then
    -      rickroll
    -    fi
    -  fi
    -done
    -
    -for var in "$@"
    -do
    -  if [[ "$var" = "--force" && "$tmp" = "r" ]]; then
    -    rickroll
    -  fi
    -done
    -
    -# If it's safe, just run rm
    -/bin/rm "$@"
    -exit $?
    - -

    It may look messy to a UNIX guy more experienced than me, but it works. The getopts built-in sees if both the -r and the -f flags are used and, if so, it starts rickroll(), which opens with xdg-open that amazing clip from RickAstleyVEVO. From line 30 and below, the script checks if the --force flag is used instead of -f.

    - -

    Give execute permissions to the script we’ve just created:

    - -
    # chmod +x /bin/rmAlias
    - -

    Restart your shell, and enjoy. If you want to test safely, I suggest trying to run rm -rf with no folders or one nonexistant, since this script stop even these commands.

    - -

    If you want even more security, you can rename this script to /bin/rm and move the original one in some other place, getting rid of all the aliases. I prefer the solution above because it’s tidier: you haven’t to move anything. In fact, this could be just an AUR package…

    - -
    - -
    -
    - - - - -
    -
    -
    - -
    - - - - -
    - -
    - - - diff --git a/_site/linux/2016/07/12/installing-gentoo-on-a-thinkpad-x60s.html b/_site/linux/2016/07/12/installing-gentoo-on-a-thinkpad-x60s.html index db83cff..ccbcccc 100644 --- a/_site/linux/2016/07/12/installing-gentoo-on-a-thinkpad-x60s.html +++ b/_site/linux/2016/07/12/installing-gentoo-on-a-thinkpad-x60s.html @@ -89,9 +89,9 @@
  • Wifi, Bluetooth, trackpoint mouse only, 56k modem, and a decent set of I/0 ports (including a CardBus slot!).
-

Think1

+

Think1

-

Think2

+

Think2

This machine had an installation on Arch Linux, and I was using it for school stuff. It runned smoothly KDE5, Atom (great editor, I’m using it to write this article), and it was usable even with Phpstorm. Pretty impressive for such an old thing, right?

@@ -107,7 +107,7 @@

At the end, I made it! I only have a base install, but i can show you screenfetch:

-

Screenfetch

+

Screenfetch

I’ve not installed Gentoo in dual boot because I didn’t figured out how to switch my bluetooth dongle in HID mode yet, so I can’t select the OS with rEFInd. Hope this rambling was, if not useful, at least entertaining!

diff --git a/_site/linux/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html b/_site/linux/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html index 23fd2eb..d272d69 100644 --- a/_site/linux/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html +++ b/_site/linux/2016/07/28/how-to-rickroll-people-launching-rm-rf-on-your-system.html @@ -93,7 +93,7 @@
alias rm=/bin/rmAlias
 alias sudo='sudo ' # this enables aliases in sudo, see http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo
-

Since alias is not able to control flags of the aliases (see here), we’re going to redirect each call of rm to /bin/rmAlias, that would run the command if it’s safe. I didn’t use a function because it’s a bit tricky to make that work with sudo. So, let’s see the code I put in rmAlias:

+

Since alias is not able to control the flags of the aliases (see here), we’re going to redirect each call of rm to /bin/rmAlias, that would run the command if it’s safe. I didn’t use a function because it’s a bit tricky to make that work with sudo. So, let’s see the code I put in rmAlias:

#! /bin/bash
 # Rickroll whoever tries to desert this system, even root.