Introduction: as most Linux administrators know if you type the command, for example: host my.domain.com You get the resolving of the address ONLY through DNS resolving and NOT using the local /etc/hosts file first. Of course if you use the command: ping my.domain.com You get to see the IP which with be tried to be …
Category: Linux
Linux Tips and tricks, either for desktop or internal system.
Installing an Ubuntu 12.0.4 LTS as Xen DOMu in Debian Squeeze hypervisor
Lately I needed to install Zimbra 8.0.3 which only installs easily in an Ubuntu 10.0.4 or 12.0.4 LTS system. So I decided for that to install an Ubuntu 12.0.4 LTS as Xen DOMu in a Debian Squeeze Xen Hypervisor and here is how I did it. The following commands can be put into a runnable …
Installing OpenDKIM in Debian Squeeze/Wheezy
Introduction Lately my mail server started to get refusals of emails from large mailing systems like AOL, Yahoo etc. I can’t blame them for trying to minimize the SPAMS to their clients. Although using an approved relay service is a good solution, if you want to take care of it yourself here is OpenDKIM at …
Using pyGRUB on Squeeze/Wheezy to boot a domU kernel
This adapded article is based on the following Debian Wiki article: http://wiki.debian.org/PyGrub In this article I assume: – The reader is familiar with Linux and Xen Hypervisor – The DOMu system partition is using a file image instead of a physical partition. Introduction: This method offers the advantage of loading the kernel which is installed …
Synchronization of directories with GlusterFS between 2 Debian/Ubuntu hosts
There are many methods existing on the market to synchronize content of directories between hosts. eg. rsync, lsyncd, duplicity etc. The most difficult part though is bidirectionally synchronize them so that no conflicts occur. One method is using the program Unison which works well but if a file gets modified differently on both servers between …
Compiling an Apache module after Apache is been compiled
Sometimes one discovers a module which would be lovely to include in an already compiled Apache. I’m using here an example of a vanilla Apache I compiled. Constants: Source path of Apache: /www/src/ Path of compiled Apache: /www/apache/ Module to compile: proxy_http Compiling the module: cd /www/src/modules/proxy /www/apache/bin/apxs -i -a -c mod_proxy_http.c This will: – …
Installing Linux Remote Terminal using VNC on a Debian Server
Here are the instructions on how to install an efficient Linux remote desktop (XCFE) using VNC. apt-get install xorg xfce4 xfce4-goodies vnc4server Note: If you want to change the initial VNC port edit the file: /usr/bin/vnc4server and change the port as follows: eg. to change the vnc ports to start at 8081 ‘$vncPort = 8080 …
‘blocked by Verizon Online’s anti-spam system…’ OR ‘AOL: refused to talk to me: 554- (RTR:BL)’ OR ‘AT&T: blocked by ldap:ou=rblmx,dc=att,dc=net’
Lately I’ve been confronted with the following error messages from my Postfix server form AOL, Verizon or AT&T: VERIZON: ‘blocked by Verizon Online’s anti-spam system… AOL: refused to talk to me: 554- (RTR:BL)…. AT&T: blocked by ldap:ou=rblmx,dc=att,dc=net…. Moreover after trying to get my server on the whitelist it seemed almost impossible or quite a long …
Scan linux system for viruses with Clamav
Command: /usr/bin/clamscan -r -i /start/directory
Load Balancing with Apache
Introduction: I’ve been confronted with the task of installing 2 web servers and a load balancer all made of Apache2. Requirements: – 1 Load balancer made of apache2 configured for 2 Web sites – The load balancer should implement Cookies based stikyness for clients to land all their requests on the same web server initially …
Changing the URL of WordPress
Lately after a friend had develloped a new web site under (eg.)new.mywebsite.com when it needed to go live to www.mywebsite.com although the admin settings were changed and the Apache configuration as well, many links still were pointing to new.mywebsite.com. Now what to do? I searched the Net and found this great beb site which explains …
Combining Apache PHP module and fcgi in Debian Squeeze/Wheezy
Many help sites that show you how to install and configure the Apache module mod_fcgid ask you to uninstall the Generic Apache PHP module(mod_php5). Although mod_fcgid offers some advantages to the mod_php5, uninstalling the mod_php5 need not be, especially if you are running applications that don’t need to run under mod_fcgid and it uses simple …
Warning: curl_exec() has been disabled for security reasons
In Powerpress plugin of WordPress I’ve been confronted with this error: Warning: curl_exec() has been disabled for security reasons Many people suggested a hack into the functions.php of WordPress. I find this solution not very good, since it’s most likely all gone after an update of WordPress. After looking for a better solution in Google …
intermitent dovecot imap login problem
I set-up dovecot as mail pic-up server for IMAP and POP3. If I left my webmail(roundcube) interface running on my browser, I experienced very often that as soon as I started an Apple mail product (iPad,iPhone or Mail on OSX the IMAP complained that my login failed and asked for typing my password. Normally the …
logrotate /usr/bin/mysqladmin: refresh failed; error: ‘Unknown error’
Problem: After a fresh install of Debian Squeeze and mysql server, started to appear the following error as email from cron: /etc/cron.daily/logrotate: /usr/bin/mysqladmin: refresh failed; error: ‘Unknown error’ error: error running shared postrotate script for ‘/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log ‘ run-parts: /etc/cron.daily/logrotate exited with return code 1 Cause: After the installation of mysql-server package, the first …
Mysql Loop replicating in Debian Squeeze
I have been doing replicating from master to Slave for quite a while and sometimes found it a bit limited especially when the master in down and ‘writes’ need to be done to the databases. Here is a method where no matter which server is down you can always write to it and the changes …
Configuring vacation response on incoming emails
This configuration is made to respond to each incoming email by an automated message. It is inspired from the site: http://www.akadia.com/services/automatic_email_answering.html In Debian: Install the package vacation apt-get install vacation Assumptions: System User: marie Email address: marie.larue@myserver.com Configuration: Initialize the database file ~/.vacation.db sudo -u marie vacation -I Create the following 2 files in the …
PHP problem of ‘basedir-open’
After having upgraded Apache, PHP and other PHP modules I found out that we had problems with errors regarding restrictions of opening files within the set htdocs directory. I found that out by enabling error messages to be shown in the php.ini file. After researches on Internet I found those sites where they also had …
Installing ISTATD on Debian Squeeze/Wheezy
This HOW-TO is almost completely based on the README.txt file included in ISTATD package I included some adaptation notes. istatd is a daemon serving statistics to your iStat iPhone application from Linux, Solaris & FreeBSD. istatd collects data such as CPU, memory, network and disk usage and keeps the history. Once connecting from the iPhone …
Unlocking dpkg in Debian Squeeze
Problem Description: Although it can happen very rarely sometimes the dpkg, run by apt-get or aptitude, gets confused and leaves the lock on the mounting of its database open after being terminated. This prevents any further operations on installing, updating or configuring packages. The error would look like this: debconf: DbDriver “config”: /var/cache/debconf/config.dat is locked …
Securely transfering a key or a private file via email
Often when seeting-up a VPN or other similar mechanism we need to transfer securely a private key or a list of passwords or anything very private to another party via email without running the risks of the man-in-the-middle snoopin on it. Here is a method using OpenSSL which is available in Linux. Sending a one …
Detecting Browser User Agent in Mod_Rewrite
Apache mod_rewrite can be used to detect whether a browser has a WAP or Smartphone device versus a normal size browser and act accordingly. Here is a method: Creating variables for different sorts of portable devices: # Wap devices BrowserMatch “MIDP” WAP_DEVICE BrowserMatch “CLDC” WAP_DEVICE BrowserMatch “UP\.” WAP_DEVICE BrowserMatch “HTC” WAP_DEVICE BrowserMatch “LG” WAP_DEVICE BrowserMatch …
Installing Google’s Apache mod_pagespeed module.
Google has recently published an Apache module which should optimize web sites delivery daynamically. I was quite suspicious about such tool and though that this could only work at the costs of page outlook quality, meaning web pages not being displayed quite the same as the original. After experimenting with it I was quite please …
Compiling and Installing Darwin Streaming Server on Debian Squeeze
I used to run Darwin Streaming Server Version 5.5.5 and ran quite well. In order to be able to take advantage of the new features and stability of the 6.0.3 I tried to compile it in Debian Squeeze Linux and it didn’t work at all. I got many compiling warnings and errors which at the …
Configuring Apache2 mod_deflate
Here are some recommended settings of the mod_deflate in Apache2. The main principle is to define which type of files are and which ones are not to be compressed. These settings DON’T override the fact that if a device/browser doesn’t have the following header in its request the requested file/component will NOT be compressed at …
Troubleshooting nameservers(DNS) using dig
In order to find out where the domain resolving fails here are some tricks using the command dig to trace the recursion step by step till the DNS that fails to deliver the IP of the requested [sub]domain. Reference site: https://nsrc.org/workshops/2005/pre-SANOG-VI/bc/dns/dns2-02-dig-debug.html Tracing a well resolving domain: So first we start by asking one of the …
Synchronizing mirror directories in Linux
Task: Keep multiple web server’s htdocs files in sync. One way to do it is to write a script as cronjob which synchronizes the main server’s configuration directories to all other servers. But there are more elegant ways to do it: GlusterFS and lsyncd. This article relates to the later: lsyncd This deamon process uses …
Using Environment variables in Apache rewrite rules
Problem: Setting multiple variables(%1-%9) in rewrite rules with RewriteCond will get rewritten by the subsequent RewriteCond for the same rewrite rule pack. eg. RewriteCond %{REQUEST_URI} ID([^/]+) RewriteCond %{REQUEST_URI} ID2([^/]+) RewriteRule ^/login.php /newlogin.php?NewID=%1&NewID2=%2 The above rule is not practical in real world, there are better ways to do this. But just as an example, we can …
Setting a Cookie from Query String
In some very special task we needed (don’t ask me why) to use the value of the Query string to set a response cookie. Meaning we grab the query string in a format of Name=value to set a cookie in the response header. eg. http://www.myserver.com/myimage.gif?mycookie=myvalue sets the cookie in the client’s browser as: Name of …
HowTo Flush Linux dns cache
This article is bee extracted from the URL: http://www.inetdaemon.com/tutorials/internet/dns/servers/caching.shtml of which many thanks for posting the article. I extracted what I needed and posted it again here mostly for me as a reminder. HowTo: Flush nscd dns cache Nscd caches libc-issued requests to the Name Service. If retrieving NSS data is fairly expensive, nscd is …
Authentifying with Active Directory-LDAP users via Linux LDAP tools.
I’ve got a project where we needed to make sure the user had to be authenticated against Windows Active Directory. This is what helped me. Install the LDAP tools: (Example in Debian) apt-get install ldap-utils Command to authenticate Note: the user(Username) registered in Active Directory DN(DC=ad,DC=domain,DC=net). (Return code of command should be 0 if successful) …
Flushing mySQL Binary logs
In order to keep the disk usage of the binlogs down while having replication, it is necessary to periodically perform a PURGE BINARY LOGS command. Please keep in mind that it is important to ensure that you don’t remove any binlogs that are still needed by the replicas. For example: PURGE BINARY LOGS BEFORE ‘2008-04-02 …
Creating a new Xen DOMU Debian Squeeze image file(bootstrapping)
Here is a short example with many options given which creates a new Debian Squeeze Xen 4.0x image file. The command will create a 25GB Debian Squeeze Image file in the LVM:’vservers’ which will run the 32 bit kernel 2.6.26-2-xen-686 with 2GB of RAM and 1GB of SWAP file with root password ‘changeme’. Note: remember …
Installing eAccelerator for PHP in Debian Squeeze
This great application really speeds-up the processing and therefore delivery of complex web sites based on PHP, for example from CMS like Typo3. Here is how to install it. Credits FROM: http://www.debiantutorials.com/installing-eaccelerator/ and https://github.com/eaccelerator/eaccelerator/wiki/InstallFromSource Instructions in German: http://www.sysadminslife.com/linux/eaccelerator-php-beschleuniger-installation-unter-debian-5-lenny-und-ubuntu/ Download it cd /tmp wget http://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2 Unpack it tar -xvjf eaccelerator-0.9.6.1.tar.bz2 Prepare for compiling it apt-get install …
Find and kill processes that prevent unmounting
Sometimes I try to unmount a storage device and it says that it cannot unmount because a process is using it. Now how to find this/these processes and kill them so I can unmount the device? Here is one way to do it. Long and careful way, step by step: # Find out the mount …
Change MAC address in Linux
In some situations if one needs to change the MAC address of an ethernet card here is the way: ifconfig eth0 down ifconfig eth0 hw ether [new mac address] ifconfig eht0 up ifconfig eth0 And see you brand new ethernet address. have fun hacking 🙂
ERROR: Connection dropped by IMAP server
Problem: Lately I had the problem that some users could not log-in into their webmail(Squirrelmail). Squirrelmail answered: “ERROR: Connection dropped by IMAP server”. Looking into the logs I found the following lines: Jul 5 10:39:43 ms41 dovecot: imap-login: Login: user=user1>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Jul 5 10:39:43 ms41 dovecot: IMAP(user1): mail_location not set and autodetection …
Running Postfix on multiple ports
Reference: The following Tip is been taken from the following forum: http://www.howtoforge.com/forums/archive/index.php/t-4788.html Description: Some ISPs, for some strange reasons, are blocking the port 25, therefore preventing many normal email clients software from picking-up their emails from other mail servers than their own ISP’s server. Solution: Making sure Postfix on your mail server listens on both …
Protect specific email clients
In my mailing list system (Mailman) I needed to make sure that no one else than a certain list of senders would be able to send commands via email to the xxxx-request@mylist.com. Since I could not find this feature in Mailman I decided to go the Postfix way. So here is the configuration I made …
Solving the problem of MaxRequestLen in mod_fcgid
Sometimes we get the following message in error.log and sometimes not. The reason is that the size of MaxRequestLen is not high enough: mod_fcgid: HTTP request length 135714 (so far) exceeds MaxRequestLen (131072) Solution: Add the following entry in the file: /etc/apache2/mods-available/fcgid.conf raise the value from the default 131072 to 15728640 (15MB) or higher if …
Compiling and install the missing dotdeb php5-fileinfo package
Dotdeb has done a terrific job at precompiling some PHP 5 packages and environment for us. Unfortunately in Dotdeb version of Debian Squeeze PHP5 packages I found the package php5-fileinfo to be missing. So here are the blind steps (without explanations) on how to compile and install this package. This is just an example unig …
Configuring heartbeat
Introduction: This HOW-TO will describe with very few explanations how to minimally configure Heartbeat software for the purpose of automatically switching a virtual IP from one server to another when the default server fails. Here a ‘Virtual IP’ will be switched from one server to another depending on which one is available. Install heartbeat: apt-get …
Using TLS for mail delivery from postfix to another TLS activated mail server
Introduction: The default encryption method for delivering email from Postfix to another mail server is ‘NONE’ In certain cases for enhanced security reasons emails for certain destinations should be encrypted all the way: Meaning: Client 1 ==(TLS)==> Postfix Server ==TLS==> Other email Server ==SSL/TLS==> Client 2 In this case we cannot influence the way the …
VPN Server and clients HOW-TO
Hi Folks, there are a lot of VPN howtos out there and here I am making one more. Well if the format I’m putting it in helps for some of you to install your VPN, great. That is all I’m wishing for, and besides because I have a very short memory every time I discover …
Upgrade Debian using an .iso file
Here are simple steps on how to dist-upgrade a Debian system using an ISO file. Normally the process would be quite simple by replacing the entries in the repository list and call a command apt-get update; apt-get disp-upgrade. BUT what if your system doesn’t have Internet acccess while you want to do the upgrade? Here …
Forcing a keep-alive in ssh sessions
The following configuration will prevent an SSH session to terminate automatically upon long time of inactivity: File: ~/.ssh/config Content: Host * Protocol 2 TCPKeepAlive yes ServerAliveInterval 60 StrictHostKeyChecking = no
REF: Installing packages in different Linux Distributions
Distro URL Command ====== ======================== ============================ Debian (http://www.debian.org) apt-get install packagename Ubuntu (http://ubuntulinux.org) apt-get install packagename Suse (http://www.opensuse.org) yast -i packagename Fedora Core (http://fedoraproject.org) yum install packagename FreeBSD (http://www.freebsd.org) pkg_add -r packagename Gentoo (http://www.gentoo.org) emerge packagename OpenBSD (http://www.openbsd.org) pkg_add -r packagename
Remotely Install Debian using bootstrapping
Introduction: Imagine you have rented a system at a provider where you want to install remotely a totally new Debian Squeeze from scratch. You will need the following components: – A Remote KVM Switch where you can view and control the system via a console remotely. – A knoppix or any relatively recent bootable live …
Change the bash session timeout
Sometimes we need to have a longer bash session timeout value to be able to stay logged-in while nothing is happening on the terminal. Here is the setting you can include in your .bashrc or .profile files: export TMOUT=0 This will set the shell session to have no timeout duration. export TMOUT=345600 This will set …
Using cache control with Apache
This article has no structure really. It is a gathering of important information and own findings concerning caching of web elements. Caching controls of web elements General rules: – The header ‘Expires:’ is an implementation of the HTTP/1.0 – The header ‘Cache-Control: max-age=xxxx’ is an implementation of the HTTP/1.1 and OVERRIDES ‘Expires:’ Extract from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html: …
Install a load balanced SVN system
Until I create my own docs here, I suggest you have a look at the following page from which I’m going to base my own version here anyway. http://www.devx.com/opensource/Article/39525/1954
Rebuild a mirror SVN from a master repository
There are a few ways to create a mirror SVN repository from a master repository. Some are slower than others but all of the ones mentioned below are reliable. The standard way: (All operations below are done on the mirror server) – Delete the old mirror repository – svnadmin create {path of repo} – svnsync …
Force aptitude/apt-get ingoring broken dependencies
In the case we absolutely need to install a special Debian package, from backports for example, and force it to ignore dependencies using aptitude download and dpkg –force-depends, your apt-get and aptitude will always complain later on about it and not resume its given commands until we resolve this dependency. So when you know what …
bash – how to find a variable string length
This short how-to shows how to find out a string length in bash: Copied from the very useful web site: http://unstableme.blogspot.com/2008/03/find-string-length-bash.html Suppose: $ VAR=”Bash Scripting” Now to find the length of the above string, I have found 3 different ways: $ echo “${#VAR}” 14 $ expr length “$VAR” 14 $ echo $VAR | awk ‘{print …
Compiling and Installing the latest SVN system.
Here is an example of how to compile and install the latest SVN system in Debian. At the time of writing the latest stable version was 1.6.17. Because this method contains all the dependencies of SVN compiling, it can probably be used in many types of Linux distributions. Here are only commands to run as …
Installing CACTI and Templates on Debian Lenny/Squeeze
In the area of monitoring systems using GPL software Nagios is a big player but the organization of displaying the history graphs is not so ideal. Zabbix is wonderful as well, it produces also good graphs but it creates them dynamically, resulting in a long wait time when we need to display a large amount …
Getting wireless Broadcom BCM4313 to work in Linux Mint 11
Unfortunately as of today June 19, the repository drivers of Wireless Broadcom BCM4313(wl.ko) don’t work well at all in Linux Mint 11. After making some research on Google I found out that there are new Linux drivers provided by the manufacturer Broadcom that simply need to be downloaded and installed. I did it and it …
Create a mixed (routed & bridged) private VLAN for Xen Virtual Machines
The most common way of configuring the networking in Xen environment is by using bridges. In the case of servers rented at Hetzner provider (Germany) this would not work because the infrastructure is allowing only one MAC address per server. It allows for multiple IPs but only one MAC address. To circumvent this situation we …
Use IPTables to load-balance web trafic
Although the Linux Kernel has already a load-balancing feature, it doesn’t come without the price of having to learn how to use it. Some tools like ‘LVS-KISS’ can help to do that job but still a bit too much sometimes when one want just crude load-balancing without any fall-back features. Here is a simple solution …
Installing Xen 4.x in Debian Squeeze (6.0)
Here are the minimum steps necessary to install Xen Hypervisor 4.x on Debian Squeeze. Installing the hypervisor and tools related aptitude install xen-linux-system-2.6-xen-amd64 xen-hypervisor-4.0-amd64 linux-image-xen-amd64 xen-qemu-dm-4.0 Change some system configuration Edit /etc/modules and add the following entry. To make sure the module ‘loop’ can create 64 loop connections. The entry ‘loop’ might already be there, …
Installing Debian ‘testing’ packages in ‘stable’ system.
Sometimes we want to install a package that is in testing state into a stable system. To do so, just follow the instructions below. NOTE: The following tips have been copied from the link: http://forums.spry.com/debian/620-how-install-testing-packages-debian-stable-apt-get.html The solution for keeping stable and installing the package is to modify apt-get configuration to setup what is called a …
Recover files from a deleted ext3 partition
What a disaster to find that your File Allocation Table is been destroyed. Well there is a possible light at the end of the tunnel. Scenario: Partition to recover: /dev/sdb2 HOW-TO – Find out where the SuperBlock got backed-up with the command mke2fs -n This gives you all the locations where the SuperBlock is back-up …
Installing SAR monitoring tools
NOTE: This article is a copy of the Geek Stuff Article at: 10 Useful Sar (Sysstat) Examples for UNIX / Linux Performance Monitoring Tanks for the tips. I have copied it to make sure this important article stays part of this tips collection. Intro: Using sar you can monitor performance of various Linux subsystems (CPU, …
Assigning CPUs to Xen virtual Machines
Introduction: I’m renting a 8 CPU machine at Hetzner and I wanted to improve the performance. At the beginning I was distributing many CPUs to the virtual machines which needed it and less cpus to others. This included that some cpus would be shared by more than one Xen virtual machine. I noticed that the …
Installing Bacula Backup system on Debian Lenny
These following instructions will download, compile and install Bacula and a couple of the best Web GUIs for it. Inspired from the following German link. Thank you: http://www.asconix.com/howtos/debian/bacula-backup-debian-lenny-howto Install needed packages for Bacula server aptitude install build-essential libpq-dev libncurses5-dev libssl-dev psmisc mysql-server libmysql++-dev Download compile and install Bacuda and its web GUI wget http://downloads.sourceforge.net/project/bacula/bacula/5.0.3/bacula-5.0.3.tar.gz tar …
Web client authentication using SSL/PKI and PHP
To authenticate web clients using a browser is no difficulty when one has imported the PKI certificate in the browser. But how can we do that with a php driven process and use it as client. Here is some short PHP code that will do exactly that. Note: the CA, PKI certificate(CRT) and private key(KEY) …
Installing and configuring Apache2 mod_secutity on Debian Squeeze
Install the Debian version of mod_security packages from Debian reposirory apt-get install libapache-mod-security Create an Apache config directory for mod_security mkdir /etc/apache2/modsecurity-core-rules chmod 600 /etc/apache2/modsecurity-core-rules Download and install the mod_security core rules wget http://www.modsecurity.org/download/modsecurity-core-rules_2.5-1.6.1.tar.gz tar vfx modsecurity-core-rules_2.5-1.6.1.tar.gz -C /etc/apache2/modsecurity-core-rules/ Create a symlink to adapt to all mod_security core rules(or change all the rules 🙂 ln …
Web Authentication using LDAP
These instructions have nothing special about them. There are many such instructions on the internet. The purpose here is only as reference for myself and maybe you as well. Here I’m assuming that you have installed openLDAP and created users and groups in LDAP server. In the following examples the users and groups login names …
Running a second instance of mysqld
Sometimes it’s needed to have 2 instances of mysql daemon in the same server. In that case I decided to use the port 3307 for the second instance. Although there are other (maybe even easier) ways to do that, here is one of them. Creating a second instance of MySQL server on port 3307. Create …
LDAP Installation in Debian Lenny + Web LDAP Browser
NOTE: These instructions are assuming that the LDAP client runs on the same machine as the LDAP server runs. Environment: IP: 192.168.100.27 LDAP Client Machine names: ldapc.itmatrix.srv ldapc LDAP Server Machine names: ldaps.itmatrix.srv ldaps NOTE: This tutorial is a short and updated version of the one found at: http://techpubs.spinlocksolutions.com/dklar/ldap.html Edit /etc/hosts and se the content …
SVN + WebSVN(SSL) Installation in Debian Squeeze
These instructions show how to install the SVN system and the WebSVN via Apache SSL connection. These instructions don’t explain much, I hope your are Linux/Apache savvy enough to understand them. Install the needed Debian packages apt-get install subversion libapache2-svn openssl ssl-cert a2enmod ssl a2enmod dav_svn Everything in the dav_svn.conf configuration file is already disabled. …
Installing openERP on Debian Lenny 64 Bit
I’m totally new to openERP . As I was looking for ways to install it on Debian Lenny I found multiple sites that have each their own way. Well then I decided to cook myself a mix of the methods used in all of those sites and here is the result which worked well: Note …
Xen routed ext/int(virtual private) networking at Hetzner under Debian Lenny/Squeeze 64 Bit
At Hetzner(Germany) you can rent quite hot machines for a very good price. But what happens when you want to set-up multiple Xen virtual machines? You might get into trouble unless you follow these instructions. They are probably not the only solution for a well working xen machines farm but this one worked well for me.
Create a (bridged) VLAN for Xen Virtual Machines
To create a virtual private LAN which allows to communicate between Xen virtual machines (DOMx) via eth1 including the DOM0(dummy0), follow these instructions. This will create a bridge in xen DOM0 and a new interface(eth1) in the DOMx (in our case ‘vsystem1’). NOTE: This method implies that the eth0 is also bridged. In case you …
Disabling the flood of kernel messages in Debian console
To disable permanently all low level kernel messages (iptables etc.) from flooding the console in Debian do the following changes: (you must be root for these changes) To make the changes permanent: Edit the file /etc/sysctl.conf add the following line: kernel.printk = 4 1 1 7 The above changes will be effective at reboot or …
Installing Zabbix 2.2.6 on Debian Squeeze
Debian Squeeze has still the Zabbix 1.8.2, if you want the install the 2.2.6, then one solution is to follow these instructions, the other is to do the hard work all the way(not shown here :-): The easy way: Zabbix has now Binary packages ready for Debian Wheezy to install: Reference: https://www.zabbix.com/documentation/2.0/manual/installation/install_from_packages Steps for version …
Speeding up Firefox Browser
Google Chrome has now eclipsed Mozilla Firefox in the speed category. However, I still use Firefox as my main web browser because it is still better than Chrome in certain areas. But just recently, I tried a few tweaks that significantly improved the speed of Firefox making it a little bit snappier than the latest …
Deleting the Postfix defered queues
Once in a while I get mails reused by certain servers(like AOL). After this happens too many times I might want to delete the deferred mails still stuck in the outbound queue. First I try again to send all the mails stuck in the outbound queues by issuing the command: postfix flush Then delete the …
Troubleshooting no root login possible from Xen console
If you can’t login as root from the Xen console on a DomU then do the following: – stop the DomU – Mounted it on a directory through loop mount -o loop,rw /where/my/DomU/image.is /mnt/domu/ – chroot to it chroot /mnt/domu/ – Install the udev package. (it complains at the end..but no worry) apt-get install udev …
Some useful ‘sed’ commands
Here are some useful sed commands. Note. The option ‘-i’ is making the changes directly into the file without having to send the result to a temporary file, and then replace the original with the temporary file. Very useful …. and dangerous. ———————————– Inserting a line of text at the beginning of the file Sometimes …
Make remote backups using tar and ssh
Sometimes we want to create a tarred directory but on a remote host. Here is the command. Example: To tar the whole /home directory to a tar.gz file on a remote server: (cd /home; tar cfz – .) |ssh {remote-host} dd of=/backup/filename.tar.gz obs=1024
chroot inside xen VM VDSO problem
If inside a xen machine you try to do a chroot into a directory and get this error: Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso’ failed! One of the possible solutions is to use the following command before issuing the chroot. echo 0 >/proc/sys/vm/vdso_enabled It is supposed to have …
Apache 2.2 caching
In Apache 2.2 there are 2 types of advanced caching available: – Memory based caching – Disk based caching Here are some tips and links related to the disk cache feature: APACHE 2.2 cache cleaning command: Recomended to run regularly from cron job # Runs as cron job, in nice mode, and limits the cache …
Installing Webmin based Xen Virtual Machines Control Panel
I know it’s totally an overkill to install Webmin to be able to freely and remotely control some basic features of the xen virtual Machines. But so far I haven’t found a really simple and decent replacement for it. Let me know if you do: michel@linuxint.com It took me a little while to find the …
Some useful Linux commands
Display the content of administrative text-based databases getent {ahosts|ahostsv4|ahostsv6|aliases|ethers|group|hosts|netgroup|network|spasswd|protocols|rpc services|shadow|gshadow} Generate secure passwords Install the tool apt-get install pwgen Generates a list of 8 char. passwords pwgen Generates 1 password of 10 char long pwgen 10 1 Get the filesystem type of a partition Get the filesystem type of /dev/sda2 file -sL /dev/sda2 Get the …
Various MySQL useful commands
Repairing all MySQL tables mysqlcheck –repair –extended –all-databases ————- Dumping the content of all databases in SQL format. (can be used for backup/migration purposes) mysqldump -p –user=root –add-drop-table –all-databases > all_my_databases.sql Import all databases from above saved file mysql -u root -p < all_my_databases.sql ------------- Dumping the content of a single database in SQL format.(can ...
Troubleshooting PTY allocation request failed on channel 0
This is an extract from a tip from ‘Xen Virtualization community support and Howto’s.‘. Thanks guys. It saved my but. When installing new virtual machine on a Debian “Lenny” host, You might get the following error message once you try SSH the new domU: PTY allocation request failed on channel 0 stdin: is not a …
Installing Windows 2003/XP/7 32 Bit on Xen in Debian Squeeze 64 Bit.
The task here is to install, run and administrate Windows 2003/XP/7 on a remote server in Internet where Xen 4.x is already installed and HVM is supported in hardware. The steps to install and run Windows are slightly different than for Linux Guests OS. In these cases Q Emu virtualization drivers are needed to complete …
Retrieving lost MySQL root password
It often happens. You are given the job of administrating a MySQL server where the root password was lost. What to do? Here is the solution I found in Internet at the link below. Thanks for the useful tip. http://www.cyberciti.biz/tips/recover-mysql-root-password.html by Vivek Gite · 121 comments You can recover MySQL database server password with following …
10 Steps to Beautiful Shell Scripts
This is a copy of the following wonderful short and helpful site. Thanks. http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html October 16th, 2007 Linux gurus don’t use cut, awk, and sed when they want to replace or strip out a portion if a variable. They use parameter substitution. You can learn parameter substitution in less than 2 minutes. Here is the …
Useful sed commands
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 Compiled by Eric Pement – pemente[at]northpark[dot]edu version 5.5 Latest version of this file (in English) is usually at: http://sed.sourceforge.net/sed1line.txt http://www.pement.org/sed/sed1line.txt This file will also available in other languages: Chinese – http://sed.sourceforge.net/sed1line_zh-CN.html Czech – http://sed.sourceforge.net/sed1line_cz.html Dutch – http://sed.sourceforge.net/sed1line_nl.html French – http://sed.sourceforge.net/sed1line_fr.html German – http://sed.sourceforge.net/sed1line_de.html Italian …
Replacing the missing ‘tac’ command in MAC OS X
After looking into Fink Command and Porticus I could not find the GNU command ‘tac’ for writing bash scripts. So I found these replacements which works well from the following link (Thanks guys :-)) http://trac.osgeo.org/grass/ticket/181 Normal use of tac: …..| tac |……. Replacement Nr. 1 …..| awk ‘{print NR,$0}’ | sort -nr | sed ‘s/^[0-9]* …
/proc/diskstats line format
Each line inside /proc/diskstats is having the following info format: eg. for sda (Full disk) cat /proc/diskstats | grep ‘sda ‘ 8 0 sda 2461810 61427 148062742 6482992 660009 1544934 67900384 45642376 0 7162961 52128751 Meaning:(fields starting after the device name) Field 1 — # of reads issued Field 2 — # of reads merged …
Recover Grub for Linux after Windows re-install
After I installed Linux Mint 8 with ext4 filesystem on /, I happned to have to reinstall Windows which whipped out my grub Boot loader of Linux Mint 8 from MBR. So after I googled around I finally found a site that explains how to recover a grub2 from an installed Linux. In my case …
Apache Log format codes
Extracted from: http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#logformat Format String Description ============= ============================================================================================================ %% The percent sign %a Remote IP-address %A Local IP-address %B Size of response in bytes, excluding HTTP headers. %b Size of response in bytes, excluding HTTP headers. In CLF format, i.e. a ‘-‘ rather than a 0 when no bytes are sent. %{Foobar}C The contents of …
Remote logging of Apache logs
Since Apache doesn’t provide the possibility to send it’s logs to a remote server we use the PIPE loging capability as follows: Principle: ====== 1) – Send logs to a local script via STDOUT 2) – The script uses the command logger to send each log line to the local rsyslog 3) – rsyslog via …
Remote logging with rsyslogd
In the sender rsyslog configuration (/etc/rsyslog.conf) ——————————————— local0.* @syslog-server.com ——————————————— In the receiver rsyslog configuration (/etc/rsyslog.conf) Example: ——————————————— # provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 $AllowedSender UDP, 127.0.0.1, 192.168.10.0/24 ———————————————
Apache mod_deflate controls
Ive been looking for a way to set the DEFLATE globally and then disable it individually as needed either in vhosts or in containers. There are two way to configure the DEFLATE: – INCLUDE-ALL-with-Exceptions : Compress all content except the exceptions defined – EXCLUDE-ALL-with-Exceptions : Compress none of the contents except the exceptions defined The …
IP List of China and Korea for IPTABLES
Just download: http://www.okean.com/antispam/iptables/rc.firewall.sinokorea This script that can be downloaded regularly needs to be converted before it can be used. In this list the destination ports is 25 (SMTP). For web access blocking, the port needs to be changed to 80,443,25,110,22,995 etc. . A small script can be used to get the list, convert it before …
Get the country and city of client IP
wget -O- -q http://api.hostip.info/get_html.php?ip=195.80.230.182 or lynx -dump “http://api.hostip.info/get_html.php?ip=195.80.230.182”