November 29th, 2011 |
Recently a particular folder in a site started coming up with blank php pages and the root cause being Segmentation fault after memory exhaustion. The subfolder contents would only come up after doing a restart of apache. So something tried to access a region of memory that it did not have rights to. May be [...]
November 29th, 2011 |
If you manage several OpenVZ containers, here is a simple bash script to keep the OpenVZ containers upto date. #!/bin/bash # vzyum_updates.sh # updates VEs VE_LIST=$(/usr/sbin/vzlist -H -o veid | grep -v Warning) for VE in ${VE_LIST} do /usr/bin/vzyum $VE update done exit 0 Incoming search terms:openvz bash scripts (1)
November 29th, 2011 |
You might come across a disc image in the BIN/CUE format. BIN/CUE files can be directly burned to CD via K3B, however if you want to convert to an iso, a command line application called bchunk can be used. # yum –enablerepo=extras install bchunk # bchunk image.bin image.cue image.iso Incoming search terms:convert bin to iso [...]
November 29th, 2011 |
Package mpack is required in order to extract the backup contents. # apt-get install mpack # zcat /path/to/backup_file > backup_file.mime # munpack backup_file.mime The result is a set of tar and sql files that contain domains’ directories and databases. Untar the directory as needed. For example, to restore the httpdocs folder for the DOMAIN.TLD domain: [...]
November 29th, 2011 |
In SQL Server Management Studio navigate to your database. Right click it and select “Tasks” -> “Generate Scripts” “Next” Select your database from the list “Next” Select “Stored Procedures” “Next” “Select All” “Next” “Script to new Query Window” “Next” “Finish” Give it a while. Then when complete, at the very top of the script put [...]
November 29th, 2011 |
Changing the collation for all tables in a MySQL database can be time consuming depending on how many tables you have. That’s why we recommend using the following PHP script for changing the collation for all tables at a time: <?php $db = mysql_connect(‘localhost’,’myuser_mydbuser‘,’mypassword‘); if(!$db) echo “Cannot connect to the database – incorrect details”; mysql_select_db(‘myuser_mydbname’); [...]
November 29th, 2011 |
Add panic=10 to the kernel command line to reboot with 10 seconds of a kernel error. Be careful with this when setting up new kernels. It’s possible to change it later with sysctl, or by writing to /proc: # echo 10 > /proc/sys/kernel/panic To make it permanent, edit /etc/sysctl.conf and add the below line: kernel.panic [...]
November 29th, 2011 |
When converting from IDE to AHCI in the BIOS to include additional drives, I would get a kernel panic… as by default the bios was setup with the drives as IDE. Booted using existing IDE and created a new kernel image with support for AHCI via the –preload option to manually specify modules support: # [...]
November 29th, 2011 |
Here’s is a simple shell script to run a weekly lvm snapshot dump of all OpenVZ containers using the vzdump utility: #!/bin/bash # ve_dumps.sh # Dump all VEs# Todays’ date DATE=$(date +%d) # Paths BAK_PATH=/opt/bak/vz_dumps # Week of month BAK_DIR=$(cal | awk -v date=”${DATE}” ‘{ for( i=1; i <= NF ; i++ ) if [...]
November 28th, 2011 |
Use echo command to display text or value of variable. echo [options] [string, variables...] Displays text or variables value on screen. Options -n Do not output the trailing new line. -e Enable interpretation of the following backslash escaped characters in the strings: \a alert (bell) \b backspace \c suppress trailing new line \n new line [...]