Sunday, April 15, 2012

Time sync with NTP

 

  • Install NTP

apt-get install ntp

  • Update server list

vi /etc/ntp.conf

Example -

server 0.us.pool.ntp.org iburst
server 1.ca.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

  • Restart NTP

/etc/init.d/ntp restart

  • Monitor

ntpq -p

Setting server timezone on Debian

 

The interactive way

dpkg-reconfigure tzdata

The manual way

  1. echo 'Etc/UTC' > /etc/timezone or echo 'Asia/HongKong' > /etc/timezone
  2. dpkg-reconfigure --frontend noninteractive tzdata

Saturday, March 10, 2012

Install OpenVPN on Debian

source
First check whether your server supports the device dev/tun
  • # ls -al /dev/net/tun
  • You'll get results like the following if it supports
    # ls -al /dev/net/tun
    crw------- 1 root root 10, 200 Aug  1 14:12 /dev/net/tun
Then check if the device dev/tun is enabled
  • cat /dev/net/tun
  • You'll get results like the following if it is enabled
    # cat /dev/net/tun
    cat: /dev/net/tun: File descriptor in bad state
If it is enabled you should contact the VPS provider
Install OpenVPN
  • apt-get update to update the OS
  • apt-get install openvpn
Install OpenSSL
  • apt-get install openssl
  • mkdir /etc/openvpn/easy-rsa to make new directory
  • cp -rp /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa to copy the files to the new folder
  • cp -rp /usr/share/doc/openvpn/examples/sample-config-files/ /etc/openvpn/sample
Edit vars and change variable
  • cd /etc/openvpn/easy-rsa/
  • vi vars to edit the file named "vars"
  • OPTIONAL: Change KEY_SIZE to 2048
Run vars to export variable
  • sh vars
  • source ./vars to execute vars script
Make the certificate authority
  • ./clean-all to remove any previous keys
  • ./build-ca to build the certificate authority.
  • Press enter for each line it asks to confirm your details, but where it asks for "Common Name" change to your server name
Make server key
  • Type ./build-key-server <server hostname>
  • Press enter for fields to confirm and leave the "A challenge password" and "An optional company name" fields blank
Create VPN client .key and .crt
  • ./build-key <client hostname>
  • Press enter again for fields to confirm and leave the "A challenge password" and "An optional company name" fields blank. A different key is needed for each VPN client
  • ./build-dh This allows sharing between peers
Now copy relevant files and place in the correct folder
  • cd /etc/openvpn/easy-rsa/keys
  • cp <server hostname>.key /etc/openvpn/
  • cp <server hostname>.crt /etc/openvpn/
  • cp ca.crt /etc/openvpn/
  • cp dh1024.pem /etc/openvpn/  or dh2048.pem for 2048 encryption
Create OpenVPN server config and edit
  • cd /etc/openvpn/sample
  • gunzip server.conf.gz
  • vi server.conf
  • Change server.crt to <server hostname>.crt
  • Change server.key to <server hostname>.key
  • Change "dh1024.pem" to "dh2048.pem" if using 2048 encryption
  • Uncomment max-clients 100
Create OpenVPN client config
  • cd /etc/openvpn/sample
  • vi client.conf
  • change my-server-1 to your IP address of your VPS
  • Change "client.crt" to "<client hostname>.crt"
Export these 4 OpenVPN client config files to C:\Program Files (x86)\OpenVPN\config
  • /etc/openvpn/easy-rsa/keys/<client hostname>.key
  • /etc/openvpn/easy-rsa/keys/ca.crt
  • /etc/openvpn/easy-rsa/keys/<client hostname>.crt
  • /etc/openvpn/sample/client.conf (Rename to client.ovpn)
Start OpenVPN as a service and start
  • service openvpn start
  • Query service  ps -aux | grep openvpn or ps –wwwaux
  • Make the service be started with init.d scripts by editing /etc/default/openvpn  AUTOSTART="all"

Sunday, March 4, 2012

Review of Master lock combination lock

Quote:

 

This lock can be opened in seconds by anyone without a tool. Find some good light and take a look in the crack above the numbers. Spin the dial until you see a notch on the silver bar in the crack. Line each one up with the dots and there you go. I don't expect a lock like this to be extremely good, but this is just ridiculous. Unfortunately I leave on a very long trip tomorrow and don't have time to find something different.

Sunday, January 15, 2012

Recipe: Ayam Goreng Suharti

From: Indonesian Food Recipes

Original Ayam Goreng Suharti

April 29th, 2009 | Author: the chef

ayam-goreng-suharti
Ingredients:
  • 800 gr skinny chicken (ayam kampung, if possible), cut into four
  • 2 ltr coconut juice
  • 2 tsp? rice flour
  • vegetable oil

Spice paste ingredients:

  • 8 shallots
  • 4 cloves garlic
  • 7 cm ginger, grated
  • 10 candle nuts
  • 2 tbs coriander
  • 2 tsp black pepper
  • salt to taste
Directions:
  • Grind spice paste ingredients in a grinder or mortar into a fine paste.
  • Heat 2 tbs vegetable oil in a wok. Saute the paste until fragrant. Pour the coconut juice into the wok.
  • Add chicken and heat on medium until the liquid evaporates. Remove the chicken.
  • Combine spice paste in the wok with rice flour, whisk through until well-mixed.
  • Deep fry the chicken and flour mixture in another frying pan until browned.
  • Serve with sambal and vegetables

Recipe: Pan Fried Tilapia

From: Food.com

Pan Fried Tilapia

By Cattleships on September 16, 2002
Photo
Photo by DarksLight
31 Reviews
  • timer
  • Prep Time: 5 mins
  • Total Time: 10 mins
  • Servings: 2

About This Recipe

"Another very simple recipe...and a healthy one as well."

Recipe: Indian Dal

From: wholefoodsmarket

Recipe:

INDIAN DAL


Indian Dal
Submitted by: Whole Foods Market
 
  • Indian Dal
Rated by 26 people
Serves 6
Nutritious and flavorful, with added heat from a jalapeño, this recipe is an ideal choice for a quick evening meal. Dal is one of the principal foods of the Indian subcontinent where the term can be used to mean either an ingredient or the dish made from it. If using green or black beluga lentils instead of red, the cooking time should be increased by 10 to 15 minutes. Serve over a bed of brown rice.