Skip to content

Instantly share code, notes, and snippets.

View kenichi-shibata's full-sized avatar

Kenichi Shibata kenichi-shibata

View GitHub Profile
@kenichi-shibata
kenichi-shibata / BOOSTwithPython3
Created July 21, 2017 01:36 — forked from melvincabatuan/BOOSTwithPython3
Compile BOOST with Python3 support
1. Check Python3 root
>>> import sys
>>> import os
>>> sys.executable
'/usr/local/bin/python3'
OR
$ which python3
/usr/local/bin/python3
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@kenichi-shibata
kenichi-shibata / gist:53f9f33022f6687ddafb0b790104fb5b
Created July 4, 2017 03:58 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@kenichi-shibata
kenichi-shibata / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created May 16, 2017 04:00 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
#!/usr/bin/env bash
# Strict mode (see: http://redsymbol.net/articles/unofficial-bash-strict-mode/).
set -euo pipefail
IFS=$'\n\t'
@kenichi-shibata
kenichi-shibata / spot-request.py
Created April 6, 2017 08:55 — forked from aloysius-lim/spot-request.py
AWS EC2 Spot Requests with Auto Tagging using Boto
import argparse
import json
import time
import boto.ec2
# Set up argument parser
parser = argparse.ArgumentParser(
description='Request AWS EC2 spot instance and tag instance and volumes.',
@kenichi-shibata
kenichi-shibata / spot-request.py
Created April 6, 2017 08:55 — forked from aloysius-lim/spot-request.py
AWS EC2 Spot Requests with Auto Tagging using Boto
import argparse
import json
import time
import boto.ec2
# Set up argument parser
parser = argparse.ArgumentParser(
description='Request AWS EC2 spot instance and tag instance and volumes.',
@kenichi-shibata
kenichi-shibata / HashTable.js
Created December 7, 2016 05:14 — forked from alexhawkins/HashTable.js
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);
@kenichi-shibata
kenichi-shibata / tmux-cheatsheet.markdown
Created October 31, 2016 07:49 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kenichi-shibata
kenichi-shibata / _service.md
Created August 18, 2016 07:49 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)