• nginx + apache

    http://devkardia.com/easyblog/virtualmin-apache-and-nginx-reverse-proxy.html

    Read the rest of this entry »


  • kj

    grep -R 'htaccess' *


  • icecast on 80

    iptables -A PREROUTING -t nat –dst 8.8.8.8/32 -p tcp –dport 80 -j DNAT –to 8.8.8.8:8080

    iptables -A INPUT -p tcp -m state –state NEW –dport 80 –dst 8.8.8.8/32 -j ACCEPT


  • htaccess

    izveidot jaunu
    htpasswd -c /home/pwww/.htpasswd jerry
    labot esošo
    htpasswd /home/pwww/.htpasswd-users tom


  • bash lame convertor

     

    #!/bin/sh
    # name of this script: wav2mp3.sh
    # wav to mp3
    
    for i in *.wav; do
     if [ -e "$i" ]; then
       file=`basename "$i" .wav`
       lame -h -b 192 "$i" "$file.mp3"
     fi
    done

     


  • NGINX Random Error Page

    Ja jāšķiro pēc ip adresēm tad – $remote_addr

    http {
    split_clients $echo_request_uri $c_host {
    50% c1;
    50% c2;
    }

    server {
    location /data/ {
    error_page 404 = /data/$c1.html;
    error_page 403 = /data/$c1.html;
    }


  • sshfs mount

    sshfs root@10.233.10.212:/ /mnt/ssh/


  • nginx status page

    nginx -V | grep --color -o http_stub_status

    location /nginx_status {
    # Turn on nginx stats
    stub_status on;
    # I do not need logs for stats
    access_log off;
    # Security: Only allow access from 192.168.1.100 IP #
    allow 192.168.1.100;
    # Send rest of the world to /dev/null #
    deny all;
    }


  • MySQL utf-8

    [client]
    default-character-set=utf8

    [mysql]
    default-character-set=utf8

    [mysqld]
    collation-server = utf8_unicode_ci
    init-connect='SET NAMES utf8'
    character-set-server = utf8


  • Configure hostname

    You should double confirm the system hostname if it looks good. For example if this host is www.example.com, the /etc/hostname can be:
    host.example.com
    The /etc/hosts should also be:
    127.0.0.1 localhost
    127.0.1.1 host.example.com host

    Now reboot your system, and check the system hostname with command:
    hostname
    Ensure all APT source enabled

    By default some of your APT source may be disabled, so let’s enable them with:
    sed -i 's/^#\s*deb/deb/g' /etc/apt/sources.list
    Install Virtualmin with GPL installation script (not available yet on 2012-04-30)

    Just simply access http://www.virtualmin.com/download.html and download the Virtualmin installation script with wget:

    cd /tmp
    wget http://software.virtualmin.com/gpl/scripts/install.sh
    /bin/bash /tmp/install.sh