20120914

CleanUp Multipath, Remove Failed Faulty Device

# for i in /sys/class/scsi_host/host*/scan
> do echo "- - -" > $i
> done
# DEV=`multipath -ll | grep failed | awk '{print $3}'`
# for i in $DEV
> do echo 1 > /sys/block/${i}/device/delete
done

20120912

Rebuild Yum Database


# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb
# yum clean all
# yum update

20120824

Create Empty Disk Image

# dd bs=8192 count=10000 if=/dev/zero of=/tmp/disk.iso
# mkfs.msdos /tmp/disk.iso

20120815

Redhat enable multipath

# yum install sysfsutils
# yum install device-mapper-multipath
# mpathconf --enable --with_multipathd y

20120814

System log filled by snmpd messages


[root@myxen ~]# tail -5 /var/log/messages
Aug 15 03:19:30 myxen snmpd[10298]: Received SNMP packet(s) from UDP: [127.0.0.1]:42695
Aug 15 03:19:45 myxen snmpd[10298]: Received SNMP packet(s) from UDP: [127.0.0.1]:40647
Aug 15 03:19:47 myxen snmpd[10298]: Received SNMP packet(s) from UDP: [127.0.0.1]:56802
Aug 15 03:20:02 myxen snmpd[10298]: Received SNMP packet(s) from UDP: [127.0.0.1]:55952
Aug 15 03:20:02 myxen snmpd[10298]: Received SNMP packet(s) from UDP: [127.0.0.1]:33076

Solution:
[root@myxen ~]# cat /etc/sysconfig/snmpd.options
# snmpd command line options
# OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
OPTIONS="-LS 4 d -p /var/run/snmpd.pid -a"


Logging Options:

For -LF and -LS the priority specification comes before the file or facility token. The priorities recognised are:

0 or ! for LOG_EMERG, 
1 or a for LOG_ALERT, 
2 or c for LOG_CRIT, 
3 or e for LOG_ERR, 
4 or w for LOG_WARNING, 
5 or n for LOG_NOTICE, 
6 or i for LOG_INFO, and 
7 or d for LOG_DEBUG.

-p FILE
Save the process ID of the daemon in FILE.

-a
Log the source addresses of incoming requests.

20120220

Enable SSH to HP ILO

# grep ilo /etc/inittab
ilo:2345:respawn:/sbin/agetty ttyS1 115200 vt100
# grep ttyS1 /etc/securetty
ttyS1
# kill -HUP 1

20111125

  1. First find the device file.
    #ioscan -fnC fc Class     I  H/W Path  Driver S/W State   H/W Type     Description ================================================================= fc        0  0/3/1/0   fcd  CLAIMED     INTERFACE    HP A6826-60001 2Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)                       /dev/fcd0 fc        1  0/3/1/1   fcd  CLAIMED     INTERFACE    HP A6826-60001 2Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 2)                       /dev/fcd1 fc        2  0/3/2/0   td   CLAIMED     INTERFACE    HP Tachyon XL2 Fibre Channel Mass Storage Adapter                       /dev/td2
  2. Next use fcmsutil with that driver number to find fibre channel firmware version.
    #fcmsutil /dev/fcd0 vpd                 V I T A L   P R O D U C T   D A T A                      ---------   -------------   -------       Product Description    : "Dual Port 2Gbps/1Gbps Fibre Channel Universal PCI-X Adapter"  Part number            : "A6826-60001"  Engineering Date Code  : "A-4325"  Part Serial number     : "US00501499"  Misc. Information      : "PW=15W;PCI 66MHZ;PCI-X 133MHZ"  Mfd. Date              : "4334"  Check Sum              : 0xb6  EFI version            : "001.30"  ROM Firmware version   : "003.002.168" Asset Tag              : "NA"

20110902

cannot unmount, Not owner

global# umount /zones/my-zone/root/opt/app1

zfs nfs mount: nfs file system; use [host:]path

use mount -F nfs ...

20110714

Offending key in .ssh/known_hosts:<number>

vi .ssh/known_hosts
remove the line, let say if the number is 348
:348
dd
:wq!

20110620

unable to qualify my own domain name

1) disable sendmail

OR

2) set the domain name & hostname to FQDN

make domain name permanent - use /etc/defaultdomain

3) add FQDN to /etc/hosts (next to IP)

20110531

ssh can be used in while or for loop

-n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background. A common trick is to use this to run X11 programs on a remote machine. For example, ssh -n shadows.cs.hut.fi emacs & will start an emacs on shadows.cs.hut.fi, and the X11 connection will be automatically forwarded over an encrypted channel. The ssh program will be put in the background. (This does not work if ssh needs to ask for a password or passphrase; see also the -f option.)

ssh do not display motd

Use quite option:

ssh -q host

Semaphores exhausted: OS support please check: 0 semaphores available.

//Solaris 10:

# expr `ipcs -s | wc -l` - 3
you will get the current number of semaphores ids

# prctl -n project.max-sem-ids $$
the maximum limit is the privileged value

Temporarily increase the value to double
# prctl -n project.max-sem-ids -v 256 -r -i project default


//Solaris 9:
The default semmni value (max sem ids) is 10. Set the new value in the /etc/system and reboot is compulsory.

# expr `ipcs -s|wc -l` - 3
you will get the current number of semaphores ids

sshd[#]: [ID 800047 auth.error] error: Failed to allocate internet-domain X11 display socket

Check your $DISPLAY.

echo $DISPLAY

Should be like localhost:10.0

10 could be 11 12 13 etc

If you dont see that, check where $DISPLAY value comes from

grep DISPLAY ~/.*

try commented it out

if still not work try google somewhere else, u may find

1. plumb the ip6 localhost
2. use sshd -4 (edit /lib/svc/method/sshd for solaris 10)
3. Change ListenAddress in sshd_config from :: to 0.0.0.0

Hmm I dunno.. good luck

20110503

20110330

Set POST to minimum mode

sc> setkeyswitch normal

sc> setsc diag_mode normal

sc> setsc diag_level min

20110310

network device changed or missing

Can't ping gateway.


# diff path _to _inst path _to _inst.old
54,55d53
< "/virtual-devices@100/channel-devices@200/virtual-channel@0" 1 "vldc"
< "/virtual-devices@100/channel-devices@200/virtual-channel@3" 2 "vldc"

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g2: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2
inet 153.88.105.17 netmask ffffff00 broadcast 153.88.105.255
ether 0:14:4f:af:d1:6c

# grep e1000g /etc/path _to _inst
"/pci@780/pci@0/pci@1/network@0" 0 "e1000g"
"/pci@780/pci@0/pci@1/network@0,1" 1 "e1000g"
"/pci@7c0/pci@0/pci@2/network@0" 2 "e1000g"
"/pci@7c0/pci@0/pci@2/network@0,1" 3 "e1000g"

# snoop -d e1000g2
Using device /dev/e1000g2 (promiscuous mode)

# grep e1000g /var/adm/messages*
Feb 19 10:37:08 hostoraa3 mac: [ID 469746 kern.info] NOTICE: e1000g2 registered
Feb 19 10:37:08 hostoraa3 e1000g: [ID 766679 kern.info] Intel(R) PRO/1000 Network Connection, Driver Ver. 5.1.8
Feb 19 10:37:13 hostoraa3 e1000g: [ID 801725 kern.info] NOTICE: pciex8086,105e - e1000g[2] : Adapter copper link is down.
Feb 20 07:52:49 hostoraa3 mac: [ID 469746 kern.info] NOTICE: e1000g0 registered
Feb 20 07:52:49 hostoraa3 e1000g: [ID 766679 kern.info] Intel(R) PRO/1000 Network Connection, Driver Ver. 5.1.8
Feb 20 07:52:49 hostoraa3 mac: [ID 469746 kern.info] NOTICE: e1000g1 registered
Feb 20 07:52:49 hostoraa3 e1000g: [ID 766679 kern.info] Intel(R) PRO/1000 Network Connection, Driver Ver. 5.1.8
Feb 20 07:52:50 hostoraa3 mac: [ID 469746 kern.info] NOTICE: e1000g3 registered
Feb 20 07:52:50 hostoraa3 e1000g: [ID 766679 kern.info] Intel(R) PRO/1000 Network Connection, Driver Ver. 5.1.8
Feb 20 07:52:50 hostoraa3 e1000g: [ID 801725 kern.info] NOTICE: pciex8086,105e - e1000g[1] : Adapter copper link is down.

# modinfo | grep e1000g
142 7bfa2000 22338 83 1 e1000g (Intel PRO/1000 Ethernet 5.1.8)

# kstat -m e1000g | less
...

# ifconfig e1000g1 plumb

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 0.0.0.0 netmask 0
ether 0:14:4f:af:d1:6b
e1000g2: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2
inet 153.88.105.17 netmask ffffff00 broadcast 153.88.105.255
ether 0:14:4f:af:d1:6c

# ifconfig e1000g2 unplumb
# ifconfig e1000g1 153.88.105.17 netmask 255.255.255.0 up
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 153.88.105.17 netmask ffffff00 broadcast 153.88.105.255
ether 0:14:4f:af:d1:6b

# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 153.88.105.1 UG 1 155654
153.88.105.0 153.88.105.17 U 1 1 e1000g1
127.0.0.1 127.0.0.1 UH 18 468989 lo0

# ping 153.88.105.1
153.88.105.1 is alive

20110303

Error 3: Bad or corrupt data while decompressing file

symptom: keeps on getting back to the boot menu.

in failsafe mode,
# rm -f /a/platform/i86pc/boot_archive
# bootadm update-archive -R /a
# reboot


kudos to sysinfo.bascomp

20110222

today i am happy

because I've found truss

truss - trace system calls and signals

files open by process id

# pfiles <PID>
# pmap <PID>


p/s: just found out how to put <, > in blogger.

get resource controls value

like max-shm-memory

# prctl $$

accurate memory statistics

# echo ::memstat | mdb -k

20110221

check wwn on solaris

# fcinfo hba-port -l

20101213

drool of the day

goosh.org

xscf: accessing console

XSCF>
Display all 150 possibilities? (y or n)

XSCF> showdomainstatus -a
DID Domain Status
00 Running
01 -

XSCF> console -d 00
Connect to DomainID 0?[y|n] :

20101130

view and increase semaphores on "solaris 9"

# sysdef | grep -i s[eh]m

to edit, edit the /etc/system and reboot.

20101121

Failed to retrieve method context for the ... method of instance... Could not interpret ... property.

hint: svcprop

Nov 22 06:41:42 myhost inetd[27129]: [ID 702911 daemon.error] Failed to retrieve method context for the inetd_start method of instance svc:/network/omni/tcp:default: Could not interpret group property.

# svcprop network/omni/tcp | grep group
inetd_start/group astring root

# grep root /etc/group
other::1:root
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
mail::6:root
tty::7:root,adm
lp::8:root,adm
daemon::12:root


root group is missing, so simply append to the 1st line..

root::0:

20101114

iphone error 3014

remove gs.apple.com line in hosts file

20101104

write: you have write permission turned off

root@aidil:~# mesg
is n
root@aidil:~# mesg y
root@aidil:~# mesg
is y

20101012

20100831

HPUX identify the 9th lun

N1# scsimgr lun_map -D /dev/rdisk/disk88 \
| tail | grep Instance
Instance = 83

N1# scsimgr get_attr -C lunpath -I 83 -a lunid \
| grep '#'
current =0x4009000000000000 (LUN # 9, Flat Space Addressing)

N1# ioscan -m dsf /dev/rdisk/disk88
Persistent DSF Legacy DSF(s)
========================================
/dev/rdisk/disk88 /dev/rdsk/c5t1d1
/dev/rdsk/c7t1d1
/dev/rdsk/c9t1d1
/dev/rdsk/c11t1d1
/dev/rdsk/c13t1d1
/dev/rdsk/c15t1d1
/dev/rdsk/c17t1d1
/dev/rdsk/c19t1d1

20100824

Kerajaan jimat RM200 juta guna perisian sumber terbuka

Sent to you via Google Reader

Kerajaan jimat RM200 juta guna perisian sumber terbuka

KEPALA BATAS 23 Ogos – Kerajaan menjimatkan sehingga RM200 juta selepas lebih 95 peratus agensi kerajaan mengaplikasikan perisian sumber terbuka (OSS) sektor awam sejak dilancarkan pada 2004.

20100819

What do you call a Unix guy who loves Microsoft Outlook? :-P

Nornikman Abdul Rahim has just left a comment on your network update:

"Unix guy with no dignity? Wakaka"

20100818

20100813

windows uptime

sometime net statistics server gives weird info:

Statistics since 1/1/1980 12:00:00 AM

use net statistics workstation

20100729

I need a few more brains.

I have a good idea that can benefit from the readability concept and Safari Reader. Now I need extra brains.

20100713

Some alteration to Mike's Sidebar Login code

Mike is a brilliant guy. He developed a WordPress plugin which place a login widget on to the sidebar. I loved it the first time I used it.

Not to disrespect, but I want it to look more compact and clean. So I made some modification to the input text area. It would be nice if the labels are inside the text area and disappear when they are clicked upon.

From to .

Worn Out

It is scary, you're coming to an end baby.
Do not worry, I'll replace with a nuclear energy.

20100712

Customize Time Machine Intervals


Why? You don't want Time Machine to backup your data too frequently that it fills up your backup disk quickly. Unless you are someone who works in a production area or your files moved and altered very frequently in one day.


What happen when your backup disk is full? This is what happened to my mom. It automatically removes the oldest files until the latest backup made it's way safely to the backup disk. You don't want that. The worst thing is, it doesn't ask for your permission. Or make it this way. It doesn't ask a question that can be understand by a non geek user.

When you restore a large files to the current time, Time Machines will do hourly backup in the next hour. This will fill up your backup disk fast. What happen if the large file that you just restore isn't the file that you want? Some people will go back in time and restore another one. And they forget to remove the earlier files.

Time Machine users should know how this thing works before they start using it. Unless they have a super huge disk or unlimited storage, they should aware of their backup disk usage. So if needed, you can customize your backup interval using TimeMachineEditor.


20100513

Linux Ubuntu & Maxis Broadband Huawei E220 or E1762

first install usb-modeswitch

/etc/usb_modeswitch.conf must exists & contain everything below:

DefaultVendor= 0x12d1
;DefaultProduct= 0x1003
DefaultProduct= 0x1446
;DetachStorageOnly=1
;HuaweiMode=1
MessageEndpoint=0x01
MessageContent="55534243000000000000000000000011060000000000000000000000000000"


/etc/udev/rules.d/15-huawei-e1762.rule also must exists with this content:

SUBSYSTEM=="usb", SYSFS{idProduct}=="1446", SYSFS{idVendor}=="12d1", RUN+="/usr/sbin/usb_modeswitch"

finally, run usb_modeswitch

Flash doesn't work in Ubuntu Chromium

sudo apt-get install flashplugin-nonfree

make sure libflashplayer.so sits inside /usr/lib/chromium-browser/plugins/

USB printer greyed out dim on virtualbox windows

make sure you are in vboxusers & lp group

Ubuntu 10.04 Lucid Lynx on HP Mini 5101 Setup


This week I 'ubuntunized' - there goes a new word! - my sister's netbook. She frowned about the viruses. I spilled the offer. Time has come baby!

Since 5101 doesn't come with a disc drive, I've created a Ubuntu bootable USB using Startup Disk Creator which comes pre-installed with 10.04 under System > Administration menu.

Installation and setup wasn't quite a breeze. Now everything is working - broadband modem, webcam, printer, functional buttons and power management. Wireless driver doesn't work right away but Lucid will prompt you to activate the 'proprietary drivers'. If not, just manually find it under Administration > Hardware Drivers menu.

Well I am going to tell you my actual story. There was a few things that didn't work properly or didn't work at all - webcam, Gwibber, broadband - but to my surprise, everything solved after I figure out the keyring issue. But this is just a blind theory.

What is it? Well if you authorized Lucid to remember passwords, keyring is where he stores them.

All started when Gwibber - an app that update social network status simultaneously - did not respond on different Ubuntu account. So I ran it from the terminal and saw an error mentioning keyring daemon.

I also notice something in the Passwords and Encryption Keys under the Application > Accessories menu - "can't communicate with keyring daemon".

So I googled. I discovered that some people edit the Certificate and Key Storage in the Startup Application Preferences. Remove all arguments. Leave it as "gnome-keyring-daemon".

I'm not sure how but it also solved my broadband problem. My webcam suddenly happen to work too. Also worth to mention on the broadband issue if you're experiencing it, once I disconnect the modem, I can never simply reconnect it. I have to reboot with the modem plugged in.

My wild guess is, something to do with keyring & permissions. So if you happen to read this in an attempt to 'ubuntunize' your netbook, go for it! Lucid is awesome!

...but wait. You might want to consider UNE instead of full fledge Ubuntu. Adios :)

20091229

Free, Simple, Looks Pro & Legit. My friend receive $, so I just give it a try.

http://www.catcheye.com.my/?r=40432

20091116

Linked Text Hover Tips

Put this in your style definition:
a:hover {text-decoration:underline; color:#036;}

Remove Color Visited Link

Put this in your style definition:
a {color:#036}

Remove Underlined from Linked Text

Put this in your style definition:
a {text-decoration:none}

20090928

HP-UX ping source quench

Set "Source quench" to 0 as "ndd -set /dev/ip ip_send_souce_quench 0" and include this parameter inside "nddconf" file.

20090912

out of recovery mode

15 sec of power & home button
2 sec of power button

20090808

Privilege separation user sshd does not exist

/sbin/init.d # ./secsh start
Privilege separation user sshd does not exist
EXIT CODE: 255


so...

/sbin/init.d # useradd -u 103 -c "sshd privsep" -d /var/empty -s /bin/false sshd

if you want to specify group, -g yourproblem

20090802

console login service(s) cannot run

I screwed up with milestone

# svcadm milestone -d all

20090714

Fusion Can Explode


WARNING: Do not ever put your MacBook in the bag while sleeping IF you have VMWare Fusion running. It'll burn or may explode! Because I did zipped it in my bag for say 30 minutes and the heat just scares shit out of me.

20090709

iPhone icons arrangement

/private/var/mobile/Library/Preferences/com.apple.springboard.plist

20090528

./isempty.sh[3]: test: Specify a parameter with this command.

Ok I know test wants parameter. But how? Roasted? Half cooked?

isempty()
{
NAME=$1
if [ -n $NAME ]; then echo not empty!
else echo it is empty!
fi
}
echo "name: \c"
read name
isempty $name

I feel there is a proper way than to append 2>/dev/null

20090526

Color Code


STYLE = {
"default" : "\033[m",
# styles
"bold" : "\033[1m",
"underline" : "\033[4m",
"blink" : "\033[5m",
"reverse" : "\033[7m",
"concealed" : "\033[8m",
# font colors
"black" : "\033[30m",
"red" : "\033[31m",
"green" : "\033[32m",
"yellow" : "\033[33m",
"blue" : "\033[34m",
"magenta" : "\033[35m",
"cyan" : "\033[36m",
"white" : "\033[37m",
# background colors
"on_black" : "\033[40m",
"on_red" : "\033[41m",
"on_green" : "\033[42m",
"on_yellow" : "\033[43m",
"on_blue" : "\033[44m",
"on_magenta" : "\033[45m",
"on_cyan" : "\033[46m",
"on_white" : "\033[47m"

}

20090525

echo escape sequences


\a write an alert character
\b backspace
\c print line without appending a new-line
\f form-feed
\n new-line
\r carriage return
\t tab
\v vertical tab
\\ backslash
\n the 8-bit character whose ASCII code is the 1-, 2-, 3-
or 4-digit octal number n, whose first character must
be a zero.
\0num write an 8-bit value that is the zero-, one-, two- or
three-digit octal number num

Adding Space to an ESX Server Virtual Disk

ESX 3.5. Use clone to backup. Go into the vm directory which suppose to be in the corrected data store directory. Grep scsi on *vmx file to identify which disk u want to extend. First one should be C: and second should be D: etc etc.

# vmkfstools -X 60G virtualdiskiwanttoextend.vmdk

Refer here. Careful with the number you choose. Above example means change the disk capacity to 60GB, not by 60GB.

20090512

connect to win share with specific user

net use z: \\192.168.1.1 /user:username password

How you guys partition 1TB disk?

Backup done. My 1TB (with firewire) disk is ready to get restructured. For this, I really hope anyone who notice this post, to recommend, or tell their experience and self-best opinion on how should a large disk structure looks like (ignore mirroring). Starting with me..

1. Backup
2. Disc image, a size of DL DVD
3. Documents
4. VMs

Thank you for your support!

20090510

Enable Appear Offline / Invisible in Office Communicator 2007

The DWORD name is EnableAppearOffline, type is REG_DWORD and location is

My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator.

20090407

I Love Shortcuts!

All Caps - CTRL+SHIFT+A
Annotation - ALT+CTRL+M
Auto Format - ALT+CTRL+K
Auto Text - F3 or ALT+CTRL+V
Bold - CTRL+B or CTRL+SHIFT+B
Bookmark - CTRL+SHIFT+F5
Copy - CTRL+C or CTRL+INSERT
Copy Format - CTRL+SHIFT+C
Copy Text - SHIFT+F2
Create Auto Text - ALT+F3
Date Field - ALT+SHIFT+D
Delete Back Word - CTRL+BACKSPACE
Delete Word - CTRL+DELETE
Dictionary - ALT+SHIFT+F7
Do Field Click - ALT+SHIFT+F9
Doc Maximize - CTRL+F10
Doc Move - CTRL+F7
Doc Restore - CTRL+F5
Doc Size - CTRL+F8
Grow Font - CTRL+SHIFT+.
Grow Font One Point - CTRL+]
Hanging Indent - CTRL+T
Header Footer Link - ALT+SHIFT+R
Help - F1
Hidden - CTRL+SHIFT+H
Hyperlink - CTRL+K
Indent - CTRL+M
Italic - CTRL+I or CTRL+SHIFT+I
Justify Para - CTRL+J
Left Para - CTRL+L
Line Up Extend - SHIFT+UP
List Num Field - ALT+CTRL+L
Outline - ALT+CTRL+O
Outline Collapse - ALT+SHIFT+- or ALT+SHIFT+NUM -
Outline Demote - ALT+SHIFT+RIGHT
Outline Expand - ALT+SHIFT+=
Outline Expand - ALT+SHIFT+NUM +
Outline Move Down - ALT+SHIFT+DOWN
Outline Move Up - ALT+SHIFT+UP
Outline Promote - ALT+SHIFT+LEFT
Outline Show First Line - ALT+SHIFT+L
Lock Fields - CTRL+3 or CTRL+F11
Web Go Back - ALT+LEFT
Web Go Forward - ALT+RIGHT
Word Left - CTRL+LEFT
Word Left Extend - CTRL+SHIFT+LEFT
Word Right - CTRL+RIGHT

20090401

SSH through SOCKS proxy

compile connect source and put to any bin
add to ssh config file:
Host *
ProxyCommand connect -S socks.proxy.la %h %p

SSH through SOCKS proxy

compile connect source and put to any bin
add to ssh config file:
Host *
ProxyCommand connect -S socks.proxy.la %h %p

iPhone Tethering

  1. establish wifi connection (comp + iphone)
  2. run socks (3proxy) from mobileterminal
  3. surf anything from mobile safari to establish EDGE
  4. set browser's socks proxy with iphone IP address & port 1080
  5. if firefox, additional step: set network.proxy.socks_remote_dns to true
iPhoneModem app is annoying
  1. establish wifi connection (comp + iphone)
  2. run socks (3proxy) from mobileterminal
  3. surf anything from mobile safari to establish EDGE
  4. set browser's socks proxy with iphone IP address & port 1080
  5. if firefox, additional step: set network.proxy.socks_remote_dns to true
iPhoneModem app is annoying

How to change MySQL user password

at the "mysql>" prompt, type:
set password = password("yournewpassword");

*I always forget this, I need to jot down*

20090224

Clippy! I miss thou!!

I thought it was a restriction or expired evaluation time but its NOT!
They have replaced the way to show copy & paste button to by holding
[123] even for copying an sms, you need to hold them. Thank God Clippy
is back!

Sent from my iPhone

It's been long since we had a picture posted here.. Wait, had we?

20090220

Now currently converting 2 laptops to Ubuntu. Lately I've been
promoting solution to run Windows on VirtualBox. The catch is of
course, less virus threat & VB snapshot. Compiz effect also gives
bonus to attraction.

P/s: mood is unhappy because my huge hfs filesystem is corrupt due to
improper usb removal

20090202

backup-sms.sh

I always have the feeling that huge sms.db will slow down SMS application startup. So I created a script to be run in Terminal and I wish I can do an application for this.

#!/bin/sh

# backup-sms.sh
#
# Created by amanyus on 2/2/09.
# Copyright 2009 __MyCompanyName__. All rights reserved.

DATE=`date +%y%m%d`
echo "${DATE}"
if test -f /var/mobile/Library/SMS/sms.db.$DATE
then echo "Today's backup already exists."; exit; fi
if ! test -f /var/mobile/Library/SMS/sms.db.$DATE
then cp -npv /var/mobile/Library/SMS/sms.db /var/mobile/Library/SMS/sms.db.$DATE; fi
ls -lrt /var/mobile/Library/SMS/
if test -f /var/mobile/Library/SMS/sms.db.$DATE
then echo "Today's backup successful"; fi

20090201


Update: Something fishy here. Applications installed by Cydia do not appear on the springboard...

Aperture: A tiny thing that saves a lot of time.


Just for expressing an excitement. A new thing I just discovered and love about Aperture.

I have a lot of pictures and my last trip to Langkawi produced more than 1700 shots - and my mother wants them ALL! So as I started to export hundreds of pictures, I went through one by one to reject bad photos - even the exporting is still running (right now). Suddenly I came to a photo that attracts me. After a simple edit, I decided to upload it to Flickr and this is the good part. I don't have to wait for the earlier exporting process to complete before exporting a new picture. It really saves my time.

What a good software design in customer point of view!

20081202

Intrepid On Acer Aspire 4720

Previous day, I had setup the latest Ubuntu on my sister's laptop. I
was surprised of how cool & beautiful Linux these days. It is even
easier to setup comparing to old days. I also compared Ubuntu with
Fedora Core 10 on my VirtualBox. I have to agree, I like pre-installed
Ubuntu better. Picasa also works great.

Now, with VirtualBox, she keep a copy of an uninfected Windows. She
still need it I for her iPod because iTunes doesn't work well with
Wine. But still a few issue she face - USB & Shared Folder in
VirtualBox.

20081125

Installing NTFS-3G on your Mac OS X will render your Windows drives invisible from your "Startup Disk" preference pane. [1] They suggested disabling or uninstalling to bring the disappeared drive back. But I accidentally see a Windows partition in my VMWare Virtual Machine Library.

20081120

Wth with my sort?

$ ls -al | sort -n +4
sort: open failed: +4: No such file or directory

20081118

Convert plist binary to xml, back and forth.

plutil -convert xml1 some_file.plist

plutil -convert binary1 some_other_file.plist

To check, use file something.plist

Leopard Re Installation: Part 2

I reformat using the same filesystem my external hard drive uses. Then set UID to 1000 in the System Preferences > Accounts > Advanced Options (right click on username). After that chown whole home directory.

Leopard Re Installation: Backup & Restore Issue

I wanted to replace my OS X Server because of lack of Internet Sharing feature. So I do both Time Machine backup and manual backup before making a fresh OS X installation. These are the issue that I faced.

Restoring using Time Machine right after Leopard Installation is not as I expected. There will be folders like 'System (from old mac)', 'Applications (from old mac)'. For me, this is not neat.

Your OSX filesystem must have the same format as your Time Machine backup filesystem. I'm using HFS Journaled with Case Sensitive, but my external hard disk is using HFS Journaled NOT with Case Sensitive. I have to reformat either my OS X partition, or my external hard disk.

Restoring files from Time Machine is strict because of UID. My user uses 501 as UID but my last Server system was using 1000 as UID. So restoring could get complicated.

Right now I'm going to change my UID and reboot and see what will happen.

20080927

Phone Number Fix on iPhone (localization)

Problem is iPhone doesn't recognize callers. Although they exist in the address book, iPhone only show their number with extra country code prefix.

Replace PhoneNumberTemplates.plist
in the /System/Library/PrivateFrameworks/AppSupport.framework

*Best to just backup/rename than to remove.

Custom Ringtones on iPhone

Convert audio file to use AAC codec and change the extension to m4r. Must not exceed 40 seconds.

Fix Youtube on iPhone

Unzip unlock.zip
to /private/var/root/Library/Lockdown and remove pair_records folder.

*Best to just backup/rename than to remove.

Fix Youtube

unzip unlock.zip to /private/var/root/Library/Lockdown
remove pair_records

20080917

Shell Auto-completion

I feel it is too late for me to realize that auto-completion using ESCAPE ESCAPE is actually came from a shell variable, $EDITOR

EDITOR=`which vi`; export EDITOR

Few servers gave me hard times on stty important function. So I:

echo "stty erase ^H
stty kill ^U
stty intr ^C
TERM=vt100
EDITOR=`which vi`
export TERM EDITOR" >> ~/.profile

20080910

Use putty to access vnc using ssh tunnel

This is to overcome firewall which filter connection on the application layer. In putty:

Hostname: ssh_server
X display location: localhost:0
Source port: 5901
Destination: vnc_server:5900


On vnc, connect to localhost:1

20080822

16:06 < codept> is there any tool to ...like ...present logs in the /var/log
...in more simpler format, let say httpd-access.log, a tool
that can analyze it and gives number of connection for each
unique source, ...that is just an idea
16:10 < geek00l> codept, we call it - awk, sed, sort, uniq, grep and fuck

20080813

Be Gentle With Your Keyboard

I just learn that, (after years of facing terminal), the more you minimize your typing mistakes, lesser the potential of screwing up or end up your work dissatisfied. It helps me thinking better too.

Think before you type. Think again before you press enter. Avoid typing too fast (because there are kids who think typing fast shows that they're good). Type slow not too slow, sit back and relax. Enjoy the cleanliness of your terminal output.

p/s: Yeah, I've worked with business critical environment... and I did screw up a few times :-p And this came to my mind while I was watching a 'really good' but not sys admin guy, typing neatly.

20080812

Start postgresql, create database and access it

Platform:FreeBSD

# su - pgsql
$ initdb -D /usr/local/pgsql/data
(if only doesn't exist)
$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &
$ createdb test
$ psql test


Install: using ports
Binary location: /usr/local/bin
Don't forget to modify rc.conf

20080807

httpd.conf | php module

beside LoadModule php5_module libexec/apache22/libphp5.so



Edit Aug 12 2008:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

20080725

Diriwayatkan dari Abu Hurairah r.a., ia berkata: Rasulullah bersabda:“Wanita dinikahi karena empat perkara; karena hartanya, karena kedudukannya/ keturunannya, karena kecantikannya dan keranan agamanya. Maka, pilihlah yang baik agamanya niscaya engkau beruntung.” (Diriwayatkan oleh al-Bukhari (3/242), Muslim (2/1086), Abu Dawud (2047), an—Nasaa’i (6/6 8) dan Ibnu Majah (1858))

20080720

Failed to enable the 'httpready' Accept Filter

[bambino@bambino ~]$ sudo apachectl start
[Mon Jul 21 14:42:39 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
[bambino@bambino ~]$ sudo kldload accf_http
[bambino@bambino ~]$ sudo apachectl restart
[bambino@bambino ~]$

After 7 years of no telephone line...

FUCK Telekom.

20080719

streamyx settings for ADSL wireless router

  1. enter correct username and password
  2. vpi : 0 (zaro or 8 if you want)
  3. vci : 35

using command line mail

Simply mail to recipient,

$ mail RECIPIENT

Enter subject, press enter, and type mail content. Ctrl + D to finish.

To include content from a text file, for example, msg.txt, simply enter ~r ./msg.txt at the first line of the mail content.

$ mail RECIPIENT -c CCPERSON

To list mail headers in inbox

$ mail -H

To list mail saved msg headers in mailbox (~/mbox)

$ mail -F

Inside mail console (don't really know what to call exactly), you can use h to list again mail headers, and enter any number to read specific mail.

RCS | Revision Control System

For first time:
  1. mkdir RCS (ignore if folder already exists)
  2. rlog example.conf
  3. if rlog returns no file or dir, check in the file and enter description:
    ci -u example.conf
  4. if rlog returns information, check out the file to edit: 
    co -l example.conf
  5. if it's not locked, you may edit the file with your favorite editor and save it.
  6. check in the file and write a log:
    ci -u example.conf
  7. you may check the information using rlog again.

Please make sure you understand before doing it. Google for RCS.

20080718

Set mysql root password

To set password for the first time:
$ mysqladmin -u root password NEWPASSWORD


To change password:
$ mysqladmin -u root -p OLDPASSWORD NEWPASSWORD


To login with password:
$ mysql -u root -p PASSWORD


To change password mysql sql command:
mysql> use mysql;
mysql> update user set password=OLDPASSWORD("NEWPASSWORD") where User='USERNAME';
mysql> flush privileges;
mysql> quit

20080716

Unresponsive Dock and Finder

I can't access Dock just now. No respond. And I'm unable to go through Finder too, so I can't get a touch on Terminal. I forced quit some applications, but there's only TextEdit which I left because there's work which wasn't saved yet. Then how do I rescue this without force quitting the TextEdit which I'm not even sure if it is the cause of all this? But I'm pretty sure that it was about the hung Dock. I really wanted to avoid logging out or reboot.

But user fast switch is enabled. I logged in as administrator and used terminal to kill other's Dock process.

PS=`ps aux | awk '{if($1="amanyus") print}' | grep -i dock`; kill $PS

PS is temporary shell variable to hold a value. This value is coming from a ps command after few filtering with awk and grep. Awk only print lines that match the first column with user amanyus, which result in all amanyus' processes. Next with grep, only match insensitive case dock rather that all processes under user amanyus because we only want to find Dock process and put in the PS variable. Up to this point, PS variable will hold the process number of amanyus' Dock. After the semicolon, the process will be killed.

Silly is you just can simply use ps aux | grep amanyus | grep Dock and kill the Dock's process without bothering with awk command =p

p/s: Hey, I forgot about spotlight at the first time to search Terminal, but not sure if it would work.