Sunday, August 30, 2009

Thursday, August 13, 2009

[FreeBSD] ลงโปรแกรม netatalk เอาไว้ share ให้ mac

# pkg_add -r netatalk
# vi /usr/local/etc/pam.d/netatalk
###

netatalk auth required pam_unix.so try_first_pass
netatalk account required pam_unix.so try_first_pass
netatalk session required pam_permit.so
###
vi /etc/rc.conf

netatalk_enable="YES"
atalkd_enable="NO"
papd_enable="NO"
cnid_metad_enable="NO"
afpd_enable="YES"
timelord_enable="NO"

#---- start service
#/usr/local/etc/rc.d/netatalk start

จากนั้นก็ใช้ mac ทำการ connect โดยเปิด finder-> Go -> Connect to server ,
Server address: afp://username@192.168.1.1 --> Connect

Wednesday, August 12, 2009

[Dynamips] script สำหรับ start process dynamips

vi dynamips.sh

#!/usr/local/bin/bash
# Script for start dynamips process

DYNAMIPS_BIN=/usr/local/bin/dynamips
WORKDIR=/dynamips/cache
PORT_START=3600
NUM_PROC=12

case "$1" in
start)
cd $WORKDIR
i=0
while [ $i -ne $NUM_PROC ]
do
(( PORT = $PORT_START + $i ))
echo "Start dynamips hypervisor port $PORT "
nice $DYNAMIPS_BIN -H $PORT -l /dev/null > /dev/null 2>&1 &
(( i = i + 1 ))
done
exit 0
;;
stop)
echo "Stop dynamips all process .."
pkill -9 dynamips
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` {start|stop|restart}" >&2
exit 64
;;
esac

[FreeBSD] Create RamDisk on FreeBSD

vi mkramdisk.sh

#!/bin/sh
MOUNT_DIR="/dynamips/cache"
SIZE=512M

case "$1" in
start)
/sbin/mdmfs -S -s $SIZE md0 $MOUNT_DIR
echo "$SIZE ramdisk created on /dev/md0 and mounted on $MOUNT_DIR"
exit 0
;;
stop)
/sbin/umount $MOUNT_DIR
/sbin/mdconfig -d -u 0
echo "ramdisk unmounted from $MOUNT_DIR and deleted from /dev/md0"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` {start|stop|restart}" >&2
exit 64
;;
esac

[FreeBSD] Example /etc/pf.conf

vi /etc/rc.conf
pf_enable="YES" <== enable pf

vi /etc/pf.conf
## Macros
SYN_ONLY="S/FSRA"
EXT_NIC="bge0"
INT_NIC="bge1"

ALLOWED_ICMP="echoreq"
ALLOWED_TCP="{ 22,80 }"
TRUSTED_IP="{ 10.0.0.0/24, 1.1.1.1 }"

# Your Internet IP goes in the EXT_IP variable
EXT_IP="1.2.3.4"

# Your private network IP goes in the INT_IP variable
# if you have two NICs on the machine
INT_IP="192.168.1.1"

## TABLES


## GLOBAL OPTIONS
set block-policy drop

## TRAFFIC NORMALIZATION


## QUEUEING RULES


## TRANSLATION RULES (NAT)


## FILTER RULES

# Block everything (inbound AND outbound on ALL interfaces) by default (catch-all)
block all

# Default TCP policy
block return-rst in log on $EXT_NIC proto TCP all
pass in log quick on $EXT_NIC proto TCP from any to $EXT_IP port $ALLOWED_TCP flags $SYN_ONLY keep state

# Default UDP policy
block in log on $EXT_NIC proto udp all
# It's rare to be hosting a service that requires UDP (unless you are hosting
# a dns server for example), so there typically won't be any entries here.

# Default ICMP policy
block in log on $EXT_NIC proto icmp all
pass in log quick on $EXT_NIC proto icmp from any to $EXT_IP icmp-type $ALLOWED_ICMP keep state

# Default IP Policy
block in log on $EXT_NIC all
pass in log quick on $EXT_NIC from $TRUSTED_IP to $EXT_IP keep state

block out on $EXT_NIC all
pass out quick on $EXT_NIC from $EXT_IP to any keep state

# Allow the local interface to talk unrestricted
pass in quick on lo0 all
pass out quick on lo0 all

Sunday, August 9, 2009

ทำ 2D Barcode เอาไว้เล่นครับ

พอดีใช้ E71 มันสามารถสแกน 2D barcode ได้ครับ
h**p://qrcode.kaywa.com/

Saturday, August 8, 2009

[Nokia] E71 ใช้ battery มากกว่าปกติเพราะ garmin xt

h**p://dotdoh.com/?p=394


If you have just installed Garmin Mobile XT version 5.0.0.20 on your Mobile Phone (So far only verified on my Nokia E71 running Symbian OS), you may have notice that your battery life for you mobile phone seems to have reduce substantially from about 2 days before the installation to about 1 day.

This it seem is due to a background process that Garmin Mobile XT starts upon boot up of your Symbian operating system as well as upon running of the Mobile XT software.

Things you will need to verify if you are affected by this background process.

1.) An installed version of Garmin Mobile XT (Duh….)

2.) JBak Task Manager. (You can download it from: http://jbak.ru/jbaktaskman_en.php)

Step 1 Start JBakTaskMan
Step 2 Select Menu >> Tools >> Processes
Step 3 Type TSRAutoStart.exe

If the process TSRAutoStart.exe is found, you are most likely affected by this background process wasting away your battery life.

How to kill the TSRAutostart?

Step 1 Follow the previous Step 1 – 3
Step 2 Select the process TSRAutoStart.exe
Step 3 Select Menu >> Terminate process

How to prevent TSRAutostart from auto loading upon boot up.

Step 1 Plug mobile phone to PC under Mass Storage mode (! important as directories used are otherwise hidden)
Step 2 Delete file CardRunner.RSC in directory under Mobile Phone\Resource\plugins\CardRunner.RSC
Step 3 Delete the file CardRunner.dll in directory under Mobile Phone\sys\bin\CardRunner.dll

Permanent Fix.

Well if you are seeking a permanent fix, you could always try downloading the latest version of Garmin Mobile XT (Link: http://www8.garmin.com/support/collection.jsp?product=010-11034-00).

As of version 5.0.0.40, this background process is now an option that can be switched off, saving you the trouble of killing the process each time you run Garmin.

Step 1 Start GMobileXT (Duh…)
Step 2 Goto Tools >> Settings >> System
Step 3 Scroll down all the way till you see the option “Launch background service”
Step 4 Select Disabled then Done to save


h**p://www.symbian-freak.com/forum/viewtopic.php?p=440972

After installing v5.0.0.x0:

Turn OFF your S60
Turn S60 back ON
Launch JBak Taskman to see if TSRAutoStart.exe is running in Memory in Menu -> Tools -> Processes even though it's set as DISABLED by default in Tools -> Settings -> System -> Launch Background Services.


If TSRAutoStart.exe is running after S60 is turned ON, do this:

START GarminMXT v5.0.0.x0, goto Tools -> Settings -> System -> Launch Background Services and change to ENABLED.
EXIT GarminMXT, re-start GarminMXT and goto Tools -> Settings -> System -> Launch Background Services and change to DISABLED
Turn OFF S60
Turn ON S60
Launch JBak TaskMan to check that TSRAutoStart.exe ISN'T in Menu -> Tools -> Processes

Now:

START GarminMXT v5.0.0.x0
EXIT GarminMXT
Launch JBak TaskMan to check that TSRAutoStart.exe ISN'T in Menu -> Tools -> Processes

Now, you should find:

TSRAutoStart.exe doesn't start when you first turn ON your S60
TSRAutoStart.exe now CLOSES automatically when you exit GarminMXT v5.0.0.x0
It appears that GarminMXT v5.0.0.x0 when being installed, doesn't create the DISABLED entry and has to be done manually by setting to ENABLE, then DISABLE.

Friday, August 7, 2009

[Nokia] E71 แสดง IMEI

พิมพ์ *#06#

[Nokia] E71 แสดง mac address ของ wireless

พิมพ์ *#62209526#

[Nokia] E71 Hard reset

พิมพ์ *#7370# แล้วป้อน unlock default code = 12345