Linux Best Practices and Tips
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>
|
1
|
Kernel dropped packet analysis
Found a simple method to check for all the packets dropped by kernel.
First you need to install dropwatch with
dnf install dropwatch
and details of the package
- Name : dropwatch
- Arch : x86_64
- Epoch : 0
- Version : 1.4
- Release : 13.fc24
- Size : 27 k
- Repo : fedora
- Summary : Kernel dropped packet monitor
- URL : http://fedorahosted.org/dropwatch
- License : GPLv2+
- Description : dropwatch is an utility to interface to the kernel to monitor for dropped
- network packets.
Continue reading
bash ansi codes to html for html reports from shell script
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 readingGet kernel function name from kernel address.
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
Mehandi
Separation Anxiety: A Tutorial for Isolating Your System with Linux Namespaces
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 readingMerry together