Category: Linux

Linux Tips and tricks, either for desktop or internal system.

Linux

Adding a new SSD to already Mega LSI RAID controller

I had asked Hetzner for the installation of an extra SSD(‘960 GB SATA SSD Datacenter Edition’) to an already existing RAID 1 array which is where the system is installed in a dedicated Linux server. All I want is to be able to access the drive separately from the already existing RAID drives. I got …

Docker, Linux, Security

Docker Firewall script for DOCKER-USER iptables Chain

Description: Since we can’t protect docker advertised ports on docker using a normal firewall like UFW against attacks from Internet, a script has been written to do just that. Reading the comments in the script does gives an idea of how it works. The only thing to do is to fill in the variables in …

Linux

Installing SNMP in Ubuntu 18.04

Here are the simple steps to install SNMP in Ubuntu 18.04 Reference: https://support.auvik.com/hc/en-us/articles/204221884-How-to-enable-SNMP-on-Linux-based-servers-workstations Next, using your text editor, edit /etc/snmp/snmpd.conf to look like this: # this will make snmpd listen on all interfaces # Or make it listen only to the local private network interface eg. eth0(192.168.100.3) # a read only community ‘local’ and the …

Linux, Linux on MACBook, Uncategorized

Linux Mint 19.3 disabling the menu pop on Mac ‘Left Command’ Press

Introduction: After having installed Linux Mint 19.3 on an old MacBook Pro, I wanted to disable the Menu pop-up function on the ‘Left Command’ key press. Solution: Delete the following entry in the Settings Editor(in the settings menu): xfce4-keyboard-shortcuts –>> /commands/custom/Super_L | xfce4-popup-wiskermenu Calveat: First I could not delete the command. Then I simply deleted …

Linux, Linux on MACBook

Linux Mint 19.3 on MacBook Pro: Set F1-F12 as default function without pressing ‘Fn’

Inroduction: After having installed Linux Mint 19.3 on an old MacBook Pro I wanted to be able to use the function keys without having to press on the ‘Fn’ key Here is the answer: Reference: https://www.reddit.com/r/linuxmint/comments/4cecsz/set_f1f12_as_default_function_without_pressing_fn/ Solution: You can run a simple command to change the behavior. Therefore to get what I wanted the command …

Linux, Windows

Using Postfix to deliver mail using SMTP Authentication

Reference: https://www.linode.com/docs/email/postfix/postfix-smtp-debian7/ Open or create the /etc/postfix/sasl_passwd file, using your favorite text editor: Add your destination (SMTP Host), username, and password in the following format: If you want to specify a non-default TCP Port (such as 587), then use the following format: Create the hash db file for Postfix by running the postmap command: If …

Linux

APT ‘Not Found [IP: 2001:67c:1562::15’

Reference: https://ubuntuforums.org/showthread.php?t=2282646 If you encounter such errors of fetching packages with apt/apt-get: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-release-upgrader/python3-distupgrade_18.04.36_all.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-release-upgrader/ubuntu-release-upgrader-core_18.04.36_all.deb 404 Not Found [IP: 91.189.88.142 80] E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing? Then do the following to give precedence …

Linux, Security

Using UFW as IP Blacklist

Introduction: There are instances where a service provider is taking care of the Firewall which is working between Internet and the rented server. In this case only certain standard ports will be made available to access the rented server. But what if you need a general use ‘blacklist’ firewall that will filter out abusive traffic …

Linux, Systemd

GRUB on EUFI capable System

Introduction:New PCs are often equipped of the UEFI(Universal EFI) capable booting. Some SSD drives will even not boot in Linux the Legacy MBR mode. So in order to make the PC boot properly we need to:– Create an EFI Partition– Install GRUB(Boot loader) on it Create the EFI Partition:Create an EFI capable Boot partition of …

Email, Linux, Mailman

Minimize the Digests shown Headers in Mailman 2.1.xx

Problem: Digests in Mailman are composed of a lots of unneeded headers which clutter the messages. Solution: Edit the Mailman configuration file manually as follows: WARNING !!!: These headers are part of a the ‘RFC 1153’ which if changed can have unpredictable or unwanted effects. So here I kept the headers: Date:, From:, Subject:, Keywords(if …

Email, Linux, Postfix

Configuring Domain Relaying with ISPConfig 3.1.xx

Intention: Redirect (reroute) specific email addresses via, for example, an SMTP service: Steps: – Enter the destination domain in the Advanced Routing Table (Email ==> Email Accounts/Email Routing) – Enter the same destination domain in the (Email ==> Global Filters / Relay Recipients) as @domain Example: eg. rerouting all emails of destination domain mydomain.com via …

Email, Linux, Postfix

No Type list in ISPConfig 3.1.11

Problem: The brand new version of ISPConfig 3.1.11 when I add or modify an email transport, no value is displayed anymore on “type”. Solution: Ref: https://git.ispconfig.org/ispconfig/ispconfig3/issues/4924 Edit /usr/local/ispconfig/interface/web/mail/mail_transport_edit.php Change this line: $app->tpl->setVar($rec, null, true); to this: $app->tpl->setVar($rec); and should work again.

Linux, MySQL, Security

Resetting MySQL/MariaDB root password in Ubuntu 16.04

Introduction: In case you have forgotten the ‘root’ password in MySQL/MariaDB(10.0.x) you can reset the password as follows: Ref: https://kofler.info/root-login-problem-mit-mariadb/ STEPS: Stop the currently running MySQL/MariaDB service mysql stop Start MySQL/MariaDB in non-protected mode: mysqld_safe –skip-grant-tables –skip-networking & Login as root in MySQL/MariaDB mysql -u root Set the new root password: update mysql.user set password=password(‘new-root-password-here’) …

Apache, Linux, Wordpress

Installing the missing mcrypt module for PHP 7.2

Inroduction: Because of the module mcrypt for PHP neot being maintained since a bout 10 years the PHP team has decided to drop it from the PHP version 7.2 on. For PHP applications that need this module here are the instructions to compile and install it for PHP 7.2. Reference: https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ STEPS: We need to …

Email, Mailman

Changing the mailman subscribers ‘moderation’ bit on the command line

Intro: In my mailman installation with over 3K subscribers I could not find why the web interface didn’t allow me to change the ‘moderation’ bit of subscribers, or any other property. So I found this tool which allows me to the ‘moderation’ bit for any subscriber using the command line. Sinc ethe Python module for …

Apache, Linux, NGinX, Postfix, Security

Install CERTBOT in Ubuntu-16-04-xenial and Debian Stretch

Intro: Here is a 1-to-1 copy of the article on how to install certbot in Ubuntu 16.04 and Debian Stretch Ubuntu 16.04 HOWTO: Install On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you’ll need to do is apt-get the following packages. $ sudo apt-get …

Apache, Linux, Security

Configuring Letsencrypt in ISPConfig 3.1

Intro: Since a while now the wonderful idea of creating the service Letsencrypt has made lots of admins happy. Here is how we can also use Letsencrypt with ISPConfig 3.1. Ref: https://www.howtoforge.com/community/threads/ssl-how-to-for-ispconfig-3-with-letsencrypt.74738/ STEPS: Define ISPconfig to use the new SSL certificate with symbolic links. (If you don’t know how to use symbolic links this how-to …

Email, Linux

Rectify mailman URLs after a hostname change

Intro: I had to change the server name of my mailman server. I changed it in /etc/mailman/mm_cfg.py as follows: # Default domain for email addresses of newly created MLs DEFAULT_EMAIL_HOST = ‘mailman.myserver.com’ #————————————————————- # Default host for web interface of newly created MLs DEFAULT_URL_HOST = ‘mailman.myserver.com’ BUT! Some links in the mailman site were OK …

Linux, Security

Blocking hosts blacklist and iptables

Intro: I happen to have sone attacks coming from specific hosts which I decided to block access to the server. Here is how I did it using a script which deletes and reload a full iptables CHAIN based on a file containing a list of IPs/Ranges. STEPS: Create a file called blacklist.txt with one IP/Range …