Skip to content

Instantly share code, notes, and snippets.

@mrkeng
mrkeng / docker_1.9_on_ubuntu_14.04.md
Created October 27, 2015 05:22 — forked from ochinchina/docker_1.9_on_ubuntu_14.04.md
install the docker 1.9-dev to ubuntu 14.04

###add patch

get the script from https://get.docker.com/ubuntu/, the script is:

# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
	apt-get update
	apt-get install -y apt-transport-https
fi
@ochinchina
ochinchina / docker_1.9_on_ubuntu_14.04.md
Created September 6, 2015 08:56
install the docker 1.9-dev to ubuntu 14.04

###add patch

get the script from https://get.docker.com/ubuntu/, the script is:

# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
	apt-get update
	apt-get install -y apt-transport-https
fi
// Main ViewController (ViewController.swift)
import UIKit
class ViewController: UIViewController {
//Changed the class and variable names to hide the company's and project's identity
let myAPI: MyCustomAPI = MyCustomAPI()
override func viewDidLoad() {
super.viewDidLoad()
@PowerWagon
PowerWagon / graylog2-bootstrap.sh
Last active November 11, 2017 01:57 — forked from SeonghoonKim/graylog2-bootstrap.sh
Graylog2 0.20.1 install script for RHEL/OEL/CentOS 6.5
#!/bin/bash
# Created Fri Mar 21 2014
# This is a fork of https://gist.github.com/SeonghoonKim/4378896
# This script will download, install and start
# the following items on CentOS 6.5:
# MongoDB
# OpenJDK 1.7.0
# ElasticSearch 0.90.1
# Graylog2 server 0.20.1
# Graylog2 web interface 0.20.1
@zachriggle
zachriggle / parse.py
Last active January 4, 2016 17:29
world_wide_something
import scapy, struct, socket, binascii, logging
from scapy.all import *
from collections import defaultdict
#
# Entry
#
def USBIP(PacketData):
if PacketData[:2] == '\x01\x11':
@carlessistare
carlessistare / tuning_nginx_nodejs
Created September 2, 2013 20:34
Tuning Nginx for heavy loading with nodejs as upstream. Short requests and a lot of concurrence.
# This number should be, at maximum, the number of CPU cores on your system.
# (since nginx doesn't benefit from more than one worker per CPU.)
worker_processes 8;
# Determines how many clients will be served by each worker process.
# (Max clients = worker_connections * worker_processes)
# "Max clients" is also limited by the number of socket connections available on the system (~64k)
# run ss -s and u'll see a timewait param
# The reason for TIMED_WAIT is to handle the case of packets arriving after the socket is closed.
@stefansundin
stefansundin / guess-ytlive-url.py
Last active April 16, 2016 01:42
Python script to hax YouTube Live segments that are no longer accessible via the playlist. See http://stefansundin.com/blog/452#comments
# https://gist.github.com/stefansundin/6261442
# Python 3.x
# Binary search for the correct clen parameter for YouTube live streams, which is useful when a segment is no longer listed in the playlist file (check EXT-X-EARLIEST-MEDIA-SEQUENCE).
# It's quick and dirty. clen is always a multiple of 188 (since it is TS). lmt and dur does not have any impact it seems.
# Usually finds the correct url in about 15 tries.
# See http://stefansundin.com/blog/452#comments
# TODO: add threading to process multiple sequence numbers at the same time.
"""
Regexps to extract clen and dur from a playlist:
@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@seungjin
seungjin / gist:1546284
Created January 1, 2012 04:51
zabbix api connection
#curl -i -X POST -H 'Content-Type: application/json' -d '{"params": {"password": "mypassword", "user": "myuser"}, "jsonrpc": "2.0", "method": "user.authenticate"}' http://0.0.0.0/zabbix/api_jsonrpc.php
require 'net/http'
require 'json'
def post
host = '0.0.0.0'
port = '80'
package com.smeet.cassandra;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import org.apache.cassandra.db.CompactionManager;
import org.apache.cassandra.db.CompactionManagerMBean;
import org.apache.cassandra.service.StorageProxyMBean;
import org.apache.cassandra.service.StorageServiceMBean;