systemd – start service when you enable it

2017-03-13 1 min read Fedora

More often than not for any service, I end up doing :

systemctl enable <service>
systemctl start <service>

But there is shorcut to this. In systemctl command when you enable the service, you can use “–now” to start the service as follows:

systemctl enable --now <service>

quite a timesaver 🙂

Linux Best Practices and Tips

2017-03-06 26 min read GuestPost Uncategorized

Linux is powerful, flexible, and can be adapted to a broad range of uses. While best practices for administrating Linux servers are not hard to find due the popularity of the operating system, there is always a need for up-to-date Linux advice, along with the best tips, from our experienced Toptal Linux administrators.

How to Avoid Frustration After Forgetting To Use Sudo Command

<p>
  Have you ever typed a command in your terminal, only to find out you forgot to prefix it with the
</p>

<div class="codecolorer-container text solarized-light" style="overflow:auto;white-space:nowrap;width:550px;">
  <table cellspacing="0" cellpadding="0">
    <tr>
      <td class="line-numbers">
        <div>
          1<br />
        </div>
      </td>
      
      <td>
        <div class="text codecolorer">
          sudo
        </div>
      </td>
    </tr>
  </table>
</div>

<p>
  command? You have to retype the whole command again just to add the
</p>

<div class="codecolorer-container text solarized-light" style="overflow:auto;white-space:nowrap;width:550px;">
  <table cellspacing="0" cellpadding="0">
    <tr>
      <td class="line-numbers">
        <div>
          1<br />
        </div>
      </td>
      
      <td>
        <div class="text codecolorer">
          sudo
        </div>
      </td>
    </tr>
  </table>
</div>

<p>
  in front of it. Frustrating!
</p>

<p>
  Well, you can add this simple alias to your
</p>

<div class="codecolorer-container text solarized-light" style="overflow:auto;white-space:nowrap;width:550px;">
  <table cellspacing="0" cellpadding="0">
    <tr>
      <td class="line-numbers">
        <div>
          1<br />
        </div>
      </td>
      
      <td>
        <div class="text codecolorer">
          .bashrc
        </div>
      </td>
    </tr>
  </table>
</div>

<p>
  to help you reduce the frustration:
</p>

<pre>
  <td>
    <div class="text codecolorer">
      alias argh='sudo $(history -p \!\!)'
    </div>
  </td>
</tr>
1

Continue reading

bash ansi codes to html for html reports from shell script

2017-02-20 1 min read Bash

How many times you have felt that there was some simple way to convert bash ansi escape sequences ( colors as well in terminal ) to html equivalent so that you can send the same as html report in email. Here is simple solution. One way is to use ccze if you are using this for logs – colorize your logs and for more generic solution.

 

dnf install python3-ansi2html.noarch

after this is installed, you can use something like this:

Continue reading

Get kernel function name from kernel address.

2017-02-13 1 min read Learning

If you are using pmap or using strace and want to covert kernel address to function name then you can use the following technique.

 

First you need to install elfutils, if not installed.

dnf install elfutils

and after this you can use the following command

 

eu-addr2line -f -e /boot/vmlinuz-$(uname -r) <addr>
#Example
eu-addr2line -f -e /boot/vmlinuz-$(uname -r) 00007f36a8045000

Separation Anxiety: A Tutorial for Isolating Your System with Linux Namespaces

2017-02-06 18 min read GuestPost Linux Vurtualization

With the advent of tools like Docker, Linux Containers, and others, it has become super easy to isolate Linux processes into their own little system environments. This makes it possible to run a whole range of applications on a single real Linux machine and ensure no two of them can interfere with each other, without having to resort to using virtual machines. These tools have been a huge boon to PaaS providers. But what exactly happens under the hood?

Continue reading
Older posts Newer posts