Author: admin

Linux, Postfix

Relaying emails dependent on either sender or receiver

Introduction: I use a Relay SMTP service for sending my emails but I want to use it only for certain conditions like the sender address or the receiver address. Here is how it’s done: Relay to relay host depending on sender address Add in /etc/postfix/main.cf Create file /etc/postfix/relayhost_map and add this content: Run the following …

Linux

Creating SOCKS Web Proxy using SSH

Introduction: It is known that one can use SSH to create a Tunnel but SSH has more tricks in its sleeves. It can be used to create a SOCKS based Web proxy. The full explanation is really clearly shown in this article: Thanks to the author for that. https://ma.ttias.be/socks-proxy-linux-ssh-bypass-content-filters/ Basics: Prerequisites: A Linux server in …

Linux

Setting up networking on Ubuntu 18.04 for Xen Hypervisor

Introduction: For a long time I have been using ifconfig and /etc/network/interfaces and tools to setup the network of Ubuntu servers. After I have installed a brand new Ubuntu 18.04 I could not use that tool any more, at least without making some system changes. So I finally decided to adapt and see what I …

Apache, Linux, Uncategorized

Configuring Apache for Magento to show different Store Views in from different URLs/Domains.

Introduction: In the following example I try to set environment variables according to the incoming request’s ‘HTTP_HOST’ value. The following example pertains to Magento Webshop software which offers a different Store view for every domain configured to land in the main store. Prerequisites: – Magento is been configured, apart from its default Store View, to …

Linux, MySQL

Repairing MySQL InnoDB databases

Introduction: This post is a copy of the wonderful following post: https://blackbird.si/mysql-corrupted-innodb-tables-recovery-step-by-step-guide/https://blackbird.si/mysql-corrupted-innodb-tables-recovery-step-by-step-guide/ Here are some important exerts from it: MySQL – Corrupted InnoDB tables recovery – Step by step guide Posted in Databases By Alen Krmelj On March 19, 2013, 5-6 minutes InnoDB tables don’t get corrupted easily, but when they do, it usually happens …

Bash, Linux

Listing all email addresses in a file with grep

The following grep command will list all email addresses from a text file and sort them per names without allowing for repetition(-u unique) The following grep command will list all email addresses from a text file and sort them per domain without allowing for repetition(-u unique)

MAC OS X

Creating an Install USB for OS X Mojave

Introduction: Theses procedures are for creating a SUB Stick to install Mac OS X Mojave completely fresh(Not meant for upgrades) Prerequisites: Make sure you have an empty min. 8GB USB Stick available. This USB Stick will be completely erased and filled with the Mac OS X Mojave installation software. Steps: Get the Mac OS X …

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 …

Uncategorized

Turn OFF/ON Mac Synaptic Trackpad in Linux Mint 19.3

If you are annoyed by the accidental touch on the MacBook (Pro) Touchpad and want to turn it off here is what you can do: Create 2 launchers on your desktop which when double clicked turns the Trackpad ON or OFF. Here are the commands: First you need to make sure the following package is …

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 …

Uncategorized

Adding a title to SSH login terminal TAB

Introduction: Reference: https://unix.stackexchange.com/questions/177572/how-to-rename-terminal-tab-title-in-gnome-terminal Each terminal emulator has its own way of configuring a TAB title name for an SSH connection. To make sure it works for all well behaving terminal emulators, you can force the Title via an escape sequence set in the destination server. Howto: Login to a server via SSH and ad one …

Uncategorized

Bypass the Docker –iptables limitations

Introduction: By default Docker daemon(dockerd) starts in an ‘open’ mode where all the advertised ports from docker are open for access from internet NO MATTER if the Linux system has a firewall that limits the access. That is because dockerd does give access to the ports at a lower level which ignored any firewall. In …

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 …

Uncategorized

Create a simple and general access Samba share

apt-get install samba smbclient cifs-utils heimdal-clients mcedit /etc/samba/smb.conf Here we will create one share as read only from guests users and one share as read/write for a specific user Create read only Share [Photos] comment = “Family Photos” path = /media/NextCloud/Photos browseable = yes read only = yes guest ok = yes Create the read/Write …

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 …