How to list external or internal IP addresses
List external or internal IP addresses.
List external or internal IP addresses.
Group interface names by network card.
Update machine membership in a domain.
Unlock Google Chrome profile.
List network interfaces with IP and MAC addresses.
Check for newly connected disk device.
Determine when system was installed.
Retrieve MAC addresses of network interfaces.
Display kernel release information.
Install packages non-interactively using apt-get utility.
Securely edit configuration files as specific user.
Follow data appended to a file using one of the two possible approaches.
Prepare Microsoft Windows® USB installation media on Linux using WoeUSB.
Insert control characters inside a text terminal to enhance your personal notes or improve shell one-liners.
Ensure that OpenSSH client uses explicitly configured authentication identity even if authentication agent offers more identities.
Use Filebeat to deal with many small log files.
Trace packets as they pass through the iptables firewall.
Today, I will show you my personal shell prompt, so you could define your own custom bash prompt.
Execute rc.local shell script during boot using systemd compatibility generator.
Perform shell script analysis using shellcheck, a shell script static analysis tool.
Format and beautify Nginx configuration using dedicated utilities like nginx-config-formatter, nginxbeautifier, and crossplane.
The simplest possible solution to display bind mounts.
I have already described how to accurately determine when the system was booted, but there is a simpler solution as you can use /proc filesystem directly.
The short story of my experience with container is marked for removal and cannot be started error which was caused by driver "overlay" failed to remove root filesystem for ...: remove /var/lib/docker/overlay/.../merged: device or resource busy.
Extract a specific file from a tar archive.
Increase the system-wide number of available file handles (open files).
Reboot Linux operating system during recovery when shell is executed instead of standard init process.
Limit bandwidth on specific network interface using wondershaper.
Determine SSL cipher suites supported by the web-server using OpenSSL.
Display details for specific OpenSSL cipher, only single one.
Change the number of reserved filesystem blocks.
Create simple shell script to pretty-print OpenSSL ciphers.
Inspect OpenSSH client configuration to search and display configured hosts.
Merge multi-process HAProxy statistics using GNU Awk. This is a duct tape solution, as you should definitely use Lua.
Merge multi-process HAProxy statistics using Lua.
Graylog will generate a warning to inform you that socket receive buffer size (SO_RCVBUF) should be increased.
Expand an existing XFS filesystem on LVM Logical Volume.
Disable onboard WiFi and Bluetooth on Raspberry Pi 3 device.
Download Raspbian image and write it to the SD card using as few commands as possible.
Configure and enable command-line tab completion for known SSH hosts to ease day-to-day operations. You do not need to configure or enable this on Debian-based distributions, but it is good to know how to do this as you will never know when it will come in handy. This article is an extension of adding the SSH menu to the Unity launcher blog post.
Today, I will share a simple way to print an IP address assigned to the specified interface.
Display established connections broken down by a host.
Identify and print processes using swap space to get a better understanding of the Linux operating system.
I have spent countless hours playing role-playing video games. Recently, I bought Icewind Dale: Enhanced Edition for Linux. It is still a great experience, but I have to admit that I have gone to the dark side and modified the save file. Just think of it as a programming exercise.
I wrote a simple application to explain the current UMASK value. It was a while ago, but I want to share it with you as it is quite a useful utility.
It was almost three years ago when I wrote about manual pages. Moving forward, I want to share a simple and useful shell script to search through manual pages.
I have experienced a lot of trouble with Bluetooth sound synchronization. Most of the time, this issue was especially evident while watching movies. Fortunately, the solution is within easy reach.
It is nothing fancy, but there are situations where it is beneficial to know how to identify and inspect command before execution.
It is easy to get names of distinct Debian releases as you can always examine these on the Debian Releases web page. I will do something more interesting and demonstrate how to do that using a simple shell script.
This brief outline explains how to locate specific file within Debian packages using very useful apt-file utility which as opposed to dpkg-query does not only inspect installed packages since it utilizes fetched lists of the contents of packages.
Today, I want to share my personal list of hand-picked Linux related magazines, which I am reading every month to keep up with relevant Linux news and best-practice techniques, so I strongly encourage to check out these magazines to benefit from insights of the most experienced journalists in the business.
Some time ago, I have recovered an old hard drive only to learn that it contained encrypted LVM logical volume.
A long time ago, I wrote several blog posts which related to Ubiquiti devices, especially monitoring using Cacti rrdtool-based graphing solution. These are probably obsolete now, but someone has pursued this idea further…
I have created a simple shell script to convert manual pages to DokuWiki as I want to have them always at hand and easily interlink to them from other pages.
Today I want to mention a simple and neat trick described in the kill manual page, which will allow you to quickly kill every eligible process.
I wrote a simple shell script to pretty-print disk space used by PostgreSQL databases while examining database object size functions. You can benefit from this too by inspecting used SQL statements.
It is easy to use the uptime command, but a custom shell script is definitely a more interesting solution as it provides more detailed information.
Tig is an ncurses-based text-mode interface for git that uses Vim keybindings.
The easiest way to sync files with Google Drive is to use insync client which provides seamless user experience, customer support and enhanced functionality.
I was using licensed version of Sublime Text editor to write articles available here, but a couple of days ago I switched to Atom customizable text editor.
At first I wanted to write a blog post about how to stay anonymous by using a privacy-enhanced OS, but changed my mind during the research process as I couldn’t pass by other highly useful solutions.
Today, I will show you how to create a simple shell script to read and print interface statistics on the Cisco Catalyst switch using the SNMP protocol.
Do you want to find out how to perform everyday activities using Linux operating system? Learn about commonly used applications and utilities? Then register to take Introduction to Linux course created by The Linux Foundation. It will take anywhere from 40 to 60 hours to complete the course and accustom yourself to Linux.
Learning programming may seem like an impossible feat, that being said however, with the right resources and information just about anyone can learn the most essential language that is used today.
Although it is getting warmer and warmer, I have found some time to explore Linux-related podcasts and hand-picked thirteen interesting podcasts so everyone will find something that pleases their ears and engages their mind.
Most people use their computers without thinking about the operating system, the software that manages everything from your files to your applications. While Windows and macOS dominate desktop computers, there’s another family of operating systems that powers much of the modern internet: Linux.
There are two ways to non-interactively provide a password for the psql command (PostgreSQL interactive terminal). Each method allows you to quickly write shell scripts using terminal-based PostgreSQL utilities as you can provide user credentials from the password file or environment variables.
Seven days ago I have published a shell script to highlight text in the terminal using sed or ssed. Today I want to extend the idea and colorize specified strings or simple regular expressions using just bash, getopts and ssed respectively.
I have been working on a simple shell script to highlight text in the terminal for the last hour. At first, I looked at it from the wrong angle, but after a short break, I finally realized the simplest possible solution.
You have probably already noticed my favorite way to overcome the sudo redirection issue, but if you haven’t, then I will write it down here for further reference.
Today I will shortly describe how to set up Raspberry Pi as a tiny NAS server. I am using one at home daily, and it is a handy appliance.
If you ever wanted to create bootable recovery USB Flash Drive then I have good news for you as it can be achieved in several simple steps using Clonezilla Live CD, external USB Hard Drive, and a target USB Flash Drive.
Today I went almost crazy because of automatic mounting and opening of the removable storage devices, fortunately this behavior can be quickly changed by the use of thunar-volman-settings command.
At the beginning of the last year, I wrote about VirtualBox image conversion. Today, I will continue this topic further and describe how to control the virtual machine using the command line.
Brief description of the Kolab Groupware integration with Dokuwiki.
Brief description of the Kolab Groupware integration with Tiny Tiny RSS.
A quite lengthy but very straightforward description of the Kolab Groupware integration with Piwik Web Analytics. The integration process is simpler than you think as the additional application (Piwik) is hosted externally and doesn’t use a single sign-on.
Yesterday I added a few mail aliases using Kolab admin interface and went to sleep. Today I noticed high CPU usage and quickly found that there is a small problem with pykolab 0.5.11-5 package.
I am mainly using the Polish language so it is obvious that fairly quickly I encountered a problem with national characters in the subject line. The problem is not fixed in Debian packages (using Debian Wheezy x86_64 and Kolab Systems – Public Repositories) but luckily it is very easy to fix.
A couple of days ago, I mentioned calculating the sunrise and sunset times. This is an interesting problem, so after reading Astronomy Answers – Position of the Sun, I quickly implemented it using the C language. It is only an experiment, so results are approximate.
I was wondering how to calculate Julian Day Number as I will need it to determine the sunrise and sunset times. Algorithms are extensively described so I will just point you to the two most useful pages – Julian day/Wikipedia and Julian Day Numbers/UT.
As a small experiment, I wrote an elementary C program to display min and max values of the basic object types.
Last year I wrote a short article about how to set up SSH port forwarding but I forgot to mention that you can quickly terminate existing port forwardings and create new ones during the SSH connection.
Recently I was searching for a clean and simple web-based administration tool for a couple of small virtual servers so I decided to use Ajenti. It is a simple and easily extendable administration/monitoring utility using the Python language. Installation is very straightforward as there are packages available for the FreeBSD operating system and a couple of Linux distributions.
Recently I discovered console based task manager – devtodo. It is a very useful tool as you can easily use it over an SSH connection, create multiple different lists and combine them together. I will shortly describe devtodo utility available in Debian package repository but you need to know that you can use newer version – devtodo 2.
It is a very easy task as it requires only the use of the ncal command.
Last year I published the blog post Cacti – How to graph CCQ on Ubiquiti devices. Recently I updated ubiquiti_ccq.pl script, so it will work with all NanoBridge and PowerBridge devices.
A couple of months ago, I published a short script to backup MySQL databases. Today I created a simple shell script to backup selected directories.
Yesterday I experienced quite annoying “Couldn’t load plugin” error when I tried to play any video on YouTube. It started suddenly and I was very surprised by it.
I am not a native English speaker so I often use thesaurus when writing a blog post or just an email message. A long time ago I always used web-based solutions but since I found Artha – The Open Thesaurus I wouldn’t change it for anything else as it has handy and slick user interface, on the fly search, suggestions and hotkey lookup.
As you probably already know, the CCQ value is not available via SNMP (AirOS 5.5.2), but of course it doesn’t mean it can’t be graphed using Cacti. To graph CCQ on Ubiquiti devices, you just need to use a simple script to read the desired value using the web interface.
Recently I installed OpenWRT on Ubiquiti AirRouter as the original firmware is lacking in a couple of areas. Installation is easy and straightforward as all you need to do at the time of writing this post is to use Attitude Adjustment release.
Simple shell script to backup MySQL databases.
The easiest way to remove comments from a shell script is to use sed (stream editor for filtering and transforming text) command.
When you’re not sure when daylight saving time changes you can quickly check it using the zdump command which is available on every *nix system.
SSH port forwarding is a nice feature that allows you to create encrypted tunnels over an unsecured network. It is easy and straightforward to remember and use in daily work so I will describe it here with couple of examples.
PHP Warning: mktime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /var/www/... If you encounter a similar warning, then it means that you need to set default timezone used by all date/time functions.
For some reason unknown to me there is no reboot option in web-based user interface but it doesn’t mean that it cannot be done easily as you just need to use one specific URL parameter.
This is a very easy task as you only need a small Linux server and a GSM terminal or any phone supported by Gammu.
Recently I was playing with Growl notifications and I thought it would be a cool idea to see on the desktop notifications sent from my phone.
To change the data source name, you need to check its current value and then issue a single rrdtool command.
Signal strength on Mikrotik devices can be monitored by Cacti using SNMP protocol. It is straightforward if you have just a couple of those devices but you can be easily overwhelmed by dozens of data templates because the wireless card’s MAC address is part of the OID.
You cannot modify squashfs image directly but you can uncompress it, apply changes and compress it again.
Check the progress of the dd process.
VirtualBox command-line interface (VBoxManage) provides an easy way to convert the raw disk image to the VDI/VMDK format and otherwise.
Download mb2md.pl script and run as described in the manual. For example to convert /old/mbox to /new/maildir you can execute: # perl ./mb2md.pl -s /old/mbox -d /new/maildir Converting /old/mbox to maildir: /new/maildir Source Mbox is /old/mbox Target Maildir is /new/maildir Dummy mail system first message detected and not saved. 40 messages.
To use a physical hard disk in VirtualBox you need to create an image that will represent it.
Sometimes it is a good idea to check or just store contents of the virtual console terminal (/dev/vcs[1-63] device).
Use the following command when you want to leave terminal open but force sudo to forget password.
It is very annoying to see message “E212: Can’t open file for writing” when trying to save file. Hopefully there is a simple solution (a bit longer but without “W12 Warning“): :execute ':w !sudo tee % > /dev/null' | :edit! Look at commandlinefu.com for more solutions like :W command below: :command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
Add -a parameter to the ping command if you don’t look at console output, but want to hear that the host is reachable.
For this example I will use such a tree: . ├── dir1/ │ ├── dir6/ │ ├── dir7/ │ ├── dir8/ │ ├── file4 │ └── file5 ├── dir2/ │ └── dir9/ │ ├── dir10/ │ │ ├── file9 │ │ └── file10 │ ├── file6 │ ├── file7 │ └── file8 ├── dir3/ ├── dir4/ ├── dir5/ ├── file1 ├── file2 └── file3 List of all files and directories: $ find . | sort | grep -v ^.$ ./dir1 ./dir1/dir6 ./dir1/dir7 ./dir1/dir8 ./dir1/file4 ./dir1/file5 ./dir2 ./dir2/dir9 ./dir2/dir9/dir10 ./dir2/dir9/dir10/file9 ./dir2/dir9/dir10/file10 ./dir2/dir9/file6 ./dir2/dir9/file7 ./dir2/dir9/file8 ./dir3 ./dir4 ./dir5 ./file1 ./file2 ./file3 Number of all files and directories:
Recently I started using Redshift. It is a small application that changes the color temperature of your screen. It is a really good idea as eyes don’t get tired so quickly at night.
My ISP provides a dynamically assigned IP address using DHCP. This solution has a couple of drawbacks but it comes in handy if I need to change the IP address to overcome time limit restrictions on streaming services…
This simple script will create web thumbnail using cutycapt console command.
Store and stop processing specific log.
There are a couple of different ways to perform this task using shell date command depending on the OS used. I will concentrate on Ubuntu Linux, OpenBSD and FreeBSD.
It’s easy to miss something when you need to monitor a dozen logs on different servers and some other devices. Fortunately, there is a simple solution as you can use rsyslog with PostgreSQL or MySQL support to store all local and remote events on your network and then visualize results using LogAnalyzer.
Download root hint file.
Enable query logging in BIND.
Use sort utility to sort IP addresses.
Let’s say that we have one big file and want to split it into 10M parts.
Managing SPS switches could be real fun if you use expect to automate such tasks.
Sometimes I need to downscale video for a portable device.
Get rid of spaces in file/directory names.
Today I connected shiny new HP DeskJet K209a and as suspected everything works fine after I installed cups, hplip, and xsane.
Certificate could not be verified error.
I prefer to use a small netbook over a desktop PC for light web browsing at home. It’s very comfortable but I need something to filter out advertisements.
Perform HTTP compression test using curl utility.
Using KDE notification area within a shell script gives a lot of useful possibilities as you can easily display feedback from running services, other scripts, log analyzers.
Getting an SSL certificate from Gandi is a straightforward task.
A simple code snippet that can be used to pass client and proxy IP addresses.