This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Skip this config if we aren't in bash | |
[[ -n "${BASH_VERSION}" ]] || return | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# .see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If running non interactively, do nothing | |
######################################################## | |
#|# Preamble # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c "import socket; socket.setdefaulttimeout(2); print('Port is up √') if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('google.com',4413)) else print('Port is down †')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### How to write a Git commit message | |
https://chris.beams.io/posts/git-commit/ | |
1. Separate subject from body with a blank line | |
2. Limit the subject line to 50 characters | |
3. Capitalize the subject line | |
4. Do not end the subject line with a period | |
5. Use the imperative mood in the subject line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax enable | |
set background=dark | |
set nocompatible | |
set autoindent | |
set smartindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set showmatch | |
set ruler | |
set virtualedit=all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list | |
apt-get update -y | |
sudo apt-get install -y mongodb-org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --hard <old-commit-id> | |
git push -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill $(ps aux | grep 'firefox' | awk '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export WORKON_HOME=~/Envs | |
source /usr/local/bin/virtualenvwrapper.sh | |
mkvirtualenv --python=/usr/bin/python3.5 <Project> | |
workon memorial | |
sudo apt-get install libevent-dev python-dev python3-dev | |
export export WORKON_HOME=~/Envs | |
source /usr/local/bin/virtualenvwrapper.sh | |
PYTHONPATH="/home/research/Env/<Project>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by https://gist.github.com/joeyAghion/6511184 | |
function getReadableFileSizeString(fileSizeInBytes) { | |
var i = -1; | |
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']; | |
do { | |
fileSizeInBytes = fileSizeInBytes / 1024; | |
i++; | |
} while (fileSizeInBytes > 1024); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
BEGIN { $SIG{INT} = $SIG{TERM} = sub { exit 0 } } | |
use Getopt::Long; | |
use Pod::Usage; | |
GetOptions ( |
NewerOlder