Category Archives: Linux

Linux Kernel – Unknown target with make rpm or rpmbin-pkg

If you get the error saying “–target: unknown option”, install the rpm-build package and retry. sudo yum install -y rpm-build make clean make rpm Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet … Continue reading

Posted in Commands, Linux, Operating Systems | Tagged , , , | Leave a comment

Varnish init script

*To update with more useful information* Bash script to handle Varnish start, stop, restart and reload. Built after Varnish 3 was compiled from source. #!/bin/bash   # description: Varnish Start Stop Restart   # processname: varnishd   # chkconfig: 234 … Continue reading

Posted in Linux, Varnish | Tagged , | Leave a comment

Apache memory used per process

*To update with more useful information* ps -ylC httpd –sort:rss | grep -v RSS | awk ‘{print "Proccess "++n" is using "$8/1024"MB"} {sum+=$8}; END {print "\nTotal Memory Used: "sum/1024/1024"GB"}’; Output: Proccess 1 is using 37.1914MB Proccess 2 is using 118.828MB … Continue reading

Posted in Apache, Commands, Linux | Tagged , , | Leave a comment

Very simple MySQL backup bash script

This code backups up mysql databases and gzips them into the current working directory. If you want to backup the mysql table, remove it from the for loop. #!/bin/bash usage(){ echo “Usage $0 <mysql_user> <mysql_password> [host]” exit 1 } if … Continue reading

Posted in bash, Commands, Linux, MySQL | Leave a comment

Installing php-ffmpeg on CentOS 5.x

This can be a pain due to a bug in the ffpmeg_frame.c file … here are the commands to get up and going yum -y install ffmpeg ffmpeg-devel wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download tar jxvf ffmpeg-php-0.6.0.tbz2 sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGBA/g’ ffmpeg-php-0.6.0/ffmpeg_frame.c cd ffmpeg-php-0.6.0 && … Continue reading

Posted in Commands, Internet, Linux, PHP | Tagged , , , | Leave a comment

Search / Replace in files with Linux

I used this command to search over some Apache 2 vhost files to change them from port 8080 to port 80 with Debian. find /etc/apache2/sites-enabled -name “*com” -exec sed -i ‘s/8080/80/g’ {} \; Bookmark on Delicious Digg this post Recommend … Continue reading

Posted in Commands, Linux | Leave a comment

Low Level Format Disk Drive with Linux

Doing a log level format with linux is super easy. Make sure the drive you want to format is not mounted and determine the device in /dev/ i.e. /dev/sdb Enter the following command to turn all the bits on the … Continue reading

Posted in Linux, Security | Leave a comment

Use HackIt and Revolution ROM to sexify your HTC Inspire

Got an HTC Inspire 4G? Tired of all the bloatware and running apps. Tired of have to kill those apps over and over? Root your phone (root is the superuser account in Linux, which Android runs on)! This voids all … Continue reading

Posted in Android, Electronics, Internet, Linux, Operating Systems, Security | Tagged , , | Leave a comment

Use mogrify to rotate and scale your images on the Linux command line

First, make sure you have ImageMagick installed: #Ubuntu/Debian sudo apt-get install imagemagick #RedHat, Fedora, CentOS sudo yum install imagemagick After that, it’s super easy. mogrify -resize 800 -rotate 90 image.jpg The above command would resize image.jpg to 800 pixels wide … Continue reading

Posted in Commands, Linux | Tagged , , , | Leave a comment

Simple PostgreSQL and data backup script for Linux bash

backup-script.sh #!/bin/bash export PGPASSWORD=SUPERSECRETPASSWORD thedate=`date –rfc-3339=date` echo "Making tarball for $thedate" filename="$thedate.tar.gz" `pg_dump -U postgres the_database > /var/www/db_dump.sql` tar czf /backups/$filename /var/www Above is a simple bash script to backup a directory after making a PostgreSQL data dump. I left … Continue reading

Posted in bash, Linux, PostgreSQL | Tagged , | Leave a comment