Friday, April 18, 2014

qemu repo centos6

http://download.opensuse.org/repositories/home:/billcavalieri:/QEMU/CentOS_CentOS-6/


Wednesday, March 26, 2014

Check RAID

check RAID for HP server:
#cat /proc/driver/cciss/cciss*

check Disk seen by OS:
# fdisk -l


Monday, March 10, 2014

Littleutils on debian

1.download
wget http://downloads.sourceforge.net/project/littleutils/littleutils-source/1.0.27/littleutils-1.0.27.tar.bz2
 
2.install dependencies
apt-get install gifsicle pngcrush lzip libpng12-0 libpng12-dev libjpeg-progs p7zip-full
 
3.uncompresss
./configure --prefix=/usr
make
make install
make install-extra
 
4.selesai 

Friday, February 7, 2014

From GUI to Text

Edit /etc/default/grub with your favorite editor,
sudo nano /etc/default/grub

Find out this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to:
GRUB_CMDLINE_LINUX_DEFAULT="text"

Update Grub:
sudo update-grub
 
 

Thursday, February 6, 2014

Install desktop on ubuntu server 12.04

xfce4:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install ubuntu-desktop tightvncserver xfce4 xfce4-goodies
reboot

---------------

Tuesday, January 7, 2014

xfce4 vnc debian

install debian
install xfce4
install vnc4server

nano ~/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startxfce4 &

reboot

Monday, January 6, 2014

Tuesday, November 26, 2013

KVM Debian 7

debian 7,char,minimal,ssh only
apt-get update
apt-get upgrade
apt-get install lxde

nano /etc/inittab--remark getty
/etc/init.d/bluetooth stop
update-rc.d bluetooth remove

reboot

apt-get install -y zenity cabextract

apt-get install wine
wget http://winetricks.org/winetricks
chmod +x winetricks
./winetricks
[install mcf4?.dll/windows component]
= install all windows =






-----comment out
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

Wednesday, November 20, 2013

VPS DEBIAN 7

apt-get install nano -y

nano /etc/apt/sources.list

#Dotdeb repo
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
--------- 

wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -

apt-get install -y nginx-full
/etc/init.d/nginx start
mkdir /var/www
chown www-data:www-data /var/www
nano /etc/nginx/nginx.conf
[...]
worker_processes  4;
[...]
    keepalive_timeout   2;
[...]
-----------
 
nano /etc/nginx/sites-available/default
[...]
   index index.php index.html index.htm; 
[...] 
 
apt-get install php5 php5-fpm php5-mysql php5-gd

nano /etc/php5/fpm/php.ini
[...]
; http://php.net/cgi.fix-pathinfo
cgi.fix_pathinfo=0 
[...]
 
apt-get install mysql-server-5.5

copy nginx.conf, afei.cnf

cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = n4aSHUP04s1J32X5
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
user     = debian-sys-maint
password = n4aSHUP04s1J32X5
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr
lihat[client]
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'n4aSHUP04s1J32X5';
/etc/init.d/mysql restart  


--------
apt-get install gcc make
apt-get install gifsicle pngcrush lzip libpng12-0 libpng12-dev libjpeg-progs p7zip-full

download littleutils-1.0.30.tar.bz2

    tar jxvf littleutils-1.0.30.tar.bz2
    cd littleutils-1.0.30
    ./configure
    make
    make install
    make install-extra






=====

Upgrade Debian 6 to 7

apt-get update -y && apt-get upgrade -y

echo "
deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main
" > /etc/apt/sources.list

To update the package list, enter:
apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y

reboot

cat /etc/issue

backup:
tar zcpf /tmp/semua.tar.gz  --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=tmp .

restore:

tar zxpf /[folder]/semua.tar.gz  /




Tuesday, November 19, 2013

alternative dns low memory

named = high memory
using nsd

http://www.promovps.com/2011/11/tutorial-vps/low-resource-dns-name-server-using-nsd.html

VNC on DEBIAN 7

apt-get update -y && apt-get upgrade -y

apt-get install lxde xfonts-100dpi xfonts-100dpi-transcoded xfonts-75dpi xfonts-75dpi-transcoded xfonts-base

#Installing and Configuring vnc4server
apt-get install vnc4server nano

# Now we need to add a user
adduser vncuser

# lakukan ini
mkdir -p /etc/vncserver
echo "
VNCSERVERS=\"1:vncuser\"
VNCSERVERARGS[1]=\"-geometry 1024x768\"
" >  /etc/vncserver/vncservers.conf

# copy paste
touch /etc/init.d/vncserver
chmod +x /etc/init.d/vncserver
nano /etc/init.d/vncserver

# Contents of /etc/init.d/vncserver

#!/bin/bash
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: vnc server
# Description:
#
### END INIT INFO

unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"

start() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Starting $prog: "
 ulimit -S -c 0 >/dev/null 2>&1
 RETVAL=0
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 DISP="${display%%:*}"
 export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
 su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
 fi
 done
}

stop() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Shutting down VNCServer: "
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 export USER="${display##*:}"
 su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
 fi
 done
 echo -e "\n"
 echo "VNCServer Stopped"
}

case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

# Register the service

update-rc.d vncserver defaults 99

# Now we must create a VNC connection password for our user. First we will use the su command to login to the user's shell and use the vncpasswd to set the password.

su vncuser
vncpasswd

# We need to start then stop the server to generate a configuration file

vncserver :1; vncserver -kill :1

# After we've generated the configuration file, we must edit it so that LXDE is loaded when we connect

nano ~/.vnc/xstartup

# Edit the file or replace its contents so that they look like the code below and save

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
lxsession -s LXDE &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &

# Drop back to root shell

exit

# Start the VNC service

service vncserver start

Connecting to your VNC server from your local PC

Monday, November 11, 2013

Top 20 Affiliate Marketing

        Network
        Survey comments or notes
        1
        Rakuten Linkshare
        linkshare.com
        Rakuten Linkshare
        A focus on big etail, smaller merchants and advertiser service has kept Rakuten LinkShare on top for another year.
        2
        Commission Junction
        cj.com
        Commission Junction
        CJ is professional, consistent and trusted. A very close competition between CJ and Linkshare this year.
        3
        Amazon
        affiliate-program.amazon.com
        Amazon
        Amazon offers a lowish percentage per sale but their ease of use and massively broad product offering makes them very popular
        4
        ClickBank
        clickbank.com
        clickbank
        Everybody’s favorite way to get into selling their own digital product, ClickBank continues to attract a lot of small merchant support.
        5
        ShareASale
        shareasale.com
        shareasale
        Generates a lot of loyalty and trust from publishers and advertisers. A network that is perceived as doing things the way they should be done.
        6
        AvantLink
        avantlink.com
        avantlink
        A very professional network that gained ground in this year’s survey. AvantLink is doing a lot right.
        7
        Google Affiliate Network
        google.com
        google
        The Google Affiliate Network inevitably benefits from the vast scale of Google’s portfolio. A huge network.
        8
        RevenueWire
        revenuewire.com
        revenuewire
        A network specializing in digital products, built on elevated principles of sustainable and ethical commerce.
        9
        oneNetwork Direct
        onenetworkdirect.com
        onenetworkdirect
        Digital River’s oneNetworkDirect is the leader in software sales with the industry’s best network technology and offices worldwide.
        10
        Pepperjam
        pepperjamnetwork.com
        pepperjamnetwork
        Renowned as a network helpful to newbies, Pepperjam also has a loyal following of super-affiliates and merchants.
        11
        LinkConnector
        linkconnector.com
        linkconnector
        An established network offering many trusted merchant brands ranging from Internet Top 500 Retailers to smaller niches.
        12
        Affiliate Window
        us.affiliatewindow.com
        affiliatewindow
        Winners of Best CPS Network at the 2012 Affiliate Marketing Awards, they are the biggest affiliate network in Britain, and now making a splash in the U.S.
        13
        eBay Partner Network
        ebaypartnernetwork.com
        ebaypartnernetwork
        eBay’s affiliate network with the Quality Click Pricing (QCP) payout system.
        14
        Avangate
        avangate.com
        avangate
        Another award winning network out of Europe with an emphasis on software and SaaS
        15
        TradeDoubler
        tradedoubler.com
        Founded in Sweden in 1999, it pioneered affiliate marketing in Europe and remains the most successful pan-European performance marketing company.

        16
        zanox
        zanox.com
        zanox
        Europe’s biggest affiliate network.

        17
        Millionaire Network
        millionairenetwork.com
        millionairenetwork
        Millionaire Network is an invitation-only affiliate network completely dedicated to advertiser success.
        18
        PeerFly
        peerfly.com
        peerfly
        Came from nowhere two years ago and zoomed in popularity this year. Great staff and an excellent platform.
        19
        WebGains
        webgains.com
        webgains
        Strong contender out of the UK, with some excellent core values that should keep them around for a long time.
        20
        AdCommunal
        adcommunal.net
        adcommunal
        The best affiliate network in the AdCanadian internet marketing industry today

Tuesday, November 5, 2013

VPS 64Mb Debian 6

root@trial269-deb:~# free
             total       used       free     shared    buffers     cached
Mem:         62092      59828       2264          0      12460      33004
-/+ buffers/cache:      14364      47728
Swap:       131064          0     131064
root@trial269-deb:~#


Tuesday, October 29, 2013

Remove unused function javascript

Cek this :
http://code.google.com/p/closure-compiler/

Thursday, September 26, 2013

gzip all files in subfolder

find . -name '*.txt' | while read file; do gzip -9 -c "$file" > "$file.gz"; done

find . -name '*.js' | while read file; do gzip -9 -c "$file" > "$file.gz"; done


find . -name '*.css' | while read file; do gzip -9 -c "$file" > "$file.gz"; done

Tuesday, September 3, 2013

Lighttpd setup

1.multi domain
===========
$HTTP["host"] =~ "(^|\.)domain\.com$" {
   url.rewrite-once = (
      # Exclude additional specific directories from rewrites
      "^/(files)/?(.*)" => "$0",
      "^/(mysql)/?(.*)" => "$0",

      "^/(wp-.+).*/?" => "$0",
      "^/(favicon.ico)" => "$0",
      "^/(sitemap.xml)" => "$0",
      "^/(xmlrpc.php)" => "$0",
      "^/(.+)/?$" => "index.php/$1"
   )
}

Tuesday, August 27, 2013

Stop image hotlinking - lighttpd

Let us say you would like to prevent hotlinking for domain theos.in:
=> Allow all image refer from your own domain theos.in and other domains such as nixcraft.com or cyberciti.biz
=> Allow image bot crawlers/ useragent such as msnbot-media (MSN), Mediapartners-Google (Google) and Yahoo-MMCrawler (Yahoo)
=> Allow image refer from images.google.com, images.search.yahoo.com etc
=> Allow feedburner to burn your feed and images
Open your lighttpd.conf file. Locate virtual domain configuration section for domain theos.in:
# vi /etc/lighttpd/lighttpd.conf
Find virtual domain configuration and append code as follows:
$HTTP["referer"] !~ "^($|http://.*\.(theos\.in|^$|google\.*|yahoo\.*|msn\.*|nixcraft\.com|cyberciti\.biz|cricketnow\.in))" {
$HTTP["useragent"] !~ "msnbot-media" {
$HTTP["useragent"] !~ "Mediapartners-Google" {
$HTTP["useragent"] !~ "Yahoo-MMCrawler" {
$HTTP["useragent"] !~ "FeedBurner" {
url.access-deny = ( ".jpg", ".jpeg", ".png", ".gif", ".avg", ".mpeg" )
}
}
}
}
}

Save and close the file. Restart lighttpd webserver:
# /etc/init.d/lighttpd restart
Final configuration includes support for MSN, Google, Yahoo cache :)
$HTTP["referer"] !~ "^($|http://.*\.(google\.*|yahoo\.*|msn\.*|cyberciti\.biz|msnscache\.com/.*))" {
$HTTP["referer"] !~ "^($|http://theos\.in|^$|nixcraft\.com|cricketnow\.in)" {
  $HTTP["useragent"] !~ "msnbot-media" {
  $HTTP["useragent"] !~ "Mediapartners-Google" {
  $HTTP["useragent"] !~ "Yahoo-MMCrawler" {
  $HTTP["useragent"] !~ "FeedBurner" {
  $HTTP["referer"] !~ "^($|http://.*/.*(q=cache.*|p=cache.*))" {
     url.access-deny = ( ".jpg", ".jpeg", ".png", ".gif", ".ico" )
       }
      }
     }
    }
   }
  }
 }
}
It can get more complicated but above is sufficient for most websites ;)

Monday, August 5, 2013

VPS RamNode

1.Reinstall dg Debian 6 32bit, password root diset yg panjang

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      21924     109148          0          0      14168
-/+ buffers/cache:       7756     123316
Swap:       131072          0     131072

2.update dan upgrade
apt-get update && apt-get upgrade

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072     113676      17396          0          0      99888
-/+ buffers/cache:      13788     117284
Swap:       131072       4132     126940

3.uninstall apache2
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove
sudo rm -rf /etc/apache2
shutdown -r now

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      24180     106892          0          0      11648
-/+ buffers/cache:      12532     118540
Swap:       131072          0     131072

4.install lighttpd
apt-get install lighttpd

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      50228      80844          0          0      34176
-/+ buffers/cache:      16052     115020
Swap:       131072          0     131072

5.aktifkan simple vhost
lighttpd-enable-mod simple-vhost

create folder sesuai host:
mkdir -p /var/www/namadomain.com/html

6.edit /etc/lighttpd/conf-enabled/10-simple-vhost.conf
server root=/var/www/
doc root=/html/
default host =namadomain.com

7.buat link utk subdomain
ln -s namadomain.com www.namadomain.com

test dg buat index.html di /var/www/namadomain.com/html/index.html



/etc/init.d/lighttpd force-reload

8.install php n mysql, password root = huruf angka dan karakter simbolik

/etc/init.d/lighttpd force-reload
apt-get install mysql-server php5-cgi php5-mysql

bila perlu:
apt-get install php5-gd php5-mcrypt php5-curl

root@ns1:/etc/lighttpd# free
             total       used       free     shared    buffers     cached
Mem:        131072     122216       8856          0          0     106028
-/+ buffers/cache:      16188     114884
Swap:       131072      14320     116752

9.setup php di lighttpd
cat > /etc/lighttpd/conf-enabled/10-cgi-php.conf
server.modules += ("mod_cgi")
cgi.assign = (".php" => "/usr/bin/php5-cgi")

reload

test:
echo '<?php phpinfo(); ?>' > /var/www/namadomain.com/html/phpinfo.php

             total       used       free     shared    buffers     cached
Mem:        131072     127552       3520          0          0     109460
-/+ buffers/cache:      18092     112980
Swap:       131072      13048     118024

10.update mysql conf, hilangkan innodb
cat > /etc/mysql/conf.d/lowendbox.cnf
[mysqld]
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
ignore_builtin_innodb
default_storage-engine=MyISAM
^D

restart= /etc/init.d/mysql restart

Bila tidak ada user=root, lakukan:

--cek password
cat /etc/mysql/debian.cnf

mysql -u debian-sys-maint -p
--masukin password disini

--cek
SELECT u.user FROM mysql.user u

--jalanlan: jgn lupa ganti PASSWORDANDA
INSERT INTO mysql.user VALUES ('localhost','root',password('PASSWORDANDA'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);



--------
free
             total       used       free     shared    buffers     cached
Mem:        131072     120580      10492          0          0     109524
-/+ buffers/cache:      11056     120016
Swap:       131072       8968     122104

11.butuh ssh? pakai dropbear

12.install wp
mysqladmin -uroot -p[password] create [db]
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz -C /var/www/namadomain.com/html
mv * ../
mv wp-config-sample.php wp-config.php
edit [username,password dan db]
setup wp

13.backup
 tar zcpf /tmp/semua.tar.gz  --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=tmp .


jangan lupa titik di belakangnya
---















Saturday, August 3, 2013

Mempercepat website

Gunakan:

http://yslow.org
https://developers.google.com/speed/pagespeed/

Minify js,css
Gambar2 di compress
Hilangkan space,ganti baris
Cache
Pake Gzip compression
Pake VPS SSD bukan SSD Cache

Manual : oprek php nya => buat fix utk website sendiri

Apa lagi?

Tool online
1. http://tools.pingdom.com/fpt/
2. http://gtmetrix.com/
3. http://www.webpagetest.org/

copy paste dari tempat lain:
1. .htaccess dari HTML5Boilerplate (http://html5boilerplate.com/). Ini yg harus pertama dilakukan, krn mengubah skor PageSpeed dari 34 menjadi 87!!!
2. CSS Sprite untuk image2 yg sering dipakai, seperti yg ada di folder /themes/default/images/
3. Ganti image menjadi DataUrl. Lihat pro-cons-nya, krn DataUrl tidak support IE7 ke bawah.
4. Semua image harus punya atribut HEIGHT & WIDTH. ada bbrp image Opencart yg gak ada, jadi harus utak-atik kode.
==> disini cara nya http://forum.opencart.com/viewtopic.php?f=121&t=20057
5. Compress semua image pakai Lossless, contoh pakai JPEGMini (http://www.jpegmini.com/). Problemnya, sewaktu Opencart resize image tsb, hasilnya tidak dikompresi dengan baik.
6. Gabung semua Javascript & CSS. Musti hati2 untuk combine JS dan CSS terutama mengenai uturannya. Hasilnya kalau bisa hanya 1 javascript dan 1 css. Banyak file javascript yg tidak dipakai tetapi ada di folder.
7. Minify Javascript & CSS. Kalau bisa pakai aplikasi, tetapi bisa jg pakai Google Minify (http://code.google.com/p/minify/).
8. GZIP Compression. Pastikan web hostingnya menyalakan modul ini.

referensi:
http://developer.yahoo.com/performance/rules.html