Wednesday, February 20, 2013

snmp server installation

CentOS

install: yum install net-snmp-utils
config /etc/snmp/snmp.conf: add  "rocommunity public"

start snmp daemon: /etc/init.d/snmpd start
snmp client check: snmpwalk -v 1 -c public -O e 127.0.0.1
check for autostart: chkconfig snmp


Ubuntu

apt-get install snmp

Thursday, December 20, 2012

Remove a passphrase from a private key

  • Remove a passphrase from a private key
    openssl rsa -in privateKey.pem -out newPrivateKey.pem
    
    
    
    
    
    
    This is useful for automation such as auto connect a VPN upon logon. 

Sunday, November 25, 2012

oracle ucm

  • Runs oracle db 11g XE on 10.10.1.158:1521. 
    • sudo /etc/init.d/oracle-xe start
    • netstat -anpt | grep 1521 to verify listener
    • put the following into .bashrc

      • . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
      • ORACLE_SID=XE
    • sqlplus 
      • use TNS defined in $ORACLE_HOME/network/admin/tnsnames.ora
      • sqlplus system/oracle or sqlplus dev_ocs/oracle 
        • select * from global_name (for db)
        • show user
  • creates a doamin ucm_domain
  • starts wls admin server: startWeblogic.sh
  • starts wls managed server for cs: startManagedLogic.sh UCM_server1 http://localhost:7001/


Friday, November 2, 2012

python for loop, iterator, iterable, generator


For Loop
 When Python executes the for loop, it first invokes the __iter__() method of the container to get the iterator of the container. It then repeatedly calls the next() method (__next__() method in Python 3.x) of the iterator until the iterator raises a StopIteration exception. Once the exception is raised, the for loop ends.

Generators can be thought of as resumable functions


Thursday, October 4, 2012

Solaris 10 cmd

netstat -anf inet -P tcp
netstat -anf inet -P udp

svn merge

Merge trunk to branch


  • Under branch, "svn log -v --stop-on-copy" to find out the last revision number such as 70428
  • Dry run: svn merge --dry-run -r 70428:HEAD https://svn.blah.com//trunk .
  • Real run. 

Wednesday, October 3, 2012

install kivy on ubuntu 12.04


  • sudo apt-get install mesa-common-dev freeglut3-dev
  • pip install cython
  • pip install kivy

Tuesday, September 18, 2012

Wednesday, September 12, 2012

OS X make a bootable flash

hdiutil

iso==> dmg
hdiutil convert -format UDRW -o destination.dmg source.iso

dmg==> usb

sudo dd if=source.dmg of=/dev/rdisk1 bs=1m

Monday, September 10, 2012

OS X Python set up

homebrew

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
 
install Python from http://www.python.org/getit/mac/

install distribute (easy_install needs it)
wget http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py

install pip,virtualenv 
easy_install pip
pip install virtualenv
pip install virtualenvwrapper

vim .bash_profile
source /virtualenvwrapper.sh

Friday, August 24, 2012

upstart init daemon

Configuration  

/etc/init.conf
/etc/init/*.conf

User Job

$HOME/.init/


Upstart commands


Wednesday, August 22, 2012

mount windows share from Ubuntu


Install

sudo apt-get install smbfs

Inspect

smbclient //test-https.blah.net/ipc$ -U id -Wdomain

mount

sudo mount -t cifs //remote_windows/share $ $HOME/windows -o user=uid,dom=office

Tuesday, August 21, 2012

connect to MS SQL server and Sybase from linux



  • sudo apt-get install unixodbc unixodbc-dev freetds-dev sqsh tdsodbc
  •  cat /etc/freetds/freetds.conf
    •  [tds1]
      host = 10.21.1.1
      port = 1433
      tds version = 7.0
  •  sqsh -S tds1 -U id -P password

Friday, August 17, 2012

browser shortcut with nginx and DNS

OS: Ubuntu

DNS

/etc/hosts
127.0.0.1 foo

Nginx 

in sites-enabled/default

if ( $host = wiki ) {  
   rewrite ^ https://wiki.example.com;
}

Enable SQL server 2012 for TCP

Thursday, August 16, 2012

nmcli without Network Manager GUI

nmcli 

nmcli con down id VPN_CONN_NAME
nmcli con up id VPN_CONN_NAME
nmcli con

automation with nmcli

network-manager restart

sudo service network-manager restart


To automatically connect VPN.

put "nmcli con up id VPN_CONN_NAME" in .profile (upon login)

Friday, August 10, 2012

gevent

installation

  • sudo apt-get install libevent-dev
  • pip install gevent