start new:
tmux
start new with session name:
tmux new -s myname
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 |
#!/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 |
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' |
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.', |
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.', |
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); |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)