<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Linux on Sandro Cirulli</title>
    <link>https://sandrocirulli.net/tags/linux/</link>
    <description>Recent content in Linux on Sandro Cirulli</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Sat, 05 Aug 2017 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sandrocirulli.net/tags/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to exclude a package from being updated on Linux</title>
      <link>https://sandrocirulli.net/how-to-exclude-a-package-from-being-updated-on-linux/</link>
      <pubDate>Sat, 05 Aug 2017 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-exclude-a-package-from-being-updated-on-linux/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/packages-768x514.jpg&#34;&#xA;    alt=&#34;Packages&#34; width=&#34;500&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://www.flickr.com/photos/49889874@N05/4772680734/&#34;&gt;Image: Marc Falardeau - CC BY 2.0&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Sometimes you prefer not to update a specific package in Linux. This may be because you don’t want to upgrade to a new version with new features but no security updates. Or maybe because upgrading requires a service restart that you want to avoid just yet. This was the case for me recently when a new version of Docker came up and upgrading would have restarted the docker daemon and stopped the running containers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to map IP addresses in bash prompt</title>
      <link>https://sandrocirulli.net/how-to-map-ip-addresses-in-bash-prompt/</link>
      <pubDate>Wed, 30 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-map-ip-addresses-in-bash-prompt/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/ipv4_address.svg&#34;&#xA;    alt=&#34;A diagram of an IP address (IPv4)&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://commons.wikimedia.org/wiki/File:Ipv4_address.svg#/media/File:Ipv4_address.svg&#34;&gt;Image: Indeterminate - Public Domain via Commons&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;I regularly log into different Linux machines on the cloud and find complicated to identify on which machine I am by looking at the bash prompt. In fact, in cloud environments the bash prompt tends to  show an ugly internal IP address which I can never memorize. Plus, I always fear to log into the production environment by mistake and run experimental commands intended to be executed in the development environment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to transfer files to a remote server</title>
      <link>https://sandrocirulli.net/how-to-transfer-files-to-a-remote-server/</link>
      <pubDate>Sun, 20 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-transfer-files-to-a-remote-server/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/rsync_logo.png&#34;&#xA;    alt=&#34;rsync logo&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;http://rsync.samba.org/&#34;&gt;Image: rsync - Fair use license&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;While using cloud services like AWS it sometimes occurs to transfer files from a local machine to a remote server which is only accessible via SSH keys. Linux utilities like &lt;a href=&#34;http://rsync.samba.org/&#34;&gt;rsync&lt;/a&gt; and &lt;a href=&#34;https://en.wikipedia.org/wiki/Secure_copy&#34;&gt;scp&lt;/a&gt; come to rescue in this case. Here is an example of how to transfer files via rsync.&lt;/p&gt;&#xA;&lt;p&gt;First, make sure that the destination folder on the remote server is writeable. If not, log into the remote server and change the permissions, e.g.:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install and update KeePass</title>
      <link>https://sandrocirulli.net/how-to-install-and-update-keepass/</link>
      <pubDate>Mon, 03 Aug 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-install-and-update-keepass/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/keepass_logo.svg&#34;&#xA;    alt=&#34;KeePass logo&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://commons.wikimedia.org/wiki/File:KeePass_Logo_%282016%29.svg&#34;&gt;Image: Christopher Bolin (original), Minoa (vectorisation), GPL License&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&#34;http://keepass.info/&#34;&gt;KeePass&lt;/a&gt; is one of my favourite software. It is a password manager which allows to store secure passwords and forget about them. All you need to do is to remember one single (strong) password to open the software and that’s it. Considering the amount of passwords one has to remember these days, there is a bad tendency to use weak memorable passwords – or even worse always the same password! KeePass is good choice since it is cross-platform, uses strong encryption algorithms, and can store data offline.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install Groovy on Linux system-wide</title>
      <link>https://sandrocirulli.net/how-to-install-groovy-on-linux-system-wide/</link>
      <pubDate>Sun, 24 May 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-install-groovy-on-linux-system-wide/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/groovy-logo.svg&#34;&#xA;    alt=&#34;Groovy logo&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://www.apache.org/logos/#groovy&#34;&gt;Image: Groovy Logo, The Apache Software Foundation, Apache License 2.0&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;A colleague of mine recently asked me to install the &lt;a href=&#34;http://www.groovy-lang.org/&#34;&gt;Groovy programming language&lt;/a&gt; on our Red Hat 6.5 server and to make it accessible to all users. I thought it would be a very straightforward task but a quick search on the Red Hat 6.5 official repositories didn’t return any package for Groovy.&lt;/p&gt;&#xA;&lt;p&gt;The easiest way to install Groovy manually is via &lt;a href=&#34;http://sdkman.io/&#34;&gt;sdkman&lt;/a&gt;. I followed this  procedure to do it:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to change timezone on a Linux server</title>
      <link>https://sandrocirulli.net/how-to-change-timezone-on-a-linux-server/</link>
      <pubDate>Sun, 17 May 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-change-timezone-on-a-linux-server/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/entering_a_new_timezone.jpg&#34;&#xA;    alt=&#34;You are entering a different time zone&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://www.flickr.com/photos/64712052@N00/1411021691/in/photolist-mL8ypK-39FRAc-4rF1Wy-cCA4kd-7r6Ljp-7raEvU-mLTYN7-7UBt5x-4LU4E6-61Z4h-HSG3L-5bvHLY-dCwWpp-4LYdZY-9wcT2U-7GRz4i-8KL9bL-8AGgW2-7iXkAb-4hjnsP-7iTtLk-7iXmcL-4wpJey-7raAR1-cB7D3A-cRAL2G-8KL9Ff-5VR683-7TGug1-4QGAB7-n9aWfo-5HoDni-n999gH-cBQSKW-6dJTch-4vUGSR-9V5bTv-2ZH99H-7r6Ddv-fr7hpw-6Tnde-EPEyc-cB8vQQ-7r6K3z-7raFMb-dXMhUj-7fK6NK-2pxZsn-7raBkY-7r6Hic&#34;&gt;Image: deckhand – CC BY-NC-ND 2.0&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Every year in March and in October the clock changes in most countries for energy saving purposes. This has the annoying effect of messing up the current time on your server if the timezone is not set properly. Servers in Europe are often set up to UTC time. For example my web hosting provider explicitly says:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note that any times specified are executed in the timezone of the server, and not your local timezone. Accordingly, you may need to make allowance for this when selecting when to run your cron job. Our servers run in the ‘UTC’ timezone because our client base is global, and it remains constant throughout the year with no changes for daylight saving.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to add a new user with sudo rights</title>
      <link>https://sandrocirulli.net/how-to-add-a-new-user-with-sudo-rights/</link>
      <pubDate>Sat, 16 May 2015 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-add-a-new-user-with-sudo-rights/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/sudo_make_me_a_sandwich.png&#34;&#xA;    alt=&#34;sudo make me a sandwich&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://xkcd.com/149/&#34;&gt;Image: xkcd – CC BY-NC 2.5&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Let’s say you have a new user needing &lt;a href=&#34;http://en.wikipedia.org/wiki/Sudo&#34;&gt;sudo&lt;/a&gt; access to a Linux server. How do you grant him/her this great privilege? First, explain to the new user that sudo rights allow to do pretty much anything on a Linux machine – including screwing everything up! – and that with greater power also comes  greater responsibilities. Then, follow this procedure:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new user (e.g. newusername) and add it to group wheel (members of this group have sudo rights):&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo useradd -G wheel newusername&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Set up the password for the new user. First, login as root:&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo -i&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;Then set the password for the new user (e.g. newusername):&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;passwd newusername&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;Finally exit from root with:&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;exit&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Test the newly created user and password by logging in as user newusername:&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;su - newusername&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Test that the newly created user is in group wheel:&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;groups newusername&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
  </channel>
</rss>
