Category Archives: Linux

This is where all my linux pages will live.

Using blackbox to change multiple dns records for account

browse to https://clouddns.dcx.rackspace.com/zones/search Enter the account number and click Exact Search copy the lines from the console to a file called domainlist.txt domainlist.txt=================== 1 View accidentlawyerny.net 2 View acnestories.com 3 View acnewonders.com 4 View aromatherapyrecipe.com 5 View attorneyny.us 6 View … Continue reading

Posted in Linux | Comments Off on Using blackbox to change multiple dns records for account

Make fail2ban send emails

Edit /etc/fail2ban/jail.conf as follows: action = %(action_)s gets changed to action = %(action_mw)s which causes fail2ban to execute an action shortcut that sends mail: #########section of jail.conf############################################ # Action shortcuts. To be used to define action parameter # The simplest … Continue reading

Posted in Linux | Comments Off on Make fail2ban send emails

Changing munin password

To change the serverinfo password for munin, htpasswd /etc/munin/munin-htpasswd serverinfo To test, go to http://IP/munin

Posted in Linux | Comments Off on Changing munin password

Adding usb device to qemu in kvm

HOWTO: Use USB devices in Virtual Machine Manager with QEMU

Posted in Linux | Comments Off on Adding usb device to qemu in kvm

Deny POST to a site in .htaccess

 <limit POST OPTIONS>   Order deny,allow   Deny from all  </limit>

Posted in Linux | Comments Off on Deny POST to a site in .htaccess

Useful find Commands

The find command is very verstile, and I use it all the time. Here are the parameters that I use most often:-name <string> Finds files in specified directory whose name matches (case-sensitive) string-iname <string> Finds files in specified directory whose … Continue reading

Posted in Linux | Comments Off on Useful find Commands

Method to keep private libraries private

One method I have seen programmers (including myself) use to keep folks out of private libraries / include modules is to put a check in there. Easiest example: in index.php (or any script with permission to be called directly), this … Continue reading

Posted in Linux | Comments Off on Method to keep private libraries private

Recovering Corrupted InnoDB Table

Corrupted MySQL database: If you suspect data corruption in a MySQL database, First make a copy of the database for safe keeping: mysqldump –user=root post_planner > /tmp/post_plannerdb.sql Prove it: To prove that the database is corrupted, do: mysql> check database … Continue reading

Posted in Linux | Comments Off on Recovering Corrupted InnoDB Table

Restricting sshd by username

Step # 1: Open sshd_config file # vi /etc/ssh/sshd_config Step # 2: Specify a user Only allow user king to login by adding following line: AllowUsers king Step # 3: Restart sshd Save and close the file. In the above … Continue reading

Posted in Linux | Comments Off on Restricting sshd by username

Changing the MySQL timezone via PHP

If you don’t have root access in your mysql instance and want to change the time_zone, you’ll have to change it in the code: To have the time zone setup as you would like, you would you need to execute … Continue reading

Posted in Linux | Comments Off on Changing the MySQL timezone via PHP