Skip to content

Instantly share code, notes, and snippets.

View tasdikrahman's full-sized avatar
💭
Automate everything

Tasdik Rahman tasdikrahman

💭
Automate everything
View GitHub Profile
@tasdikrahman
tasdikrahman / remove_mongo_lock.md
Last active March 2, 2016 16:13
MongoDB starting problem in Ubuntu

You started mongodb server, but No matter what. However, when you run sudo status mongodb again, you’ll get mongodb stop/waiting instead of mongodb start/running

Note: This condition is largely due to an unclean shutdown, and results in the creation of a lockfile /var/lib/mongodb/mongod.lock

The fix is a quick two-step process as follows:

Remove the lockfile. Run the repair script. This is accomplished as follows:

@tasdikrahman
tasdikrahman / .gitignore
Last active August 29, 2015 14:24
my .gitignore file
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@tasdikrahman
tasdikrahman / service_check.py
Created August 6, 2015 13:46
Service Check module - Checks some of the services which runs on the server
import commands
import os
output = commands.getoutput('ps -A')
def print_spaces() :
print "\n-----XXXXXXXXXXX----------XXXXXXXXXX--------\n"
def mongo() :
if 'mongodb' in output :
print 'mongod ------ running'
@tasdikrahman
tasdikrahman / tmux-cheatsheet.markdown
Last active August 29, 2015 14:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tasdikrahman
tasdikrahman / .bashrc
Created August 23, 2015 09:36
my .bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# ----------------for giving random commands and what they do-------------
#echo "Did you know that:"; whatis $(ls /bin | shuf -n 1)
#cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)
cowsay "Why be a sailor when you can be a Pirate !! --Steve Jobs"
@tasdikrahman
tasdikrahman / .bash_aliases
Created August 23, 2015 09:37
my .bash_aliases file
alias ?='cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)'
alias gl='git log --oneline --graph --all --decorate'
alias copy_cloud=/Documents/copy/x86_64/CopyAgent
@tasdikrahman
tasdikrahman / .profile
Created August 23, 2015 09:40
My .profile file
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
@tasdikrahman
tasdikrahman / sqlite_manager.sh
Created August 23, 2015 10:09
Run the add-on Sqlite Manager without opening firefox
!/usr/bin
firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul