Misc Memo for Computers

File Descriptor on Linux

/etc/security/limits.conf

* soft nofile 1024

* hard nofile 65536

* soft nproc 2047

* hard nproc 16384

Kernel Parameter

/etc/sysctl.conf

kernel.msgmnb = 65536

kernel.msgmax = 8192

kernel.shmmax = 4294967295

kernel.shmall = 1073741824

fs.file-max = 6815744

kernel.msgmni = 2878

kernel.sem = 250 32000 100 142

kernel.shmmni = 4096

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

fs.aio-max-nr = 3145728

# /sbin/sysctl -p

# /sbin/sysctl -aCheck CPU on Linux

/proc/cpuinfo

/proc/meminfo

Check the process of using specified port

lsof -i:5555

Unix User Control

* login shell configuration

 /etc/shells

* ftpuser

delete the following list as deny user

 /etc/ftpuser

* root user login configuration

delete the following line from /etc/default/login

 CONSOLE=/dev/console

Delete beep sound on X

xset b off

Yum Proxy Configuration

modify /etc/yum.conf

Adding following line.

proxy=http://proxy.hostname.com:5273/

Linux Host Name Change

# vi /etc/hosts

127.0.0.1 xxxx localhost.localdomain localhost

# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=xxxx

GATEWAY=192.168.0.1

/etc/rc.d/init.d/network restart

Linux IP Address Change

# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.0.100

NETMASK=255.255.255.0

GATEWAY=192.168.0.1

reboot machine or

# ifconfig eth0 192.168.0.100

 

Linux FTP server anonymous config

# cat /etc/vsftp/vsftp.conf

anonymous_enable=YES

full_access

anon_upload_enable=YES

anon_umask=0022

anon_mkdir_write_enable=YES

anon_other_write_enable=YES

Exchange Ctrl-Caps keyboard

* Using loadkey (keymap 0-15, please check by the 'dumpkeys | head -1')

 % loadkeys

 keymaps 0-15

 keycode 58 = Control

 keycode 29 = Caps_Lock

* Using xmodmap(X Only)

 % xmodmap .xmodmaprc

.xmodmap includes:

 remove Lock = Caps_Lock

 remove Control = Control_L

 keysym Control_L = Caps_Lock

 keysym Caps_Lock = Control_L

 add Lock = Caps_Lock

 add Control = Control_L

* Using sysconfig/keyboard

Add the follwoing entry to /etc/sysconfig/keyboard

KEYTABLE="jp106_Ctrl_CAPS"

Additionally for X, change the following of /usr/X11/xorg.conf

Option  "XkbDisable" (Duplicate)

Option  "XkbOptions"    "ctrl:swapcaps" (Exchange)

Option  "XkbOptions"    "ctrl:nocaps" (Change CapsLock to Ctrl Only)

 

Synergyc US keyborad detection

solve it by run 'setxkbmap'

Ubuntsu

ubuntsu 12 dns

/run/nm-dns-dnsmasq.conf

ubuntsu host name

edit /etc/hostname

servername.local

# /etc/init.d/networking restart

# hostname

servername.local

$ sudo apt-get install python-software-properties $ sudo apt-add-repository ppa:flexiondotorg/java $ sudo apt-get update $ sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

XRDB

sudo apt-get install xrdp gnome-session-fallback

sudo vim /etc/xrdp/startwm.sh

#!/bin/sh

if [ -r /etc/default/locale ]; then

  . /etc/default/locale

  export LANG LANGUAGE

fi

echo "gnome-session --session=gnome" > ~/.xsession ;

. /etc/X11/Xsession

sudo sysv-rc-conf xrdp on

sudo /etc/init.d/xrdp start

window manager replacement unity to gnome(fallback) + bluetile on ubuntsu

1. install packages

sudo apt-get install gnome-session-fallback

esudo apt-get install bluetile

2. (if connecting via nx client)

modify /usr/NX/etc/node.cfg

CommandStartGnome = "/etc/X11/Xsession 'gnome-session --session=gnome-classic'"

3. run bluetile once, then modify ~/.bluetilerc and add

start_dock: false (if you want to remove bluetile tool bar)

exit window manager or terminate nx session

4. login window manager or choose gnome session from nx client

open terminal and run bluetile

Command(Win) + d <- change layout

(if you want to run just bluetile, specify /usr/bin/bluetile in nx client custom session or run it on console)

Emacs 24 Ubuntu

# add-apt-repository ppa:cassou/emacs

# apt-get update

# apt-get install emacs24 emacs24-el

Install software package on HP

If the DNS is running, rename the /etc/resolv.conf then:

swagetntd?-r

swinstall -s host:/mnt1/home/root/patch/PHCO_29957.depot PHCO_29957

CD mount on AIX

 mount -v cdrfs -o ro /dev/cd0 /cdrom

CD mount on HP-UX

* Use a system editor to add the following line to the /etc/pfs_fstab

 example: /dev/dsk/c3t2d0 /SD_CDROM pfs-rrip xlat=unix 0

* login as the root user

 $ su root

* Run the following file:

 # nohup /usr/sbin/pfs_mountd &

 # nohup /usr/sbin/pfsd &

* Insert the CDROM and run the following to mount the CDROM

 # /usr/sbin/pfs_mount /SD_CDROM

Check CPU on Solaris

number of CPU

psrinfo

32bit or 64bit kernel

 % isainfo -v

 64-bit sparcv9 applications

 32-bit sparc applications

Show memory on Solaris

dmesg|grep mem

Reconfigure Solaris

sys-unconfig

Routing Table

Unix and Windows:

 netstat -rn

Router OS(Cisco):

show ip route

nbtstat

arp

Router shutdown by reload commandLinux

XDMCP configuration with cygwin

# vi /etc/gdm/custom.conf

[xdmcp]

Enable=true

# vi /etc/X11/xdm/Xaccess

* (from #*)

reboot machine

% XWin -screen 0 1440x900x256 -fullscreen -query hostname or ip address

If you get xdmcp error in second or later connection,

# kill `cat /var/run/gdm.pid`

killing /usr/sbin/gdm-binary process and restart it automatically

Register cygwin inetd as Windows Service

inetd --install-as-service

inetd --remove-as-service

Security Policy Tool

Local Security Policy

Coontrol panel -> Administration Tool -> Local Security Policy

run "secpol.msc"

Group Policy

run "gpedit.msc"

Create Control Panel on Windows NT

Create the following directory on start menu

 Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

The process of program add and delete on Windows

mshta.exe

Move Window

Alt, Space, M

HTML template

<html>

<head><meta http-equiv="content-type"

        content="text/html;charset=UTF-8">

<title></title>

<style type="text/css">

<!--

* {font-family: "Times New Roman";}

-->

</style>

</head>

<body>

</body>

</html>

Private IP address range

Class|Range

Class A|10.0.0.0?10.255.255.255

Class B|172.16.0.0?172.31.255.255

Class C|192.168.0.0?192.168.255.255

Pop command reference

|Command

|User Name    USER (username)

|Password    PASS (password)

|List        LIST

|Display mail    RETR (message_number)

|Display mail only top line    TOP (message_number lines)

|Delete mail    DELE (message_number)

|Finish        QUIT

Mac Finder

defaults write com.apple.finder AppleShowAllFiles -boolean true

killall Finder

Copy file to clipboard

# Mac  

pbcopy

# Linux

xsel --input --clipboard

# Cygwin 

putclip