sysctl -> Command to configure kernel parameter in freebsd (for example, syscl a.b=0) and linux
sysctl -a -> list down all configured kernel parameters values
sysctl(), sysctlbyname() -> API to configure kernel parameter in freebsd
sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu' -> To know number of vCPUs in Freebsd
[root@bsd84 ~]# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
hw.ncpu: 8 -> 8 vCPUs
hw.machine_arch: amd64
Check the vCPU to which the process is pinned in Freebsd
root@ns# cpuset -g -i -p httpd
pid 0 cpuset id: 1
==============
vimdiff
==============
]c : - next difference [c : - previous difference do - diff obtain dp - diff put zo - open folded text zc - close folded text :diffupdate - re-scan the files for differences
===========
SSH for public private key pair
===========
ssh -i <private key file> root@<ip-address>
======
vimrc
=======
set tags=tags;/ -> http://stackoverflow.com/questions/5017500/vim-difficulty-setting-up-ctags-source-in-subdirectories-dont-see-tags-file-i search for a specific tag and open Vim to its definition, run the following command in your shell:
vim -t <tag>
Or, open any Linux source file in Vim and use the following basic commands:
Vim commands
===============
"ayy -> Copy a line and store as a. For paste use "ap (buffer copy and paste, vim register) . Refer http://stackoverflow.com/questions/1497958/how-do-i-use-vim-registers
===========
Ubuntu
-------------
dpkg -L libevent-dev --> To know the installation file paths of an installed package
apt-get install --only-upgrade <packagename>
apt-get download <packagename>
apt-get source --download-only <packagename>
apt-cache show <packagename> | grep Version
=============
make
============
autoconf, autoreconf
=============
snmp
=============
snmpwalk
fcntl, setsockopt,
SO_RCVBUF, SO_SNDBUF, SO_SNDTIMEO, O_NONBLOCK
getsockopt, fctnl, setsockopt,
getaddrinfo
fork(), vfork(), exec(), wait(), waitpid()
freopen, mmap, access, fstat, lost, netstat
/proc
mutex, semaphore
chrt
ptrace
vmstat -> To check idle time etc (https://people.freebsd.org/~jlemon/papers/kqueue.pdf)
rpm2cpio
============
epoll
============
epoll_create, epoll_wait, epoll_ctl
------------------------
Pthread APIs
pthread_rwlock_unlock
pthread_cleanup_push/ pthread_cleanup_pop
pthread_once
===================
freebsd package install method
===================
pkg install
Example command to install lsof and vim
430 pkg install lsof
486 pkg install vim
python pip installation
https://computingforgeeks.com/how-to-install-pip-python-package-manager-on-freebsd-12/
portsnap
pkg_add example
pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/8.4-RELEASE/packages/Latest/bison.tbz
ypchsh -> To change shell from default csh to bash
std::remove_if
http://www.tecmint.com/ifconfig-command-examples/
free -> to know memory usage
lshd -> to know hardware configuration
authconfig-tui -> UI to configure NIS server
ttcp --> linux tool for measuring network throughtput (https://en.wikipedia.org/wiki/Ttcp)
netcat ---> Netcat (often abbreviated to nc) is a computer networking utility for reading from and writing to network connections using TCP or UDP.
https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record -> to capture cpu usage of a process.
https://cgdb.github.io/ -> cgdb
rsync
SSL operations
openssl s_client ->https://www.openssl.org/docs/manmaster/apps/s_client.html
openssl s_server -> https://www.openssl.org/docs/manmaster/apps/s_server.html
source ~/.myrc --> To add new RC file in the bash shell. It will be executed while running bashrc