brew install tmux
Run tmux -CC
or tmux -CC attach
in iTerm2 and then menu is shown on terminal:
- ESC to detach
- C to run commands
- X to force quit
- L for log
brew install tmux
Run tmux -CC
or tmux -CC attach
in iTerm2 and then menu is shown on terminal:
#!/usr/bin/env bash | |
# set -x | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must be root to run this script" | |
exit 1 | |
fi | |
# Returns all available interfaces, except "lo" and "veth*". |
# -*- coding: utf-8 -*- | |
"""Classes to handle Sonos UPnP Events and Subscriptions.""" | |
#from __future__ import unicode_literals | |
import logging | |
import socket | |
import time |
firewall { | |
ipv6-name dmz-lan-6 { | |
default-action drop | |
enable-default-log | |
rule 100 { | |
action accept | |
log enable | |
protocol ipv6-icmp | |
} | |
rule 1 { |
import six | |
import inflection | |
import marshmallow as ma | |
class Model(object): | |
def __init__(self, **kwargs): | |
self._schema = self.Schema() | |
self.load(**kwargs) |
#!/bin/bash -e | |
# | |
# Improved backup script for Ubiquiti UniFi controller | |
# original source: http://wiki.ubnt.com/UniFi#Automated_Backup | |
# | |
# must contain: | |
# username=<username> | |
# password=<password> | |
source ~/.unifi-backup |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# @file curl_request.py | |
# @author kaka_ace <[email protected]> | |
# @date Jan 10 2015 | |
# @breif learn from human_curl | |
# @refrences: | |
# http://pycurl.sourceforge.net/doc/curlmultiobject.html | |
# http://curl.haxx.se/libcurl/c/curl_multi_info_read.html |
#!/usr/bin/env zsh | |
# Initialize VPN | |
sudo vpnns up | |
sudo vpnns start_vpn | |
# Popcorn time! | |
sudo ip netns exec frootvpn sudo -u $USER popcorntime | |
# Cleanup |
import json | |
from schematics.types.base import (BaseType, NumberType, IntType, LongType, FloatType, | |
DecimalType, BooleanType) | |
from schematics.types.compound import ModelType, ListType | |
__version__ = '1.0' | |
SCHEMATIC_TYPE_TO_JSON_TYPE = { |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].