This file contains hidden or 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
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' | |
# install vs code | |
sudo apt-get update | |
sudo apt-get install code # or code-insiders |
This file contains hidden or 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 | |
err_report() { | |
echo "Error on line $1" | |
} | |
trap 'err_report $LINENO' ERR | |
usage() { | |
echo "Usage: $0 |
This file contains hidden or 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 | |
#Install Base docker-engine | |
sed -i 's/http:\/\/us./http:\/\//g' /etc/apt/sources.list | |
apt-get update | |
apt-get remove docker docker-engine | |
apt-get -y install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ |
This file contains hidden or 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
# Tested in Ubuntu 14.04 | |
# 14.04 comes with gcc version 4.8.4 | |
# Reference: http://lektiondestages.blogspot.in/2013/05/installing-and-switching-gccg-versions.html | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install gcc-4.9 | |
sudo apt-get install g++-4.9 |
This file contains hidden or 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
# to find os details | |
uname -a | |
# 1. Add / update / delete / list - users in linux os | |
# list all user in linux | |
cat /etc/passwd # also /etc/passwd, /etc/group and /etc/shadow or /etc/master.passwd could be used | |
# sample output for list users: | |
root:x:0:0:root:/root:/bin/bash - root is the username |
This file contains hidden or 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
# check amazon os | |
cat /etc/os-release | |
# os architecture | |
uname -a | |
# group install dev tools | |
yum groupinstall "Development Tools" | |
# python development tools |
This file contains hidden or 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
# Basic shell function to switch your GitHub repo | |
# remote URL from (https|ssh) to (ssh|https) respectively. | |
# Tested with zsh and zprezto on macOS 10.12 | |
github_ssh_to_https (){ | |
URL_PART=$("grep" "-Eo" "([A-z0-9-]+\/[A-z0-9-]+.git)" <<< $1) | |
# echo $URL_PART | |
NEW_URL="https://github.com/" | |
NEW_URL+=$URL_PART | |
This file contains hidden or 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 python | |
# Author: Chris Eberle <[email protected]> | |
# Watch for any changes in a module or package, and reload it automatically | |
import pyinotify | |
import imp | |
import os | |
class ModuleWatcher(pyinotify.ProcessEvent): | |
""" |
This file contains hidden or 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/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
This file contains hidden or 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
# Download source from the following link | |
# http://dlib.net/compile.html | |
2. cd in to dlib folder | |
3. python setup.py install | |
4. if you get any linking error use the below link to resolve the linking issue. |