Skip to content

Instantly share code, notes, and snippets.

@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?
tcpdump -i eth1 -s 1500 port not 22
@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
watch "ps aux | sort -nrk 3,3 | head -n 10"
find . -type d -empty -print
find . -type d -empty -delete
@vanokg
vanokg / run.sh
Last active January 10, 2018 05:51
OSRM-backend
#!/bin/bash
echo "Delete old map"
echo " "
rm kyrgyzstan-latest.osm.pbf
echo "Deleted!"
echo " "
echo " "
echo "Download new map"
echo " "
@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
for i in `egrep -i "semrushbot|mj12bot|ahrefsbot" /var/log/nginx/*access.log |awk '{print $1}' |sort |uniq|awk -F':' '{print $2}'` ; do iptables -A INPUT -s $i -j DROP ; done
@vanokg
vanokg / WinUSBFromLinux.md
Created June 7, 2018 04:08 — forked from kuznero/WinUSBFromLinux.md
How to make Windows 7 USB flash install media from Linux?

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
@vanokg
vanokg / pgsql.md
Last active June 28, 2018 11:40
Replication

Настройка master

Правим /var/lib/pgsql/10/data/pg_hba.conf:


host    replication      postgres       10.0.3.0/24            md5
host    all              postgres       10.0.3.0/24            md5