firewalld – managing firewall from command line

In some ways, firewalld on systemd systems is easier to manage and configure than iptables.

Managing Firewalld and Configuring Rules

Now that we have firewalld running, we can get down to set the configuration. We can open ports, allow services, whitelist IPs for access, and more. In all of these examples, we include the –permanent flag. This is important to make sure a rule is saved even after you restart firewalld, or reboot the server. Once you’re done adding new rules, you need to reload the firewall to make the new rules active.

Add a Port for TCP or UDP

You do have to specify TCP or UDP and to open a port for both. You will need to add rules for each protocol.

Read More

How to install qbittorrent-nox [Note]

qBittorrent is a free, open-source, fast and lightweight P2P BitTorrent client written in C++ / Qt, available for Linux, FreeBSD, MacOS and Windows. qbittorrent-nox – bittorrent client based on libtorrent-rasterbar (without X support). I try to install on my Raspberry PI.

qBittorrent is included in the default Ubuntu software repository. You can easily install it by running the following command in a terminal window:

sudo apt install qbittorrent-nox
Read More

Install Samba on Raspberry PI

Samba is available in Raspbian’s standard software repositories. We’re going to update our repository index, make sure our operating system is fully updated, and install Samba using apt-get. Open a Terminal and type:

sudo apt update
sudo apt upgrade
sudo apt install samba samba-common-bin
Read More

Raspberry Pi Media Server – MiniDLNA

Before post, I wrote to you about how I tried to install Gerbera on a Raspberry pi. Now let’s try to install minidlna. Let’s do it.

First, I recommend updating and upgrading your raspberry pi. You can do this by using the following commands:

sudo apt update 
sudo apt upgrade

Once this is finished we can install the media server software. Use the next command to do this.

sudo apt install minidlna
Read More

Postfix – subject, from and to log

This is a little trick for Postfix, it lets you log the subject, from and to of all the emails postfix sends (or which pass through it if you run it as a relay). It comes in handy when you need to debug an email issue and need to confirm your mailserver has sent the message.

First create the file /etc/postfix/header_checks and insert this into it:

/^subject:/      WARN
/^to:/           WARN
/^from:/         WARN
/^Subject:/      WARN
/^To:/           WARN
/^From:/         WARN
Read More

Shell script for volume control

The base of the Linux sound software stack is formed by ALSA, the Advanced Linux Sound Architecture, with these days normally a midlevel layer on top in the form of Pulseaudio; you can arrange for volume adjustment at both levels; should preferably do so at the Pulseaudio one.

Pulseaudio makes available the pactl tool, which you can use in the form of, say,

pactl set-sink-volume 0 0
pactl set-sink-volume 0 50%
pactl set-sink-volume 0 +10%
pactl set-sink-volume 0 -10%

In Mint 17.3 pactl has a bug that necessitates writing that last example as pactl -- set-sink-volume 0 -10% instead; would not know if the Mint 18 version still has the issue; see https://bugs.freedesktop.org/show_bug.cgi?id=77108. The first 0 in those commands specifies the sink, the sound card, and is automatically correct if you have only one card installed. Otherwise decide which sink to use from the output of pactl list sinks. Use man pactl for further information.

At the ALSA level you have available the amixer command line mixer. For example,

amixer set Master 0
amixer set Master 50%
amixer set Master 10%+
amixer set Master 10%-

In this, not specifying a card number with -c <number> means card 0; if not, use aplay -l to identify the number. “Master” is the name of a generally available control; you can list available controls with amixer scontrols and learn more from man amixer.

If you are not specifying correct sink for pactl or card/device/control for amixer please see your outputs of pactl list sinks and aplay -l.

Notepad++ on Linux

Notepad++ is one of the popular code editors and the fact that most of the users run Windows, it is available for Windows only. Some Linux users have surely missed it. Good news is that Notepad++ is now (unofficially) available as a Snap package for Linux user. Though this Notepad++ Linux application is not natively developed for Linux platform and actually runs on Wine, it’s now a command (or click) away for you.

Read More