Skip to content

Instantly share code, notes, and snippets.

find . -type d -empty -print
find . -type d -empty -delete
watch "ps aux | sort -nrk 3,3 | head -n 10"
@vanokg
vanokg / Hardware info
Created November 4, 2016 12:00
Hardware info
# cat cpuinfo_unix_com
#!/bin/bash
# ygemici @unix.com
## Script Tested Systems ; Redhat 3-4-5,Fedora 6,15 ; OpenSuse 12,Centos 6,Ubuntu 10 ( !! on VIRTUAL PLATFORMS !! )
## Script not tested Debian platforms!!
## REDHAT 5-6 && SMBIOS 2.7 && has newer bios systems shows the THREAD/CORE Counts via 'dmidecode' ##
## Script does not use 'lscpu' for that there is not in the system default installion but tries to the lshw for get the some informations
## Please feedback to me for wrong results or missing properties on the which you tested systems
## may we can achieve more accurate results to improve this script
tcpdump -i eth1 -s 1500 port not 22
@vanokg
vanokg / top_memory_use
Last active March 29, 2018 11:14
Кто жрет память
ps -eo size,pid,user,command | awk '{ hr=$1/1024 ; printf("%13.6f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | sort -n | grep -v 0.000000
@vanokg
vanokg / Monitor DHCP
Last active March 2, 2020 16:31 — forked from mattm7n/gist:1405067
Monitor DHCP traffic with tcpdump
# Monitoring on interface eth0
tcpdump -i eth0 -n port 67 and port 68
@vanokg
vanokg / .bashrc
Last active August 29, 2015 14:20
.bashrc
# put timestamps in my bash history
export HISTTIMEFORMAT='%F %T '
# don't put duplicate commands into the history
export HISTCONTROL=ignoredups
# record only the most recent duplicated command (see above)
export HISTCONTROL=ignoreboth
# don't record these commands in the history; who cares about ls?