Category Archives: Work

Work

Create tar.gz in OpenSolaris

I need to make backup for our public_html directory

using tar command I used to use :

tar cvzf  filename.tar.gz directory_name

It work in linux or bsd but I have different situation with OpenSolaris :

# uname -a

SunOS TGLxxxxxxx 5.11 snv_86 i86pc i386 i86xpv

# tar cvzf public_html.tar.gz public_html

tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@/[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}…
#

Combine it with gzip using pipe will give tar.gz file :

tar cvf -  public_html | gzip > public_html.tar.gz

Yes, it works!

scp time.

P.S :

In case you want to extract .tar.gz file in OpenSolaris use this command :

gzip -dc filename.tar.gz | tar xvf -

Linux Unix Work

How to change proxy information on ubuntu server

New motherboard has come and I ask my friend to install Ubuntu Hardy 8.0.4.3 . Everything is fine except proxy section when I try to apt-get update.

# apt-get update

Err http://security.ubuntu.com hardy-security Release.gpg
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/main Translation-en_US
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/restricted Translation-en_US
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/universe Translation-en_US
Could not resolve ’172.88.1.3;3128′

As you see proxy information is incorrect, there is a ; sign not :

read more »

Linux Unix Work

How to change timezone on ubuntu

One of my friend server must get reconfigure its clock each time, specially when the server get reboot after lamp problem.

Until he realized the timezone is different.

Here’s quick way to change it :

# dpkg-reconfigure tzdata

Current default timezone: ‘Asia/Jakarta’
Local time is now:      Sat Oct  3 13:02:53 WIT 2009.
Universal Time is now:  Sat Oct  3 06:02:53 UTC 2009.

Check

# date

Sat Oct  3 13:03:15 WIT 2009

Great, it fix.

Work

WARNING: Found /var/db/mysql/my.cnf

MySQL 5.4 beta already hit freebsd ports and I eager to try it after read a lot of review.
Everyhing seem OK until I want to start the server.

# /usr/local/etc/rc.d/mysql-server restart
mysql not running? (check /var/db/mysql/proxy2.host.com.pid)

hmmm, perhaps I can try mysqld_safe

# /usr/local/bin/mysqld_safe &
[1] 87164
proxy2# WARNING: Found /var/db/mysql/my.cnf
Datadir is deprecated place for my.cnf, please move it to /usr/local/etc

Starting mysqld daemon with databases from /var/db/mysql
STOPPING server from pid file /var/db/mysql/proxy2.host.com.pid
090725 10:46:54 mysqld ended

What, after a moment I try to follow it.

# mv /var/db/mysql/my.cnf /usr/local/etc/

restart again and still not work, after remove it completely I see it work.

# rm /usr/local/etc/my.cnf

Hmm, I think I have to downgrade back to 5.0.84 and wait till 5.4 final icon smile WARNING: Found /var/db/mysql/my.cnf

Work

How to Setting ntp client in Mikrotik

RouterBoard have special behavior, that’s my observation after install MT in hard disk and then bought RB433AH.

In RB433AH time setting automatically to January 1970 every time its get restart. Till I use ntp (network time protocol) client in MT.

The step to set ntp client in MT :

1. Click ‘System’ -> NTP Client.

mikrotik ntp How to Setting ntp client in Mikrotik

2. Enter information of ntp server.

I use google for shortcut, enter search term :

‘ntp server for Singapore’, resulted in : sg.pool.ntp.org

read more »

Work

Setting up RouterBoard RB433 AH

New Mikrotik RB has arrived, its RB433AH wireless indoor.

As I never use mikrotik before it’s time to configure it for first use :

1. Download neigbour viewer for windows from mikrotik.

neigbour viewer Setting up RouterBoard RB433 AH

2. Unzip the files using winzip or winrar.

Double click to launch neighbour viewer

At first time IP address will display 0.0.0.0 it means no ip address assigned.

To assign new address double click its MAC address.

read more »

Work

Start Learning PHP framework

Newest project actually just inherit from other project but due to old style programming approach. The time it take for completing seem to waste our time and stress when deadline come.

Learning php framework such codeigniter, zend framework, cake, symphony etc open our eye that we ‘must’ forget our knowledge and try to think big.

What we need is learning object oriented programming, css and jquery plus pick one of framework available out there. So here the book list that we use for building new team skill icon smile Start Learning PHP framework

1. Object Oriented Books :

  1. PHP Objects,Patterns, and Practice, Second Edition Start Learning PHP framework
  2. PHPObject-Oriented Solutions Start Learning PHP framework
  3. PHP 5Objects, Patterns, and Practice Start Learning PHP framework
  4. Object-Oriented Programming with PHP5: Learn to leverage PHP5′s OOP features to write manageable applications with ease Start Learning PHP framework
  5. Learning PHPData Objects: A Beginner’s Guide to PHP Data Objects, Database Connection Abstraction Library for PHP 5 Start Learning PHP framework

2. JQuery Books :

  1. Learning jQuery 1.3 Start Learning PHP framework
  2. Beginning JavaScript and CSS Development with jQuery (Wrox Programmer to Programmer) Start Learning PHP framework
  3. jQuery UI 1.6: The User Interface Library for jQuery Start Learning PHP framework
  4. Learning jQuery: Better Interaction Design and Web Development with Simple JavaScript Techniques Start Learning PHP framework
  5. jQuery Reference Guide: A Comprehensive Exploration of the Popular JavaScript Library Start Learning PHP framework

3. CodeIgniter Books :

  1. Professional CodeIgniter Start Learning PHP framework
  2. CodeIgniter for Rapid PHP Application Development: Improve your PHP coding productivity with the free compact open-source MVC CodeIgniter framework! Start Learning PHP framework
  3. Creating a QuickStart Blog with CodeIgniter (Wrox Briefs) Start Learning PHP framework
  4. Creating a Microsite Manager with CodeIgniter (Wrox Briefs) Start Learning PHP framework
  5. Practical CodeIgniter 2 Projects: Building Real–World Apps with CodeIgniter (Practical Projects) Start Learning PHP framework

Of course a lot of practice is another main thing icon smile Start Learning PHP framework

Time to download the framework.

Work

Install AnsavAnti Virus in Ubuntu Server

Playing around with anti virus lead me to ansav, a free anti virus that convince me to give it a chance for our linux server.

Installation process is simple as 123 :

1. Download core engine and update from here.

2. Install ansav.

dpkg -i ansav-linux-i386.deb

3. Move latest update to /etc/ansav

mv dbs.anv /etc/ansav/

4. Checking if it work

# ansav

—————————————————————
ANSAV 2.0.11  beta-3 (Linux.2.6.28-11-server)
updated: 16.05.2009
total: 1329 signatures inside
—————————————————————

for more command use –help

# ansav –help

—————————————————————
ANSAV 2.0.11  beta-3 (Linux.2.6.28-11-server)
updated: 16.05.2009
total: 1329 signatures inside
—————————————————————

USAGE:
ansav [options] [path]

OPTIONS:
-v   verbose mode.
-w   show malware list from database
show also list from external (dbs.anv) if exists.
-f   enable auto fix for every detected threat.
-d   enable auto deletion for every detected threat.
if -f and -d specified auto deletion will be used
for unfixable threat. This rule not affected for suspected object
or you can force delete use `–force-kill` instead.
-r   scan recursively.
-p   format output to pipeline friendly.

EXAMPLE:

ansav -vf /mnt/f

scan and fix every detected threat in directory /mnt/f.

ansav -vfd /mnt/f

scan and fix every detected threat in directory /mnt/f
and delete threat if fix fail.

Need to test it against local virus.

Unix Work

WARNING: Crypto package not found. Some features will fail.

That message show up when I scan conflicker in our lan.

After some google, I know the answer :

In FreeBSD :

# cd /usr/ports/security/py-pycrypto && make install

In Ubuntu :

# apt-get install python-crypto

Done.

NO more error message I guess.

Unix Work

Detect conflicker in our LAN

Another conflicker variant force us to behave like paranoid. Any tool that might help us to detect it get more attention, specially when it’s free icon smile Detect conflicker in our LAN

Detect from Windows machine :

Download detector from Florian Roth, click here.

Save and extract to any folder, I choose C.

Make sure to run it from comman line :

C:\scs2-win32>scs2.exe 172.88.1.95  172.88.1.100

Simple Conficker Scanner v2 — (C) Felix Leder, Tillmann Werner 2009
Compiled for Win32 environments by Florian Roth

[INFECTED] 172.88.1.96: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be infected by Conficker B or C.
Done

Detect from Linux machine ( I use Ubuntu 9.04 server) :

# apt-get install python-impacket

# wget http://iv.cs.uni-bonn.de/uploads/media/scs2.zip

# unzip scs2.zip

# cd scs2

# ./scs2.py 172.88.1.1 172.88.1.50

Simple Conficker Scanner v2 — (C) Felix Leder, Tillmann Werner 2009

[UNKNOWN]  172.88.1.10: No response from port 445/tcp.
[UNKNOWN]  172.88.1.14: No response from port 445/tcp.
[UNKNOWN]  172.88.1.8: No response from port 445/tcp.
[UNKNOWN]  172.88.1.5: No response from port 445/tcp.
[UNKNOWN]  172.88.1.9: No response from port 445/tcp.
[CLEAN]    172.88.1.43: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.25: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[UNKNOWN]  172.88.1.50: No response from port 445/tcp.[CLEAN]    172.88.1.22: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.23: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.

[CLEAN]    172.88.1.34: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.29: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.28: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[INFECTED] 172.88.1.47: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be infected by Conficker B or C.
[CLEAN]    172.88.1.48: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.38: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.42: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[CLEAN]    172.88.1.27: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[UNKNOWN]  172.88.1.1: No response from port 445/tcp.
[UNKNOWN]  172.88.1.4: No response from port 445/tcp.
[UNKNOWN]  172.88.1.6: No response from port 445/tcp.
[UNKNOWN]  172.88.1.7: No response from port 445/tcp.
[UNKNOWN]  172.88.1.11: No response from port 445/tcp.
[UNKNOWN]  172.88.1.12: No response from port 445/tcp.
[UNKNOWN]  172.88.1.13: No response from port 445/tcp.
[UNKNOWN]  172.88.1.16: No response from port 445/tcp.
[UNKNOWN]  172.88.1.17: No response from port 445/tcp.
[UNKNOWN]  172.88.1.18: No response from port 445/tcp.
[UNKNOWN]  172.88.1.19: No response from port 445/tcp.
[UNKNOWN]  172.88.1.20: No response from port 445/tcp.
[UNKNOWN]  172.88.1.21: No response from port 445/tcp.
[UNKNOWN]  172.88.1.26: No response from port 445/tcp.
[UNKNOWN]  172.88.1.30: No response from port 445/tcp.
[UNKNOWN]  172.88.1.31: No response from port 445/tcp.
[UNKNOWN]  172.88.1.32: No response from port 445/tcp.
[UNKNOWN]  172.88.1.33: No response from port 445/tcp.
[UNKNOWN]  172.88.1.35: No response from port 445/tcp.
[UNKNOWN]  172.88.1.36: No response from port 445/tcp.
[UNKNOWN]  172.88.1.37: No response from port 445/tcp.
[UNKNOWN]  172.88.1.39: No response from port 445/tcp.
[UNKNOWN]  172.88.1.40: No response from port 445/tcp.
[UNKNOWN]  172.88.1.41: No response from port 445/tcp.
[UNKNOWN]  172.88.1.44: No response from port 445/tcp.
[UNKNOWN]  172.88.1.45: No response from port 445/tcp.
[UNKNOWN]  172.88.1.46: No response from port 445/tcp.
[UNKNOWN]  172.88.1.49: No response from port 445/tcp.

Detect using FreeBSD machine :

# cd /usr/ports/net/py-impacket && make install

# wget http://iv.cs.uni-bonn.de/uploads/media/scs2.zip

# unzip scs2.zip &&  cd scs2

# python scs2.py 172.88.1.90 172.88.1.100
WARNING: Crypto package not found. Some features will fail.

Simple Conficker Scanner v2 — (C) Felix Leder, Tillmann Werner 2009

[CLEAN]    172.88.1.90: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be clean.
[UNKNOWN]  172.88.1.100: No response from port 445/tcp.
[INFECTED] 172.88.1.96: Windows 5.1 [Windows 2000 LAN Manager]:  Seems to be infected by Conficker B or C.
[UNKNOWN]  172.88.1.92: No response from port 445/tcp.
[UNKNOWN]  172.88.1.91: No response from port 445/tcp.
[UNKNOWN]  172.88.1.93: No response from port 445/tcp.
[UNKNOWN]  172.88.1.94: No response from port 445/tcp.
[UNKNOWN]  172.88.1.95: No response from port 445/tcp.
[UNKNOWN]  172.88.1.97: No response from port 445/tcp.
[UNKNOWN]  172.88.1.98: No response from port 445/tcp.
[UNKNOWN]  172.88.1.99: No response from port 445/tcp.
Done
#

Time to patch those infected machine.

Unix Work

Install OpenNMS on FreeBSD

Download

# cd /usr/ports/net-mgmt
# wget -c http://www.geeklan.co.uk/files/opennms/opennms-164-freebsd-port.tgz

–2009-05-15 03:17:40–  http://www.geeklan.co.uk/files/opennms/opennms-164-freebsd-port.tgz
Resolving www.geeklan.co.uk… 93.97.185.103
Connecting to www.geeklan.co.uk|93.97.185.103|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 15093 (15K) [application/x-tar]
Saving to: `opennms-164-freebsd-port.tgz’

100%[=====================================================================================================>] 15,093      5.23K/s   in 2.8s

2009-05-15 03:17:45 (5.23 KB/s) – `opennms-164-freebsd-port.tgz’ saved [15093/15093]

Extract and delete

# tar xvzf opennms-164-freebsd-port.tgz && rm opennms-164-freebsd-port.tgz

x opennms/
x opennms/files/
x opennms/distinfo
x opennms/pkg-descr
x opennms/pkg-message
x opennms/pkg-plist
x opennms/Makefile
x opennms/files/opennms.in
x opennms/files/patch-maven-conf_settings.xml
x opennms/files/patch-pom.xml

read more »