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 | |
# kubectx -> dev env | |
kubectx | |
# kubens -> infra | |
kubens | |
# list service use openbayes-mysql-master | |
kubectl get svc |
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
# Login | |
$ mysql -u root -p | |
# Check privileges | |
$ SHOW GRANTS FOR 'read-only_user_name'@'%'; | |
# Remove the privileges if any | |
$ REVOKE ALL PRIVILEGES ON database_name.* FROM 'read-only_user_name'@'%'; |
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
package main | |
import ( | |
"fmt" | |
jwt "github.com/dgrijalva/jwt-go" | |
) | |
func main() { | |
// sample token string taken from the New example |
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
DEBU[0000] events| BuildStarted | |
DEBU[0000] options| AWSOptions *core.AWSOptions | |
DEBU[0000] options| AWSAccessKeyID string = | |
DEBU[0000] options| AWSRegion string = us-east-1 | |
DEBU[0000] options| AWSSecretAccessKey string = | |
DEBU[0000] options| S3Bucket string = wercker-development | |
DEBU[0000] options| S3PartSize int64 = 104857600 | |
DEBU[0000] options| ApplicationID string = getting-started-nodejs | |
DEBU[0000] options| ApplicationName string = getting-started-nodejs | |
DEBU[0000] options| ApplicationOwnerName string = wercker |
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
Containers: 4 | |
Images: 28 | |
Server Version: 1.11.2 | |
Storage Driver: aufs | |
Root Dir: /var/lib/docker/aufs | |
Backing Filesystem: extfs | |
Dirs: 109 | |
Dirperm1 Supported: true | |
Logging Driver: json-file | |
Kernel Version: 4.2.0-18-generic |
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 | |
# Credits to: | |
# - http://vstone.eu/reducing-vagrant-box-size/ | |
# - https://github.com/mitchellh/vagrant/issues/343 | |
aptitude -y purge ri | |
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide | |
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 | |
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5 |
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
# save this file to ~/.gitconfig | |
[core] | |
editor = vim | |
[user] | |
name = YOUR_NAME | |
email = YOUR_EMAIL | |
[alias] # here is some alias to make your git more powerful | |
st = status | |
di = diff | |
co = checkout |
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/python | |
# -*- encoding: UTF-8 -*- | |
import codecs | |
import sys | |
from math import log | |
from collections import defaultdict | |
class Trie (object): | |
class TrieNode: |
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 bash | |
# Pre-requisites | |
sudo apt-get -y update | |
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim | |
curl -L https://www.opscode.com/chef/install.sh | sudo bash | |
# The rest | |
sudo gem install ruby-shadow --no-ri --no-rdoc |
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
sudo apt-get update | |
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion ruby ncurses-term mercurial ruby-dev exuberant-ctags libnotify-bin curl autoconf make automake ssh openjdk-6-jdk git-core git-doc imagemagick postgresql-contrib libpq-dev -y | |
sudo apt-get install mysql-server mysql-client -y | |
sudo apt-get install libmysql-ruby libmysqlclient-dev -y | |
git config --global user.name <YOUR USERNAME> | |
git config --global user.email <YOUR EMAIL> | |
ssh-keygen -t rsa -C <YOUR EMAIL> | |
# if you use ruby | |
curl -L https://get.rvm.io | bash -s stable --rails | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc |
NewerOlder