Category: Linux

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

Apache, Linux, Wordpress

Customizing apache2-suexec-custom

Apache2 Suexec module comes with at least 2 flavors in many distributions of Linux. – apache2-suexec-pristine: Apache HTTP Server standard suexec program for mod_suexec – apache2-suexec-custom: Apache HTTP Server configurable suexec program for mod_suexec Many times when I’ve been trying to use the standard mod_suexec with mod_fcgi (useful for WordPress installations),the mod_suexec complains that the …

Bash, Linux

Finding the absolute path of a running script

In bash scripts we often need to know in which directory the running script is found especially when the script is in the $PATH and may be occurring in multiple places: Here is a reliable way to find it out: Based on this site: http://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself # Absolute path to this script. /home/user/bin/foo.sh SCRIPT=$(readlink -f $0) …

Apache, Linux, Security

Installing VSFTPD for FTP-SSL web sites upload on Ubuntu

In order to force an exclusive use of the SSL/TLS connectivity to users here is how to install it: Note: This tutorial was base from this site: https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-an-ubuntu-vps Install the vsftpd package sudo apt-get install vsftpd Edit the /etc/vsftpd.conf configuration file and add the following at the end of the file or alternatively adapt the …

GlusterFS, Linux

Installing GlusterFS 3.6 in Ubuntu 14.04 Server LTS

Note: In case you have an regular(3.0.5-1) version of GlusterFS to upgrade, it is recommended to run the following command in order to make sure the older version gets cleaned-up does not interfere with the new one. apt-get purge glusterfs-client glusterfs-server Depending on whether you have Debian or Ubuntu use one of the following installations: …

Linux, Wordpress

Install a multisite(WPMU) WordPress with wp_cli

Prerequisites: – Create a new fcgi driven user in Linux system(in this case usrblog) useradd -s /bin/bash -d /www/clients/mywpsite.com/htdocs/ usrblog passwd usrblog – Install a Virtual host which uses suexec and fcgi in Apache/NginX – Create a new database in MySQL (we will call it myblog) – Create a new mysql user and assign the …

Linux, MySQL

PAM-Mysql user authentication in Ubuntu 14.04 LTS Server

Introduction: As I was wanting to set-up a cluster of web servers based on Apache2 and fcgi I realized that I didn’t want to have to create/delete/update each individual fcgi user in each web server. Therefore I decided to authenticate the fcgi users through MySQL (in fact MariaDB). I’ve done that many years back but …

Linux

Usefull commands of LVM

Just to make sure I don#t forget where to find such useful set of commands for the LVM I copied it here integrally from: https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/LV_create.html 4.4.1. Creating Logical Volumes To create a logical volume, use the lvcreate command. You can create linear volumes, striped volumes, and mirrored volumes, as described in the following subsections. If …

Apache, Linux

Selectively blocking / redirecting HTTP requests per country of origin with Apache

If you need to block or redirect requests that are originated from certain countries, here is a good method using geoIP information. Install the GeoIP binaries and Apache module: apt-get install geoip-bin libgeoip1 libapache2-mod-geoip a2enmod geoip service apache2 restart Example of blocking requests from germby(DE) in a VirtualHost configuration: SetEnvIf GEOIP_COUNTRY_CODE DE BlockCountry Deny from …

Apache, Linux

phpmyadmin: The mcrypt extension is missing. Please check your PHP configuration.

This was the error message I got in PhpMyadmin in Ubuntu 14.04-2. The mcrypt extension is missing. Please check your PHP configuration. So I found the following solution in: http://askubuntu.com/questions/460837/mcrypt-extension-is-missing-in-14-04-server-for-mysql/477608#477608 First, I’m not really sure that this directory needs to be created, but since it’s in php.ini configuration, I’d rather make sure all will work …

Linux

Proxy Internet access via SSH tunnels and and tsocks

Description: I came across a situation where I needed to install software on a server that didn’t have internet access, except for the apt-get commands which are only reaching specific Internet addresses (allowed by the firewall). So in our network there is a Linux server that does have full Internet access. The idea here is …

Linux, NGinX, NGinX

Installing NginX 1.9.2 in Ubuntu server 14.04.2 LTS

Since the version of NginX in Ubuntu Server 14.04.2 is only 1.4.6, we need to tell APT to install the more recent version of nginx directly from the NginX maintainer. Steps: Add the following lines in /etc/apt/sources.lst deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx From your server download the signing key add it to …

Linux, Monitoring

Install TeamViewer in Debian Wheezy

Teamviewer is a very good and stable remote desktop with many clients software form almost any platform. Here I explain how I got TeamViewer to run on a headless Debian Wheezy server. Reference: https://www.teamviewer.com/en/help/363-Wie-installiere-ich-TeamViewer-auf-meiner-Linux-Distribution.aspx#multiarch Steps: – Install the VNC desktop on the Debian Server for a particular user as per the instructions shown here: https://tipstricks.itmatrix.eu/installing-linux-remote-terminal-using-vnc-on-a-debian-server/ …

Bash, Linux

Downloading tar.gz files from the Linux command line

Sometimes we need to download a file from Internet using the bash command line. here are some suggestions: Using WGET: wget {URL} eg. wget https://my.server.com/downloads/file.tar.gz Using CURL: (Fancy progress info given as the download progresses and will unpack it at the same time) curl -L –progress {URL} | tar xz eg. curl -L –progress https://my.server.com/downloads/file.tar.gz …

Linux, SVN

Undeleting a directory from SVN repository

Situation: A directory had been deleted a while ago from the repository and we want it back without interfering with commits that were since made in other parts of the repository, and without having to have the repository in the workspace. Reference: http://svnbook.red-bean.com/en/1.8/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo Solution: – Find out which revision of the commit it was that …

GIT, Linux

Installing GitLab (MySQL based) on Ubuntu 14.04.2 LTS Server

Note: Instructions based on but have been modified in a few places to make it work with mySQL: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md and https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md Extra related Info: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md https://www.linode.com/docs/applications/development/gitlab-on-ubuntu-14-04 and https://www.digitalocean.com/community/tutorials/how-to-set-up-gitlab-as-your-very-own-private-github-clone#database-setup STEPS adduser –disabled-login –gecos ‘GitLab’ git apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils …

Linux, Windows

Can’t connect to VSFTPD with Filezilla

Problem: Because of some incompatibility of the default use of cyphers in VSFTPD FileZilla cannot connect to it. Solution: Edit the VSFTPD configuration file /etc/vsftpd.conf and add the following directive: ssl_ciphers=HIGH Restart VSFTPD server and use the default settings for new FTP connection with incryption of ‘explicit FTP over TLS’.

Bash, Linux, VMWare, XEN

Extending dynamically Linux RAMs in VMWare VM without rebooting

Situation: Need to raise the amount of RAM in a VMWare VM without rebooting. Solution: – In VMWare interface: Raise the amount of RAM for the VM – In the Linux VM: Run the following script: #!/bin/bash # This script enables in system the unrecognized RAMs deleteline () { echo -ne $dellineup } ### check …

Bash, Linux

Copying all files including hidden files in Linux command

PROBLEM: If you use the command cp or mv on hidden files you will notice that the hidden files won’t get ‘seen’ and therefore not copied or moved. The problem doesn’t belong to cp or mv but to bash. Bash doesn’t include the hidden files in the globbing expansion. for example: mkdir ~/temp1 ~/temp2 touch …

Linux, Postfix

Anti-SPAM mail filtering using SPF on Debian Wheezy

Install the package: apt-get install postfix-policyd-spf-perl Add this line to /etc/postfix/main.cf: policy-spf_time_limit = 3600s Add the following lines to /etc/postfix/master.cf: policy-spf unix – n n – – spawn user=policyd-spf argv=/usr/sbin/postfix-policyd-spf-perl In /etc/postfix/main.cf, find the smtpd_recipient_restrictions section, and, immediately after permit_mynetworks (and permit_sasl_authenticated, if you’re using that), add: check_policy_service unix:private/policy-spf, Restart Postfix and check your logs …

Linux, NGinX, NGinX, Postfix

TCP Load balancing email/web servers with NginX

I’ve got 2 synchronized email servers running and, in order to make sure I don’t have to change the servername settings of my mail client in case one server goes down, I was looking for a straight TCP layer load balancer. There are a few software packages on the market that can do that , …

Apache, Linux, Monitoring, NGinX

Using CURL for sending crafted HTTP POST authenticated queries

CHALLENGE: I came across a situation where I needed to send an HTTP request using the POST method with some POST data but after I have authenticated with name and password. SOLUTION:(using curl tool) The trick here is to preserve the SESSIONID of the authenticated response for the second POST request. EXAMPLE: I needed to …

Linux, Linux on MACBook, MAC OS X

How to create a USB stick bootable on OS X

This article is based on the following How-to in Ubuntu site: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx We would encourage Mac users to download Ubuntu Desktop Edition by burning a CD. But if you prefer to use a USB stick, please follow the instructions below. Note: this procedure requires that you create an .img file from the .iso file you …

Linux, VMWare

Hard disk resize and sync without rebooting

Description: Sometimes I need to resize a virtual disk for a virtual machine without having to reboot the machine. For the kernel to recognize that a virtual disk has changed size. Here are the step to do that: Unmount the concerned partition: Eg. /dev/sdb1 umount /dev/sdb1 Find out which SCSI devices are involved: ls /sys/class/scsi_device/ …

Linux, XEN

Installing Xen 4.4 on Ubuntu Server 14.04 LTS (Trusty) in a Hetzner server with 8 IPs subnet

Hetzner Germany has very fast and not expensive rentals of Hardware servers available. In order to communicate internally via private network between Xen-DOMUs and DOM0, normally one would install Xen DOM0 network with bridge networking as follows: DOM0:xenbr0(eth0) ===bridging===>> DOMUs:eth0 BUT!!!! PROBLEM: Because of the configuration of the network switches at Hetzner, one hardware server …

Apache, Bash, Linux, Monitoring, NGinX

Monitoring latency time of http requests

Here is a simple but useful command which shows the latency time of http requests. You can adjust the delay between repeats as well as the URL being queried. Reference: http://www.shellhacks.com/en/Check-a-Website-Response-Time-from-the-Linux-Command-Line host=”www.google.de”; delay=5; while true ; do echo -n “Response time for http://$host:” ;curl -s -w %{time_total}\\n -o /dev/null http://$host ;sleep $delay; done Results: Response …

Linux

Wandisco SVN(Subversion) installation on Debian Wheezy

To my experience, compiling the latest Subversion from Collab site is quite some work. As an alternative to this, Wandisco site offers for free the (almost)-newest version of subversion package for Debian. It’s already compiled, tested and ready for production. Since Debian Wheezy doesn’t quite have the proper versions of packages necessary to install these …

Linux

Install Adaptec ACC-RAID utility – arcconf – in Ubuntu 14.04

In order to be able to control the Apaptec AACRAID Raid controller in Ubuntu one need to install the program arcconf from third party as follows: Ref: https://www.thomas-krenn.com/de/wiki/Adaptec_arcconf_unter_Ubuntu_installieren wget -O – http://archive.thomas-krenn.com/tk-archive.gpg.pub | sudo apt-key add – cd /etc/apt/sources.list.d wget http://archive.thomas-krenn.com/tk-main.list wget http://archive.thomas-krenn.com/tk-optional.list apt-get update apt-get install arcconf Getting info on the installed RAID controller: …

Linux

Entering a new certificate in Java Keystore

Using JDK 1.5 or below Ref: http://stackoverflow.com/questions/4217107/how-to-convert-pfx-file-to-keystore-with-private-key OpenSSL can do it all. This answer on JGuru is the best method that I’ve found so far. Firstly make sure that you have OpenSSL installed. Many operating systems already have it installed as I found with Mac OS X. The following two commands convert the pfx file …

Bash, Linux

Changing keyboard layout in Ubuntu/Debian Linux comand line

Ref: http://askubuntu.com/questions/209597/how-do-i-change-keyboards-from-the-command-line You can find all the different keymaps in the following location: /usr/share/keymaps/i386/ or /usr/share/kbd/keymaps/i386/ To change the keyboard layout (e.g. to German) in the Linux command line, type the following command: loadkeys de For X: setxkbmap de To make these changes system wide, assuming you’re using Ubuntu, you can use the following: sudo …

Linux

Instal Skype in Xubuntu 14.10 LTS

Unfortunately there is no .deb installation for Skype under XUbuntu that I know of. The best I found is to install the support of 32Bit environment and then install the standard 32 Bit skype as follows: Based on ref: http://askubuntu.com/questions/343047/installing-skype-on-ubuntu-13-04-64-bit sudo dpkg –add-architecture i386 sudo add-apt-repository “deb http://archive.canonical.com/ $(lsb_release -sc) partner” sudo apt-get update sudo …

Apache, Linux, NGinX

Verifying a SSL certificate chain

In order to see if an SSL web site has the proper SSL Certificate chain, this simple command can help: echo “” | openssl s_client -showcerts -servername web.site.com -connect web.site.com:443 -CApath /etc/ssl/certs/ Example: echo ” ” | openssl s_client -showcerts -servername tipstricks.itmatrix.eu -connect tipstricks.itmatrix.eu:443 -CApath /etc/ssl/certs Result:(most important extract from full result) CONNECTED(00000003) depth=2 C …

GIT, Linux

Installing GITLAB-Omnibus in Debian Wheezy

Introduction: The instructions here have been based on the site: https://about.gitlab.com/downloads/. I did what is shown there but it didn’t work immediately. I had to do the following tweaks and then it all worked fine so far. IMPORTANT: In order to stay updated see the last par at the end of this article for instruction …

NGinX, NGinX

NGINX: [emerg]: getgrnam(“…….”) failed in /etc/nginx/nginx.conf:1

As I installed nginx 1.6.x from Debian dotdeb repository, the daemon nginx started automatically using the user ‘www-data‘. As I wanted to change this user in the configuration file /etc/nginx/nginx.conf from: user www-data; TO user appuser; NGinX didn’t want to start any more and found the following line in the error logs: [emerg]: getgrnam(“appuser”) failed …

Linux

Find the USB drive information using smartmontools in Debian

You have inserted some drives in a USB port and want to know some information about the drive: Example: Command to find the list of storage devices: fdisk -l Result: Disk /dev/sda: 999.2 GB, 999156310016 bytes 255 heads, 63 sectors/track, 121473 cylinders, total 1951477168 sectors Units = sectors of 1 * 512 = 512 bytes …

Apache

ModSecurity: Rules must have at least id action

After compiling ModSecurity 2.8.0 with Apache 2.4.10 I got the the folowing error when trying to start Apache2: ModSecurity: Rules must have at least id action After Google-ing it I found this site that explains what went wrong: https://evilazrael.de/content/modsecurity-rules-must-have-least-id-action According to this site the labeling(identification) of the rules was optional till the version 2.7.0, after …

Linux

APT repositories pgp keys issues

Thsi article is taken form : http://blog.nachtarbeiter.net/2009/06/08/add-missing-gpg-public-key-to-debians-apt/ Add missing GPG public key to Debian’s apt. If you get a message like this while installing a new package through apt… GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY C514AF8E4BA401C3 First copy the number that comes …

Bash, Linux

Unlocking dpkg database

Under Debian Squeeze I ran the command dpkg -i bash_4.1-3+deb6u1_amd64.deb and got the following error message: dpkg: status database area is locked by another process Solution: 1 – make sure you are not already runnning any package administration program in another bash session like with dpkg or apt-get or aptitude 2 – If no other …

Bash, Linux

Bash bug ‘Shellshock’ Debian Squeeze packages

For those who still have Debian Squeeze and wonder where to find the fixed Bash Debian package for the dangerous bash bug (http://www.bbc.co.uk/news/technology-29361794)you can find it here: 64 Bit: ftp://ftp.fr.debian.org/debian/pool/main/b/bash/bash_4.1-3+deb6u2_amd64.deb 32 Bit: ftp://ftp.fr.debian.org/debian/pool/main/b/bash/bash_4.1-3+deb6u2_i386.deb Want to test your Bash to see if it is fixed? Run the command: test=”() { echo Hello; }; echo Buggy” bash …

Linux, Monitoring

Installing Shinken in Debian Wheezy

Debian Wheezy does offer the installation of the full (a bit old)shinken, BUT it doesn’t offer the Installation of the WebUI. Here is a better way to install everything including pnp4nagios and check_mk in one go: STEPS: Install Shinken wget http://www.shinken-monitoring.org/install -O /tmp/install_shinken.sh cd /tmp && sh install_shinken.sh Configure shinken vim /usr/local/shinken/etc/shinken-specific.cfg Change the http://YOURSERVERNAME/ …

Linux, Monitoring

Installing Icinga2, pnp4nagios, NRPE Agent and Graphite in Debian Wheezy

Since Icinga2 is not part of the stable version of Debian Wheezy we need to install it from the wheezy-backports. Therefore the following steps are suggested: Add the backports to the Debian repositories list: mcedit /etc/apt/sources.list Add the following lines: deb http://ftp.debian.org/debian/ wheezy-backports main contrib non-free deb-src http://ftp.debian.org/debian/ wheezy-backports main contrib non-free Update the repo …

Linux, XEN

Install Xen 4.1 on Debian Wheezy in a Hetzner Dedicated server

Hetzner Germany has very fast and not expensive rentals of Hardware servers available. In order to communicate internally via private network between Xen-DOMUs and DOM0, normally one would install Xen DOM0 network with bridge networking as follows: DOM0:xenbr0(eth0) — bridging==>> DOMUs:eth0 DOM0:xenbr1(dummy0) —bridging==>> DOMUs:eth1 BUT!!!! PROBLEM: Because of the configuration of the network switches at …

Linux, Linux on MACBook, Monitoring

Testing internet speed on Linux command line

This small script does a fairly good Upload/download speed test of your Internet connection: Note: This is a Python script. So you’ll need first to make sure you have Python installed in your system. Get the script: wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py Make it runnable chmod +x speedtest-cli Run it ./speedtest-cli Have fun

Linux, XEN

Switching from xm(xend) XenToolStack to XL XenToolStack in Delian Wheezy

Introduction: While I upgraded my Xen DOM0 from Squeeze to Wheezy it was recommended to switch from the Xend(xm) Toolstack to XL Toolstack. Because I found very little info on how to do the switch. So here is a way do it on Wheezy. Here we are assuming that you have installed Xen 4.1 Hypervisor …

Linux, Postfix

Archiving all incoming/outgoing mails using Sieve

The following custom Sieve script can be used to make a copy of every email a user sends or receives. In the example, the user is user@domain.com and the copy of the .MSG file is saved in the spyfolder directory. if envelope :contains [“from”,”to”] “user@domain.com” { fileinto “c:\\spyfolder”; keep; } Note: Be careful to monitor …

Linux, Postfix

Blocking user to send sensitive information using Sieve

The following article uses examples to show how to block users from sending attachments containing sensitive information (e.g. financial information) to the outside world. The script blocks attachments with certain names by flagging particular words. Scenario: – Your domain is widget.com – The administrator wants to block attachments with the word customer in the filename …

Linux, Postfix

Force sending mails using SSL/TLS

Introduction: In some cases it might be requested to transfer emails to another mail server using encryption (SSL/TLS). Here is a way to do it using Sieve language which Dovecot supports: Use a sieve script to conditionally send encrypted messages. The script would insert a header element, called X-Requires-SSL, prompting SMTPDS (the Delivery Service) to …

Linux

Debian Wheezy vsFTPd: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()

It means that the user which connects to the vsFTPd server should not be allowed to write in its root directory. vsftpd-2.3.5 disallow login with writable root directory because of possible glibc vulnerabilities If you already have enabled the TSL connection then the same error message will look like this: “Unsupported record version Unknown-48.48” Here …

Apache, Linux

Dynamically change Apache response content

Although the example below doesn’t quite represent a very good one in terms of real life problem, nevertheless it shows how to implement a dynamic web server response content modification. These replacements are done in application server responses before they leave Apache web server. In this example we are dynamically replacing parts of the URI …

Apache, Linux, Postfix, XEN

Creating a XEN machine and Installing Group Office in Debian Wheezy

Introduction In this Tutorial I will explain the steps I did to create a Xen Virtual Machine with minimal packages and then install the latest Group Office Web based Collaboration software. You’ll need to be fluent in Linux and Xen because I don’t explain much here. Note: My hypervisor is Xen 4.0 in Debian Squeeze …

Apache, Linux

vhosts calling themselves behind load balancer

PROBLEM: If a virtualhost configured behind a load balancer originated http/https, requests using the proxy module in destination to the Internet IP of the virtual host, the route of the packet would then have to be: Vhost ==ProxyModule==>> LoadBalancer ==>> Loop to itself ==>> Vhost For technical reasons I needed to avoid this route. This …

Apache, Linux

Some tools for SSL certificates

Checking that a certificate is paired to the key Example: openssl rsa -noout -modulus -in mycert.key |openssl md5 33c63cb62080fdf2bc06c47a59e02917 openssl x509 -noout -modulus -in mycert.crt |openssl md5 33c63cb62080fdf2bc06c47a59e02917 Both results should be the same Generating a certificate for VSFTP openssl req -x509 -nodes -days 3650 -newkey rsa:1024 -keyout /etc/ssl/certs/vsftpd.pem -out /etc/ssl/certs/vsftpd.pem Creating a self signed …

Linux

Setting-up Chroot for SSH and for SFTP

There are many ways to create Chroot for SSH here are 2 good links for that. http://www.debian.org/doc/manuals/securing-debian-howto/ap-chroot-ssh-env.en.html http://www.howtoforge.com/chrooted_ssh_howto_debian Note: Here some more info on the subject. The following article is based on an extract of the following site: http://www.howtoforge.com/restricting-users-to-sftp-plus-setting-up-chrooted-ssh-sftp-debian-squeeze Enabling chrooted SSH Enabling chrooted SSH is a bit complicated because we must set up a …

Apache

Limiting connections per Virtual Host with mod_bw

Introduction: In order to limit the number of simultaneous connections to a Web server (for the whole server) the following Core directive is used in our Live web servers, limiting it to 2000 simultaneous connections per web server. MaxClients 2000 In the case of wanting to limit the number of simultaneous connections per VirtualHost we …

Linux

Installing extFAT in Linux Mint(Debian/Ubuntu)

This article is based on the following link of which I’m really thanful: https://paraaether.wordpress.com/2012/09/08/mount-exfat-filesystems-under-linux-mint-ubuntu/ Problem: Lately a new file system format meant for external flash-memory cards, Camera ssd cards and Smart phones is been develloped by Microsoft called ‘extFAT’. It allows to overcome the barrier of 4GB for single files and is more efficient for …

Linux

snmpd error on subcontainer ‘ia_addr’ insert (-1)

This message is flooding my syslog on each snmp query. snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) To avoid it you have to change the log level of the services. In debian squeeze edit /etc/default/snmpd and change these lines: SNMPDOPTS=’-Lsd -Lf …

Linux, XEN

Configuring Debian Wheezy Xen 4.1 Hypervisor

Introduction: When I upgraded from Debian Lenny Xen 3.2.1 to Squeeze Xen 4.0, except for the DOMu hard disks names (from /dev/hdax to /dev/xvdax), I had very little changes to do and all went pretty well. Lately I wanted to upgrade from Squeeze Xen 4.0 to Wheezy Xen 4.1 and I had a few very …

Linux, MySQL

Rebuild MySQL replication slave LIVE from master

Problem: You have 2 MySQL servers in the configuration Master ==>> Slave and the slave has gone very badly out of sync with the master. Normally it’s no real problem if you can lock the master tables, make a dump of the databases of the master and import them back into the slave. But the …

Linux

Encryp and decrypt files using GnuPG, Mcrypt and OpenSSL

Although there are many tutorials concerning encrypting files sometimes one wants just to encrypt/decrypt files with only a passphrase. This what this article is about. This article is based on the great tutorials found at: http://bitflop.com/document/86. For a fuller Tutorial on GnuPG: http://bitflop.com/document/129 Thanks to the author for the good work. GnuPG Encryption: $ gpg …

GIT, Linux

Installation of GIT, Gitolite and Gitweb in Debian Squeeze

Note: This tutorial is based on this very good site, thanks for the work: http://geroldm.com/2011/10/howto-setup-gitolite-in-debian/ Introduction: This is a simple and step by step tutorial on how to install GIT server and Gitolite in Debian Squeeze.Since GIT has no authentication/authrization methods on its own Gitolite does fill in. Gitolite allows to control new creation of …

Linux, ZIMBRA

Configuring Zimbra to deliver mail using SSL/TLS

Reference: http://wiki.zimbra.com/index.php?title=Outgoing_SMTP_Authentication#Enable_TLS ssh root@server.mydomain.com su – zimbra zmlocalconfig -e postfix_smtp_tls_security_level=may zmcontrol restart Sent an email to normal postfix server: Check the headers of received email: Received: from server.mydomain.com (static.66.240.40.188.clients.your-server.de [188.40.240.66]) by mail.mydomain.com (Postfix) with ESMTPS id E457F3E09E for ; Fri, 19 Apr 2013 23:35:31 +0200 (CEST) Sent to GMAIL server: Received: from server.mydomain.com (static.66.240.40.188.clients.your-server.de. [188.40.240.66]) …

Linux, XEN

Basics of Linux Logical Volume Manager

Concept: Physical Volume(PV): Real partition which can be assigned to a pool of resource to create/manage logical volumesLogical Volume Group(LG): Pool of resources (partitions) which can be used to create/manage Logical volumesLogical Volumes(LV): Logical Partitions which can be formatted and used just like a normal partition. The difference is that these Logical Partitions can be …

Apache, Linux

php5-cgi fills up memory, too many processes.

Problem Description: I just solved a strange situation where peu-à-peu the number of php5-cgi processes kept on increasing till all the RAMS were used and the system went to a crawl no more responding to web requests. Cause: After the maximum number of requests got reached for a php5-cgi requests the process gets detached from …

Bash, Linux

Converting Windows text files to Linux

Here is a small overview of how (in)compatible computer operating systems are. Normal text files end the lines as follows: Windows: CR+LF Linux: LF OS X: CR In order to convert line ends here are few tricks I extracted from this page(many thanks to the author): http://kb.iu.edu/data/acux.html dos2unix and unix2dos The utilities dos2unix and unix2dos …

Linux

WARN: nodename xxxx uuid changed yyyy

Reference: This a complete ‘copy’ of the very useful info page at this link: http://www.pc-professionals.com/blog/cloning-a-linux-heartbeat-3-node/ Some heartbeat problems when starting: While setting up a Linux Heartbeat failover cluster, you may be tempted to set up one server node and clone the machine to create the other nodes that will make up your cluster. This is …

Linux, ZIMBRA

Install Geotrust certificate in Zimbra 8.x

The best way to install a RapidSSL cert is via the CLI as the root user. Reference: (18-12-2012 @ 23:39 BST) http://elijahpaul.co.uk/2012/12/installing-a-rapidssl-certificate-on-zimbra-8-0/#.UVjDBhlSP5g 1. Start by logging into your Zimbra servers CLI via SSH. 2. As root begin by generating a Certificate Signing Request (CSR). Below replace ‘mail.yourdomain.com’ with the FQDN of your Zimbra server. /opt/zimbra/bin/zmcertmgr …

Linux, ZIMBRA

Configuring DKIM Authentication in Zimbra

Configuring Zimbra 8.x to use DKIM Authentication Example for ‘mydomain.com’ ssh root@zimbra.mydomain.com su – zimbra Creating the DKIM keys for a domain: /opt/zimbra/libexec/zmdkimkeyutil -a -d mydomain.com Example of result: 50F0EEFE-AB8C-11E2-B7AE-FC2CE654A0ED._domainkey IN TXT ( “v=DKIM1; k=rsa; ” “p=MIGfMA0GCSqGSIb3DQEBAQUCA4GNADCBiQKBgQDodIcoFWJsfsSzsdINY/ZiOKn3qKLt+qmEl1cDYApi0PCHwQmqTl9mhRKs3obfgN8O9nT227CDg9NI7MMu8r0fOatQRQ1YHesDmHIo1lELioDNd5QZPg1AUum0CPsDuR+YI5AG5wZhZ4c3ei0Uv3cu4aTIhGrRgnD081sysJ5vZwIDAQAB” ) ; —– DKIM key 50F0EEFE-AB8C-11E2-B7AE-FC2CE654A0ED for mydomain.com IMPORTANT: Enter the above result as TXT field in the …

Linux, Postfix

Install Geotrust/RapidSSL certificate in Zimbra 8.0.x

This How-to is based on the following page and after failing to install myself my commercial certificate I feel very grateful for his contribution: http://elijahpaul.co.uk/2012/12/installing-a-rapidssl-certificate-on-zimbra-8-0/#.UVjDBhlSP5g The best way to install a RapidSSL cert is via the CLI as the root user. 1. Start by logging as root superuser into your Zimbra servers CLI via SSH. …