/etc/default/grub
getconf LONG_BIT
https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html
In big endian, you store the most significant byte(MSB) in the smallest address.
In little endian, you store the least significant byte(LSB) in the smallest address.
lscpu | egrep 'Byte Order'
file /bin/ps # LSB for Little Endian
netstat -antp
dd if=/dev/urandom of=50MB.bin bs=1M count=50
ls --help | grep -E '[-][tr]\b'
service nginx status
/etc/init.d/nginx status
update-rc.d
echo 'CentOS'
chkconfig nginx on
chkconfig nginx
export count=2
ps aux --sort=-pcpu | head -n $count
ps aux --sort=-rss | head -n $count
ssh [email protected] 'racadm serveraction powerup'
find /home -iname tecmint.txt
export http_proxy=http://192.168.4.10:7778/
export https_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,192.168.*.*,10.*.*.*"
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
echo 'ubuntu set apt-get proxy'
cat /etc/apt/apt.conf
#Acquire::http::Proxy "http://Username:[email protected]:8080";
# detect proxy type
nmap -sV -p5201 127.0.0.1
set -h
curl -H 'Authorization: token INSERT_ACCESS_TOKEN_HERE' \
-H 'Accept: application/vnd.github.v3.raw' -O -L \
https://api.github.com/repos/owner/repo/contents/path
echo $TERM
netstat -lntup | grep sshd
ip addr show dev eth0
ip route
parted -s /dev/vdb mklabel gpt
parted -s /dev/vdb unit mib mkpart primary 0% 100%
mkfs.ext4 /dev/vdb1
mkdir /mnt/data
echo >> /etc/fstab
echo /dev/vdb1 /mnt/data ext4 defaults,noatime 0 0 >> /etc/fstab
mount /mnt/data
mount -o loop,ro CentOS-7-x86_64-Everything-1511.iso /mnt/CentOS
mount.nfs nfs_server:/dir /dir
mount -tnfs4 -ominorversion=1 server_nfs_4.1:/dir
%%bash
cd ~
ls -l
date
cat py35.yml
h = !cat .bash_history
','.join([s.split('install ')[1] for s in h if 'apt-get install' in s])
%%bash
ps --help all | grep rss
mkdir -p /not/existing/folder
cd ~
cat py35.yml | head -n 4
sed -i 's/(?<=name: )root/py352/' py35.yml
cat py35.yml | head -n 4
# http://tldp.org/LDP/abs/html/quotingvar.html
List="one two three"
for a in $List # Splits the variable in parts at whitespace.
do
echo "$a"
done
for a in "$List" # Preserves whitespace in a single variable.
do # ^ ^
echo "$a"
echo "${a}"
done
# one two three
a="zero zoo"
if [ $a == z* ]
then
echo '1'
fi
if [[ $a == z* ]]
then
echo '2'
fi
string="1:2:3"
set -f # avoid globbing (expansion of *).
array=(${string//:/ })
for i in "${!array[@]}"
do
echo "$i=>${array[i]}"
done
echo 'ps grep excluding grep pid'
RESULT_ssh_agent =`ps -aux | sed -n /[s]sh-agent/p`
if [ "${RESULT_ssh_agent:-null}" = null ]; then
chmod 600 /home/fzinfz/.ssh/id_rsa_vultr
eval $(ssh-agent -s)
ssh-add /home/fzinfz/.ssh/id_rsa_vultr
else
echo "ssh-agent running,skip adding"
fi
apt-get install git,aria2
dpkg --get-selections | grep postgres
rsync -aP /root/_bin [email protected]:/root
rsync -aP -e "ssh -p 10220" /root/data/docker-config [email protected]:/root --remove-source-files
rsync --help | grep -E '[-][ezaPrlptgoDv]\b|partial|progress|sparse'
tar -zcvf new.tar.gz directory-name
tar -ztvf my-data.tar.gz
tar -tvf my-data.tar.gz
tar -tvf my-data.tar.gz '*.py'
tar -zxvf toExtract.tar.gz
gunzip file.gz
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd
deploying Let's Encrypt certificates: https://certbot.eff.org/
./certbot-auto certonly --webroot -w /usr/share/nginx/www/ -d example.com -d www.example.com
/etc/letsencrypt/live/example.com/ -> /etc/letsencrypt/archive/example.com/
cert.pem chain.pem fullchain.pem privkey.pem -> cert1.pem chain1.pem fullchain1.pem privkey1.pem
apt-get install qemu-system
qemu-system-aarch64 qemu-system-m68k qemu-system-mipsel qemu-system-s390x qemu-system-unicore32
qemu-system-alpha qemu-system-microblaze qemu-system-moxie qemu-system-sh4 qemu-system-x86_64
qemu-system-arm qemu-system-microblazeel qemu-system-or32 qemu-system-sh4eb qemu-system-x86_64-spice
qemu-system-cris qemu-system-mips qemu-system-ppc qemu-system-sparc qemu-system-xtensa
qemu-system-i386 qemu-system-mips64 qemu-system-ppc64 qemu-system-sparc64 qemu-system-xtensaeb
qemu-system-lm32 qemu-system-mips64el qemu-system-ppcemb qemu-system-tricore