Skip to content

Instantly share code, notes, and snippets.

View monodeep12's full-sized avatar

Monodeep Bhattacharjee monodeep12

View GitHub Profile
@monodeep12
monodeep12 / monitor_go_server.conf
Last active February 11, 2016 04:20
monit config file for monitoring a go app server
check process hulk_server
with pidfile /opt/go/src/github.com/xxxx/yyyy/hulk.pid
start program = "/home/hulk/media_planner/run_hulk_server.sh" as uid hulk and gid hulk
stop program = "/bin/bash -c 'fuser -k 5000/tcp'"
if failed host x.x.x.x port 5000 then alert
if failed host x.x.x.x port 5000 then restart
if 5 restarts within 5 cycles then timeout
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
@monodeep12
monodeep12 / monit_mongo.conf
Last active February 11, 2016 04:22
monit script for monitoring mongodb
check process mongodb
with pidfile "/var/run/mongodb.pid"
start program = "/sbin/start mongod"
stop program = "/sbin/stop mongod"
if failed host 127.0.0.1 port 27017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
@monodeep12
monodeep12 / memcached.conf
Created February 11, 2016 05:30
Monit script for memcached
check process memcached with pidfile /var/run/memcached.pid
start program = "/etc/init.d/memcached start"
stop program = "/etc/init.d/memcached stop"
if failed host 127.0.0.1 port 11211 protocol MEMCACHE then restart
if cpu > 70% for 2 cycles then alert
if cpu > 98% for 5 cycles then restart
if 2 restarts within 3 cycles then timeout
@monodeep12
monodeep12 / redis.conf
Created February 12, 2016 03:43 — forked from cyx/gist:3690597
Monit Redis
check process redis-server
with pidfile "/var/run/redis.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@monodeep12
monodeep12 / freeme
Created February 17, 2016 03:28 — forked from vishaltelangre/freeme
Free up unused memory [ubuntu]
#!/bin/bash
#
# Release memory used by the Linux kernel on caches.
free -m
sudo sysctl -w vm.drop_caches=3
sleep 5
sync && echo 3 > sudo /proc/sys/vm/drop_caches
free -m
# e.g. add vlc to startup items
$ cp /usr/share/applications/vlc.desktop ~/.config/autostart/
curl ifconfig.me
@monodeep12
monodeep12 / command_output_to_png.sh
Created February 17, 2016 04:50
save command output to image
ifconfig | convert label:@- ip.png
# Source: http://www.commandlinefu.com/commands/view/9104/save-command-output-to-image
@monodeep12
monodeep12 / ssh_without_pass.sh
Created February 17, 2016 04:55
Copy your SSH public key on a remote machine for passwordless login - the easy way
ssh-copy-id username@hostname
# Source: http://www.commandlinefu.com/commands/view/771/copy-your-ssh-public-key-on-a-remote-machine-for-passwordless-login-the-easy-way
Useful keys
These are the keys I use most times I run cmus. If you want to do even more with cmus or change the keybindings, read the help I link to in this page's conclusion.
v - stop playback
b - next track
z - previous track