Skip to content

Instantly share code, notes, and snippets.

View monodeep12's full-sized avatar

Monodeep Bhattacharjee monodeep12

View GitHub Profile
0421c6c0211cefbc119577760f8e1a7ef3b845941a3cda581900432a17abab278cf6a8e33455e4ae53a7c1945fc7831dbf4ab01fc87868559dc2b5fa88b0b7a642
@monodeep12
monodeep12 / Remove all git tags
Created June 13, 2016 04:41 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
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
@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
@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
curl ifconfig.me
# e.g. add vlc to startup items
$ cp /usr/share/applications/vlc.desktop ~/.config/autostart/
@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
@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 / 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