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 …
Author: admin
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 …
Solution to aslmanager process high CPU usage
Since the new migration of log files management from syslogd to aslmanager it is possible to encounter some problems regarding the high CPU usage by aslmanager process. One of the solution is to restart the aslmanager indexing by moving the logs in a temporary directory and restarting the syslogd/aslmanager service. Here are the commands: Stopping …
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 …
How to disable Spotlight in MAC OS X
If you’re like me, sometimes Spotlight has driving my MAC very hot with the process ‘mds’. To disable Spotlight do the following: open the Terminal app and run the following command: sudo mdutil -a -i off To turn it back on sudo mdutil -a -i on
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 …
aslmanager hangs with high cpu load
I’ve been looking for a solution against the periodic problem of having aslmanager use a high cpu load. As far as I could read in Google, many people think that it’s due to a curruption of the aslmanager database. So here is a solution that was suggested in a forum. Since my aslmanager process was …
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”
Problem: The ssh public key authentication doesn’t work
Try changing the permissions on .ssh/authorized_hosts to restrict READ AND WRITE to your user eg. chmod go-rw ~/.ssh/authorized_hosts SSH doesn’t like it when these files are world-readable Assuming that you wish to login to the machine called mystery from your current host with the id_rsa and id_rsa.pub files you’ve just generated you should run the …
Installing ZABBIX on Debian(Etch and Lenny)
ZABBIX ====== http://www.zabbix.com [^] This is an open source and seems quite good. It is available through Debian Repository as packages: zabbix-frontend-php (for central monitoring host) installed in monitoring server zabbix-server-mysql (for central monitoring host) installed in monitoring server zabbix-agent (for each monitored host) Installed in ALL 8 Hosts The mysql data: DB: zabbix user: …
Backing up Linux system
After cheking the backups I found that some didn’t get done properly(eg. WWW-1) but in HP-1 everything was OK. The old backups previously done via duplicity will be available still for a few months and then will be deleted. These old backups are in ‘bkdirx_duplicity’ directories. Finally I decided to change the program used to …
Linux iptables Diagram
ITerm German keyboard settings
Problem: aslmanager takes up to 99% CPU
Taken from: Here “So aslmanager is taking 99% and Console.app hangs when started. Why does aslmanager need 99% of CPU and 2+ GB footprint?” In past versions of Mac OS X, system and process log messages were received and managed by “syslogd” and the “syslog” utility. Under Mac OS X 10.5.6 Apple has included a …
To add a swap file
1. Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536. 2. At a shell prompt as root, type the following command with count being equal to the desired block size: dd if=/dev/zero of=/swapfile bs=1024 …
To fix the subshell problem in MC
Error message: Cannot open master side of pty: No such file or directory Then Add the following in /etc/fstab none /dev/pts devpts mode=0620 0 0
Creating a bootable USB stick from CD .iso file
NOTE: This worked for the RescueCD.iso file but might need some tweeking for other types of live CDs. Here we are assuming that the USB disk is: /dev/sdc – Make sure the single stick partition is: – the partition is tagged as bootable.(use fdisk for that) – formatted as VFAT32 mkfs.vfat -F 32 -n MYLABEL …
Dump the result of wget to STDOUT
wget -q -O – http://www.mysite.com
Change memory size while running XEN vMachine
While running you can change the live memory size of a VM or the Domani-0 (although may be dangerous for crashes) Use the command: xm mem-set ID NewMEMSize
Stop/Start a single XEN virtual machine
Assuming that the virtual machine is running, to stop the machine: – Make a list of the running virtual machines and note the ID of the one concerned. xl list Lets suppose the ID of the virtual machine concerned is 15 – Shutdown the machine. xl shutdown 15 – Make a few xm list commands …
Resizing XEN virtual image
Question: I am using Xen to create Virtual Machines, but how can I re-size the virtual disk image? Solution: Add an extra empty space to your virtual disk size and re-size the filesystem in it: or if reducing is needed, minimize the files system, add empty space to it as desired and re-size it. Example …
Compile Apache 2 in Debian/Ubuntu/Mint/..
Introduction: Steps to compile Apache: – Installation of needed development packages – Prepare the directories needed – copy the config file and script below – Run the script below Installation of needed development packages Needed for Apache mod_deflate libzip-dev (sources) libzip1 (bin libs.) zlib1g-dev (sources) Needed for Mod_security libpcre3-dev libpcrecpp0 libxml2-dev Compiling script Configuration file …
Assign processes to CPUs
use the tool: taskset
PROBLEM: ssh hangs for many seconds before giving prompt
The solution: uncomment(activate) GSSAPIAuthentication=no in /etc/ssh/ssh_config
Swap normal sleep to hibernating when told to sleep
Keyboard problems with Parallels
Using iTERM – The best terminal program for Linuxers
Configuration file: The full Config Plist is ~/Library/Preferences/com.googlecode.iterm2.plist it seem that it may be used to store the defaults values at startup, but the main one is the first one. Modifying/replacing the configuration file: Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, …
Making an OS X Volume Bootable
INFO: When MAC boots it looks into its whatever to findout if a directory was ‘blessed’ which means that this directory would be used to fetch the bootloader from. Normally the file boot.efi should be there and it will be used to boot the system. Boot from DVD, start a terminal and run this command: …
Creating an ISO file from a CD/DVD
1. Insert CD/DVD source 2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command: 3. Umount the disk with the following command: 4. Create the ISO file with the dd utility (may take some time): 5. Test the ISO image by mounting the new file …
Get the response content in terminal
w3m -dump http://my.server.com
Preventing loging for some documents types
eg. SetEnvIfNoCase Request_URI “.*\.html” !NOLOG CustomLog /var/log/httpd/main.log j_common env=!NOLOG
Get RSS with bash
#!/bin/bash lynx -source http://rss.freshmeat.net/freshmeat/feeds/fm-releases-global | sed -n ‘s/.*//gp’ | sed ‘s/
Compiling a new standard Apache DSO module
# Build and install a distributed Apache module, say mod_foo.c, into its own DSO mod_foo.so: * Build and install via configure (preferred): $ ./configure –prefix=/path/to/install –enable-shared=foo $ make install * Build and install manually: – Edit src/Configuration: > SharedModule modules/xxxx/mod_foo.so $ make $ cp src/xxxx/mod_foo.so /path/to/install/libexec – Edit /path/to/install/etc/httpd.conf >> LoadModule foo_module /path/to/install/libexec/mod_foo.so # Build …
Mod_jk shared file size in Apache 1.3.x
It can occur that a new worker set prevents apache to start, although correct configured. Possible cause: Mod_JK shared file is too small Size must be at least: Header: 84 Bytes Per Worker: 400 Bytes Extra at the end: 800 Bytes Any type worker uses the same amount of memory(400 bytes): loadBalancers and hosts Configuration: …
Example of mod_security Configuration
SecFilterEngine DynamicOnly SecFilterScanPOST On SecFilterDefaultAction “deny,log,status:400” SecFilterSelective REQUEST_URI “
MOD GZIP Configuration in Apache 1.3.x
NOTE: The size of the zipped content(not header) is about 1/3 of original size. mod_gzip_command_version ‘/mod_gzip_status’ mod_gzip_temp_dir /tmp/mod_gzip_httpd mod_gzip_keep_workfiles No mod_gzip_minimum_file_size 1000 mod_gzip_maximum_file_size 100000 mod_gzip_maximum_inmem_size 60000 mod_gzip_min_http 1000 mod_gzip_handle_methods GET mod_gzip_item_include file \.html$ mod_gzip_item_include file \.jsp$ mod_gzip_item_include file \.do$ mod_gzip_item_include mime text/html mod_gzip_item_include mime text/plain mod_gzip_item_include mime application/x-javascript mod_gzip_item_include mime text/css mod_gzip_item_include mime text/xml mod_gzip_item_include …
Problem with openssl and Compiling Apache 2.2.11
Ursache ist, dass die Pfade richtig gesetzt werden müssen, damit ld den Parameter -lssl kennt. export LD_LIBRARY_PATH=”/www/hans/src/openssl-0.9.8j/” export LIBS=”-L/www/hans/src/openssl-0.9.8j” export CPPFLAGS=”-I/www/hans/src/openssl-0.9.8j/include/openssl” echo $LD_LIBRARY_PATH /www/jamba/src/openssl-0.9.8j/:/usr/lib/ echo $LIBS -L/www/jamba/src/openssl-0.9.8j echo $CPPFLAGS -I/www/jamba/src/openssl-0.9.8j/include/openssl
Issues on MaxClients Directive
WARNING: MaxClients of 3000 exceeds compile time limit of 2048 servers, lowering MaxClients to 2048. To increase, please see the HARD_SERVER_LIMIT define in src/include/httpd.h. Why increase MaxClients to 2048? Apache 1.x is non-threaded, so increasing MaxClients beyond 256 usually results in lower performance; often dramatically lower performance. At a prior job I worked with a …
setting Apache 2 ENVIRONMENT VARIABLES
in /etc/apache2/envvars # envvars-std – default environment variables for apachectl # # This file is generated from envvars-std.in # export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2.pid umask 002
GZIP Log Format
LogFormat “\”%h\” \”%{HOST}i\” \”%u\” \”%t\” \”%r\” \”%>s\” \”%b\” \”%{Referer}i\” \”%{User-Agent}i\” \”%{Connection}i\” \”%{Connection}o\” \”%{Content-Type}o\” \”%T\” \”PID:%P\” \”%{mod_gzip_result}n\” \”%{mod_gzip_input_size}n\” \”%{mod_gzip_output_size}n\” \”%{mod_gzip_compression_ration}n\”” JAMBA_BASIS_LOGFORMAT_GZIP
Using mod_cband to limit bandwidth per vhost
mod_cband (http://cband.linux.pl) can do this from 0.9.6.0 version! You should use CBandExceededSpeed directive to slow down pages when the bandwidth is exceeded 🙂 See: http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling http://www.icewalkers.com/Linux/Software/524590/mod_cband.html http://www.montanalinux.org/mod_cband.html http://www.uno-code.com/?q=node/64
SSL error solution
If an SSL error goes like this: In Browser: (Error code: ssl_error_rx_record_too_long) or in log file: [error] [client 81.19.201.7] Invalid method in request \\x16\\x03\\x01 Solution: Include the following directive in vhost: SSLEngine on That was it . 😉
MPM ‘worker’ configuration (Apache2)
Directive Description Default (worker.MPM) ===================== =============================================================================== ==================== ListenBackLog Maximum length of the queue of pending connections 511 . MaxClients Global maximum number of connections that will be processed simultaneously 400 MaxClients SHOULD NOT be lower than (ServerLimit) x (ThreadsPerChild). Normally they should be equal. . ServerLimit Upper limit on configurable number of processes (children) 16 …
To test WAP web site with telnet
telnet http://address 80 GET / WML/1.2
Logging Apache Access logs through syslogd
Error logs can be logged very easyly to syslig using the following ErrorLog syslog:local1 Access logs must use a pipe-to-script trick as follows: In Apache config: CustomLog |/usr/local/apache/bin/apache_syslog combined As script in system: Content of /usr/local/apache/bin/apache_syslog ——————————————— logger -i -p local3.info -t TEST-APACHE ——————————————— chmod 755 /usr/local/apache/bin/apache_syslog
Brute force test Apache
apt-get install siege or apt-get install apache2-utils and use the program ‘ab‘ eg. /usr/sbin/ab -n 100 http://yoursite.com/
Running mod_gzip, mod_rewrite, and mod_proxy together in Apache 1.3.x
When using RewriteRule ….[P] with mod_gzip there are often problems To resolve this add the following directive to mod_gzip ———————————————– mod_gzip_item_include handler proxy-server ———————————————– mod_gzip_item_include mime “application/x-httpd-php.*” mod_gzip_item_include mime httpd/unix-directory mod_gzip_item_include handler ^server-status$ mod_gzip_item_exclude file \.css$ mod_gzip_item_exclude file \.js$ mod_gzip_item_exclude reqheader “Via:.*1\.0 PROXY” mod_gzip_item_exclude reqheader “Via:.*1\.0 lavoisier \(NetCache NetApp\/5\.0\.1R2\)”
Examples of mod_security diretives
SecFilterEngine On SecFilterScanPOST On SecFilterSelective “POST_PAYLOAD” “BoesesWort” “deny,log,status:412” # Ersetze BoesesWort durch das Wort, welches du sperren willst. # Speichere die Textdatei unter dem Namen .htaccess (den führenden Punkt nicht vergessen) SecFilterSelective “POST_PAYLOAD” “AnderesBoesesWort” “deny,log,status:412” # Alternative SecFilterSelective “POST_PAYLOAD” “BoesesWort” “deny,log,redirect:http.//www.deinedomain.de/seite.html”
Using curl to test PUT method to upload to web server
curl -u user:pass -T /home/guest/test.txt http://my.server.com:8082/upload/
MOD_JK configuration directives
see: http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html The following directives are normally inserted in workers.properties file connection_pool_minsize (default 0) defines, how many idle connections remain when the pool gets shrinked. By default this is half of the maximum pool size. connection_pool_size (default 0) We generally do not recommend to use this attribute in combination with Apache httpd. For Apache httpd …
Logging gzip compression factor of files
LogFormat “%h %l %u %t \”%r\” %>s %b mod_gzip:%{mod_gzip_result}n In:%{mod_gzip_input_size}nOut:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct.” full_plus_gzip [17:29:14] CustomLog /var/log/httpd/mod_gzip.log full_plus_gzip Example of log entry: /reviews/cooling/HSR2_4.html HTTP/1.1″ 200 6289 mod_gzip: DECHUNK:OK In:23352 Out:6289:74pct.
Checkig the loading time a web site without loading its objects
date +%S.%N;w3m -dump http://www.mysite.de &>/dev/null;date +%S.%N
Selecting filtering what can be logged ‘per request’ level
SetEnvIfNoCase Request_URI “^/string to exclude/” drop and then between and CustomLog /var/log/httpd/www.mydomainname.com-access_log combined env=!drop
To UNSET an environment variable using SetIfEnv
eg. SetEnvIfNoCase Request_URI “.*\.html” !NOLOG Unsets the previously set NOLOG environment variable
Logformat code list
%…a: Remote IP-address %…A: Local IP-address %…B: Bytes sent, excluding HTTP headers. %…b: Bytes sent, excluding HTTP headers. In CLF format i.e. a ‘-‘ rather than a 0 when no bytes are sent. %…c: Connection status when response was completed. ‘X’ = connection aborted before the response completed. ‘+’ = connection may be kept alive …
To connect to SSL apache from command line
openssl s_client -connect localhost:443 -state -debug GET / HTTP/1.0
Tool to unstick MySQL Replicators.
# I’m managing an infrastructure with a number of databases who # (for codified reasons that I cannot influence) suffer from this situation often. # So, I’ve written a cron script to manage the situation. # Does anyone see any foreseeable issues with this logic (see below)? # —————————————– SCRIPT —————————————– #!/bin/bash ## Tool to …
Slave rebuild from live slave.
It is also possible to set up a slave by dumping an existing slave of the master. To do this, use the following procedure on the existing slave: 1.Stop the slave’s SQL thread and get its current status: mysql> STOP SLAVE SQL_THREAD; mysql> SHOW SLAVE STATUS; 2.From the output of the SHOW SLAVE STATUS statement, …
PROBLEM: Could not find target log during relay log initialization
SOLUTION: delete relay bin file in slave and try slave stop ; CHANGE MASTER TO master_log_file=’name_of_current_file_on_master’,master_log_pos=4; slave start; it will download play again the file IMPORTANT: Make sure the master log file is the one that was being read by the slave when the error occured, otherwise you loose data.
FULL Manual rebuilding of SLAVE MySQL server mysql02 from Master mysql01
On mysql01 (MASTER): ——————– mysqldump -u root -p –single-transaction –flush-logs –master-data=2 –all-databases –delete-master-logs | gzip | ssh mysql02 ‘cat | gunzip >/var/lib/mysql_temp.sql’ echo “SHOW MASTER STATUS;” | mysql -p -u root Note the filename eg. mysql-bin.000299 we will use it later on mysql02 On mysql02 (SLAVE): ——————- – Changed the following config is in /etc/mysql/my.cnf …
MySQL replication issues
Good links: =========== http://www.howtoforge.com/how-to-repair-mysql-replication MySQL recover from Backup .sql data ====================================== mysql -u root -p dbName backup-dbNameDump.sql ———– Very useful in slave ————————————————————– slave-skip-errors=126,1062 126 = the ambiguous ‘unknown error on master’ typically caused by tables in dis-repair on master. 1062 = duplicate entry (happens all the time on high capacity db in master-master setup)
Hide MC editor tabs or traiting spaces
In ~/.mc/ini editor_visible_spaces=0 editor_visible_tabs=0
Burning iso cd under Ubuntu
wodim –devices wodim dev=/dev/cdrw -v -data cd_image.iso More Brning features under Ubuntu https://help.ubuntu.com/community/CdDvd/Burning
SSH File system mounting
Mounting: sshfs -Cuser@severname:/path/to/mount /local/mount/point -o follow_symlinks -o allow_other Unmounting: fusermount -u /local/mount/point
Find out which UBUNTU version is installed
Extracting the last character of a string
echo “/home/jadmin/server/server005A1” | sed ‘s/.*\([0-9]\)\s*$/\1/g’ Response: 1
apt-get signatures problem:
Probleme mit GPG Wenn apt-get update eine Fehlermeldung in der Art liefert ————- GPG error: http://security.debian.org testing/updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 010908312D230C5F ————- hilft: apt-get install debian-archive-keyring apt-key update
Running FTPs (NOT SSH based) with lftp and vsftpd
Needs to set the client as follows after connection established to limit the use of port and guarantee SSL transport of Data (default is still unencrypted) set port-range 1025-1025 set ftp:ssl-protect-data true
Formating text command
printf “%10s %10s\n” foo bar or even better cat /etc/fstab | column -t
Burning MP3 files with K3B
To burn MP3 files with K3B install the libk3b2-extracodecs.
Installing amd64 Foxpro Java Plugin
FROM: Java 6u12 bringt 64bit Plugin für Ubuntu / Linux Java 6u12 wurde von Sun für den produktiven Einsatz freigegeben. Vermutlich nicht zuletzt dank JavaFX wurde nun nach sechs Jahren(!) damit der Bug 4802695 geschlossen: Es gibt nun ein 64 bit Java Plugin für Linux und auch für Windows. Endlich! Wer Ubuntu 8.10 Intrepid hat, …
Starting vi for editing Apache
vim -c “syntax enable” -c “set syntax=apache” $FILE_NAME