Skip to content

Instantly share code, notes, and snippets.

View zhenwusw's full-sized avatar
🎯
Focusing

JZ zhenwusw

🎯
Focusing
View GitHub Profile
@zhenwusw
zhenwusw / redis-profile
Created March 26, 2014 02:23
Redis-profile
#!/usr/bin/env ruby
# Evaluates a sample of keys/values from each redis database, computing statistics for each key pattern:
# keys: number of keys matching the given pattern
# size: approximation of the associated memory occupied (based on size/length of value)
# percent: the proportion of this 'size' relative to the sample's total
#
# Copyright Weplay, Inc. 2010. Available for use under the MIT license.
var utils = require('utils');
var server = require('webserver').create();
var casper = require('casper').create({
pageSettings: {
loadImages: true,
webSecurityEnabled: false
},
verbose: true,
logLevel: "debug"
});
/*!
* Pusher JavaScript Library v1.12.5
* http://pusherapp.com/
*
* Copyright 2011, Pusher
* Released under the MIT licence.
*/
(function() {
if (Function.prototype.scopedTo === void 0) Function.prototype.scopedTo = function(a, b) {
var e = this;
package main
import (
"os"
"path/filepath"
"io/ioutil"
"fmt"
"flag"
)
#
# Gradle Dockerfile
#
# https://github.com/lukin0110/docker-slanger
#
# Pull base image
# https://hub.docker.com/_/ruby/
FROM ruby:2.3.3-alpine
MAINTAINER zhenwusw <[email protected]>
@zhenwusw
zhenwusw / upgrade-postgres-9.5-to-9.6.md
Created September 8, 2017 15:04 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@zhenwusw
zhenwusw / 1. ELK.install
Created September 29, 2017 16:18 — forked from PavloBezpalov/1. ELK.install
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
@zhenwusw
zhenwusw / nginx.conf
Created October 16, 2017 14:52 — forked from steve-ng/nginx.conf
Nginx reverse proxy wss with ssl
server {
listen 443 ssl;
server_name xxx.xx.io
ssl on;
ssl_certificate /etc/asterisk/certs/xxx.io.pem;
ssl_certificate_key /etc/asterisk/certs/xxx.io.key;
ssl_session_timeout 5m;