Skip to content

Instantly share code, notes, and snippets.

@jenkek
jenkek / gist:02e19cb6999d6d2d2941c41be7f153d1
Last active July 14, 2017 05:23
Update your entire rockets syntax to hash
find * -type f -exec perl -p -i -e 's/([^:]):(\w+)\s*=>/\1\2:/g' {} \;
# in monitrc or in conf.d/some.conf
set alert [email protected] but not on { pid, ppid }
@jenkek
jenkek / gist:67572e074e5d9828ed62
Created September 25, 2015 03:48
Download last GeoLiteCity.dat database
$ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
$ gunzip GeoLiteCity.dat.gz
@jenkek
jenkek / gist:bec348c2da9da916c5ee
Created May 26, 2015 11:24
generate random password in linux console
$ openssl rand -base64 32
@jenkek
jenkek / gist:197a67768905dbaa2191
Last active August 29, 2015 14:21
motd shows outdated information on ubuntu
# vi /etc/pam.d/sshd
Code:
session optional pam_motd.so motd=/run/motd.dynamic noupdate
Remove "noupdate"
Code:
session optional pam_motd.so motd=/run/motd.dynamic
@jenkek
jenkek / gist:9f97bda0937734cfd325
Created December 25, 2014 04:33
Руссификация FreeBSD (UTF-8)
# vi /etc/login.conf
russian|Russian Users Accounts:\
:charset=UTF-8:\
:lang=ru_RU.UTF-8:\
:tc=default:
# cap_mkdb /etc/login.conf
# pw usermod -n $username -L russian
@jenkek
jenkek / gist:0172af0e5c75b365ad24
Created September 12, 2014 09:06
install ruby 2.1.2 under rvm on freebs 8.3
$ rvm pkg install readline
$ rvm reinstall 2.1.2 --with-readline-dir=$rvm_path/usr
@jenkek
jenkek / gist:f69c7434777aec90cbd4
Last active August 29, 2015 14:06
How to remove trailing slash from URL using Nginx

Place this inside your virtual host file in the server {} block configuration:

rewrite ^/(.*)/$ /$1 permanent;

Full example:

server {
  listen 80;
 server_name www.mysite.com;
@jenkek
jenkek / gist:66af09b7c6a0d5302cbc
Last active August 29, 2015 14:05
bash history search in freebsd
1) Open your bash global profile file:
# vi /etc/profile
2) Add following line to it:
export INPUTRC=/usr/local/etc/inputrc
3) Close and save the file
4) Open the file /usr/local/etc/inputrc and define / modify key binding:
# vi /usr/local/etc/inputrc
@jenkek
jenkek / gist:211757a48de7c58219c8
Last active August 29, 2015 14:01
How to: Delete a local and remote Git branch
git branch -D <name-of-branch>
git branch -d -r origin/<name-of-branch>
git push origin :<name-of-branch>