Monday, February 27, 2012

/dev/null

Wow there's been a long time that I don't write anything in my blog. Real life makes me don't have time to write a long post here..

Some things that have been moving around me :
- Just got my new born baby ( Hero)
- New company related project to be settle
- Wifey continuing her study
- bla bla bla..

Speaking of FreeBSD, I've still maintain 3 customer as my part time that using FreeBSD as their gateway / server :
- Putera.com
- CyberCafe
- Protemp

Those box are running fine and steady. BSD r0ck!

Sunday, October 23, 2011

PHP - Different between 2 date

$date1 = new DateTime($created2[0]);
$date2 = new DateTime("now");

$interval = $date1->diff($date2);
echo $interval->format('%R%a days');

Tuesday, October 18, 2011

NEW Google Android 4.0 | Samsung Galaxy Nexus

Google baru je melancarkan Android 4.0 dengan code name Ice Cream Sandwich. Samsung juga tidak ketinggalan melancarkan smartphone yang terbaru iaitu Samsung Galaxy Nexus



Ada duit sila lah sambar satu ? bila nak masuk malaysia ntah.. :P

Sunday, October 2, 2011

Zenclouds October Promotion - Malaysia VPS Hosting

For those who are not familiar with what Zenclouds.com is , check this out :

Zenclouds subsidiary of Art In Software Sdn Bhd is an industry-leading, privately virtual private server hosting and software services provider with headquarters in Malaysia. Since 2003, the company has provided businesses worldwide with reliable, high-capacity networks to host websites, email, business applications, video and other modern, rich-media content.

Zenclouds evolve in one year of research and development mainly focus on Control Panel for managing virtual private server. Zenclouds integrate between Xen technologies and our own Control Panel to ease our customer managing multiple server with different Data Center with one control panel. Zenclouds integrates the industry's best technologies for each customer's specific need and delivers it as a service via the company's commitment and support.
For this upcoming October you can win and own a brand new iPod Shuffle, Nano and Touch when you subscribe any Zenclouds.com package for a year!

Limited time offer! Zenclouds.com go and subscribe now!
http://goo.gl/sCS8y

Friday, September 30, 2011

Galaxy 5 rooted dengan Android 2.2

Al kisah aku baru je selesai flash phone Galaxy 5 GT-I5503 dari Android 2.1 Esclair ke Android 2.2 Froyo.. Mula-mula memang agak kelam kabut sebab dah salah flash.Maklum la baru 1st time buat ni. Refer sana sini pon masih ada silap lagi :P

So far so good rasa lebih laju sikit. Mungkin kena upgrade sdcard aku dari 2GB ke 4GB ke.. rasa macam tak muat plak dah..

Thursday, September 1, 2011

Projek Baru

Tak terlambat rasanya aku nak ucapkan Selamat Hari Raya buat umat Islam sedunia walaupun hari ini ada yang sudah mula bekerja :)

as the title projek sebelum ni aku buat gateway kat satu cc di kawasan aku. Apa yang aku implement ada seperti berikut :

- Firewall (PF)
- Squid
- DHCP

Cyber cafe complain kena nak main game slow, surf internet pun slow. Masalah kat sini ialah takde line 2mbps keatas.. agak solok la kan :P

so aku dah up kan squid, ada improvement kat surf internet, content web cepat loading..

untuk game aku cadangkan apply lagi satu line streamyx. so ada 2 line 1 mbps. Dengan adanya 2 line ni aku boleh setup gateway untuk route gamers pc ke line 1 dan surf internet ke line 2..

yatta~

Tuesday, August 16, 2011

FreeBSD : VSFTPD FTP-PROXY

Vsftpd name come from "Very Secure FTP Daemon". I don't look what is very secure unless the installation is work for me is fine :)

Now we will installing Vsftpd in FreeBSD 8.2. On my network there's a firewall (PF) which using single interface ($ext_if) and with a public IP.

Let start with a Vsftpd installation.
1) If you're unfamiliar with FreeBSD ports style, you can try to search for the path of the vsftpd. Basically in /usr/ports/ftp


# cd /usr/ports
# make search name=vsftpd
Port: vsftpd-2.3.2
Path: /usr/ports/ftp/vsftpd
Info: A FTP daemon that aims to be "very secure"
Maint: dinoex@FreeBSD.org
B-deps:
R-deps:
WWW: http://vsftpd.beasts.org/

2) Install Vsftpd
# cd /usr/ports/ftp/vsftpd
# make install clean

Binary File : /usr/local/libexec/vsftpd &

Sample Configuration File : /usr/local/etc/vsftpd.conf


# Example config file /usr/local/etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
#anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
pasv_promiscuous=YES
dirlist_enable=YES
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=FTP SERVER
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
secure_chroot_dir=/usr/local/share/vsftpd/empty

# If using vsftpd in standalone mode, uncomment the next two lines:
# listen=YES
# background=YES


Installing ftp-proxy



ftp.proxy is a proxy server for a subset of the file tran­
       fer protocol described in RFC 959.   It  forwards  traffic
       between  a client and a server without looking too much if
       both hosts do real FTP.  The  FTP  server  can  be  either
       given on the command line or supplied by the client.


# cd /usr/ports
# make search name=ftpproxy
Port: ftpproxy-1.2.3_1
Path: /usr/ports/ftp/ftpproxy
Info: A ftp proxy
Maint: philippe@le-berre.com
B-deps: gettext-0.18.1.1 gmake-3.81_4 libiconv-1.13.1_1
R-deps:
WWW: http://www.ftpproxy.org/

Listen port : 8021

Firewall (PF) Packet Filter Rules

Add this rule in your /etc/pf.conf

rdr-anchor "ftp-proxy/*"

rdr pass on $EXT proto tcp from any to any port ftp -> 127.0.0.1 port 8021

Done