Wednesday, March 31, 2010

Firefox Autoconfig

http://mit.edu/~firefox/www/maintainers/autoconfig.html

Monday, March 29, 2010

Install nginx with php-frm and mysql


#!/bin/sh

sudo apt-get install nginx
cd /tmp
wget http://us.archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb
wget http://us.archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu38_3.8-6ubuntu0.2_i386.deb
sudo dpkg -i *.deb
sudo echo "deb http://php53.dotdeb.org stable all" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install php5-cli php5-common php5-suhosin php5-mysql php5-curl php-pear php5-imap php5-memcache php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
sudo apt-get install php5-fpm php5-cgi

echo > /etc/nginx/sites-enabled/default << EOF

server
{
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;

## Default location
location /
{
root /var/www/nginx-default;
index index.php;
}

## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$
{
access_log off;
expires 30d;
root /var/www/nginx-default;
}

## Parse all .php file in the /var/www directory
location ~ .php$
{
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k; }

## Disable viewing .htaccess & .htpassword
location ~ /\.ht { deny all; }
}
upstream backend { server 127.0.0.1:9000; }
EOF
/etc/init.d/php5-fpm start
/etc/init.d/nginx start

Tuesday, March 23, 2010

generate reasonable passwords at the commmand line


cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?='|fold -w 12| head -n 4| grep -i '[!@#$%^&*()_+{}|:<>?=]'

generate strong random passwords at the command line


cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?='|fold -w 12| head -n 4| grep -i '[!@#$%^&*()_+{}|:<>?=]'

remove serverbeach backdoor

when you lease a server from ServerBeach, they install a backdoor on your server. Here's how to remove it when you choose CentOS or similar redhat type system.

service sbadm stop
chkconfig --del sbadm
rm -f /etc/ssh/.sbadm_config
rm -f /usr/sbin/sbadm
rm -rf /usr/local/webmin-*
rm -f /etc/init.d/sbadm

Monday, March 22, 2010

perl modules

http://www.cpan.org/modules/by-module/

Wednesday, March 3, 2010

linux boot disk fun

note to self. never, ever, ever ...leave the custom linux boot disk you made, with the fancy all-in-one kickstart file, in the cd drive of your laptop and reboot.

do not allow it to persist in your cd drive, for even the most trivial length of time for which it is unnecessary...REMOVE IT.