Sunday, December 28, 2008
MPLS VPN
Thursday, December 25, 2008
MPLS Unicast IP
Monday, October 27, 2008
How-To Change Time Zone in Linux
Steps
- Logged in as root, check which timezone your machine is currently using by executing `date`. You'll see something like
Mon 17 Jan 2005 12:15:08 PM PST
, PST in this case is the current timezone. - Change to the directory
/usr/share/zoneinfo
here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory. - If you wish, backup the previous timezone configuration by copying it to a different location. Such as
mv /etc/localtime /etc/localtime-old
- Create a symbolic link from the appropiate timezone to /etc/localtime. Example:
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
- If you have the utility rdate, update the current system time by executing
/usr/bin/rdate -s time-a.nist.gov
- Set the ZONE entry in the file
/etc/sysconfig/clock
file (e.g. "America/Los_Angeles") - Set the hardware clock by executing:
/sbin/hwclock --systohc
Friday, October 24, 2008
Line is up, Protocol is Down
- Local or remote router misconfigured
- Keep-alives not being sent by remote router
- Leased-line or other carrier service problems, such as noisy lines or faulty switch
- Timing problem on cable, possibly caused by the CSU/DSU not being set correctly.
- Failed local or remote CSU/DSU.
- Router failure.
Thursday, September 25, 2008
Install Exim with DKIM and Domainkeys on DirectAdmin
wget http://duncanthrax.net/exim-experimental/libdkim-1.0.16-tk.tar.gztar zxvf libdkim-1.0.16-tk.tar.gzcd libdkim-1.0.16-tkcd srcmakemake installcd ..cp lib/libdkim.a /usr/libcp include/dkim.h /usr/include/
tar zxvf libdomainkeys-0.69.tar.gzcd libdomainkeys-0.69makeecho -lresolv > dns.libmakemake installcp *.h /usr/local/include/cp *.a /usr/local/lib
wget http://files.directadmin.com/services/all/exim/exim-4.69.tar.gztar xvzf exim-4.69.tar.gzcd exim-4.69/Localwget http://www.directadmin.com/Makefileperl -pi -e 's/^EXTRALIBS/#EXTRALIBS/' Makefile
EXPERIMENTAL_DKIM=yesCFLAGS += -I/usr/includeLDFLAGS += -ldkim -lssl -lstdc++ -L/usr/libEXPERIMENTAL_DOMAINKEYS=yesCFLAGS += -I/usr/local/includeLDFLAGS += -ldomainkeys -L/usr/local/lib#added April 9, 2008HAVE_ICONV=yesCFLAGS=-O -I/usr/local/includeEXTRALIBS_EXIM=-L/usr/local/lib -liconv#end add
cd ..makemake install
cp -f /usr/sbin/exim-4.69-12 /usr/sbin/exim/sbin/service restart exim
Friday, March 7, 2008
How to determine the root port
1. Lowest port cost
2. Lowest value of the forwarding switch's ID
3. Lowest port priority
4. Lowest internal port number
Saturday, March 1, 2008
Multidimensional array in perl
Found the page below after digging on google:
http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm
Then I test it with simple code, as below:
#!/usr/bin/perl
# to test reading a file, split it, then put it into array
use strict;
use warnings;
my $ref_line;
my @lines;
open FH,"testfile.txt";
while () {
push @lines, [split(" ",$_)];
}
for $ref_line (@lines) {
print "@$ref_line[7]\n";
}
The result looks OK to me. Now it's the time to write the code into my project.
Monday, February 18, 2008
Apache prompt for pass-phrase on every start up
Found the solution as below.
How can I get rid of the pass-phrase dialog at Apache startup time?
The reason this dialog pops up at startup and every re-start is that the RSA private key inside your server.key file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution!
- Remove the encryption from the RSA private key (while keeping a backup copy of the original file):
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key
- Make sure the server.key file is only readable by root:
$ chmod 400 server.key
Now server.key
contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root).
As an alternative approach you can use the ``SSLPassPhraseDialog exec:/path/to/program
'' facility. Bear in mind that this is neither more nor less secure, of course.
source: http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#removepassphrase
Friday, February 15, 2008
Securing MySQL step-by-step
Thursday, February 14, 2008
Instal Apache SSL on Ubuntu
- apt-get install apache libapache-mod-ssl
- dpkg-reconfigure libapache-mod-ssl
- fill in all details with your details
- cp /usr/share/doc/libapache-mod-ssl/examples/mod-ssl.conf /etc/apache/conf.d/
- cp /usr/share/doc/libapache-mod-ssl/examples/vhost.conf.gz /etc/apache/conf.d/
- cd /etc/apache/conf.d/
- gzip -d vhost.conf.gz
- edit vhost.conf and change all snakeoil references to server. ie. snakeoil-dsa.crt = server.crt
- stop apache
- start apache