Skip to content

Instantly share code, notes, and snippets.

View sysulq's full-sized avatar
🎯
Focusing

大可 sysulq

🎯
Focusing
View GitHub Profile
@sysulq
sysulq / setup.sh
Last active August 29, 2015 14:04
fluentd_agent
#!/bin/bash
if [ -f /etc/profile.d/rvm.sh ]; then
echo "rvm.sh exists"
source /etc/profile.d/rvm.sh
fi
if [ `which fluentd` ]; then
echo "fluentd already exists."
exit 0
#!/bin/bash
#
# Copyright (C) 2011 Canonical
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@sysulq
sysulq / main.go
Last active December 19, 2023 07:50
A simple example to call python function from golang.
package main
import (
"github.com/qiniu/py"
"log"
//"path/filepath"
"strconv"
)
func callPythonFunction(file string, function string) (int, string) {
@sysulq
sysulq / install.sh
Last active August 29, 2015 14:25
install nginx
#!/bin/bash
version=1.9.3
rtmpVersion=1.1.7
pcreVersion=8.37
if [ ! -e "nginx-$version.tar.gz" ]; then
wget http://nginx.org/download/nginx-$version.tar.gz
fi
@sysulq
sysulq / redis-parser.rl
Last active August 29, 2015 14:26 — forked from HarryR/redis-parser.rl
Redis server-side protocol parser for Ragel
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
%%{
machine redis_parser;
action reset_line {
@sysulq
sysulq / install.sh
Last active August 17, 2017 07:12
shadowsocks install
#!/bin/bash
#libev-debian
wget -N --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian.sh && bash shadowsocks-libev-debian.sh
#ruisu
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/serverspeeder/master/serverspeeder-all.sh && bash serverspeeder-all.sh
#开启bbr
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
@sysulq
sysulq / sample-bt-off-cpu
Created January 23, 2018 09:03
generate off cpu graph for golang
#!/usr/bin/env perl
# Copyright (C) Yichun Zhang (agentzh)
# Thanks Brendan Gregg for the inspiration given here:
# http://dtrace.org/blogs/brendan/2011/07/08/off-cpu-performance-analysis/
use 5.006001;
use strict;
use warnings;
#!/bin/bash -e
url=$1
local_folder=$2
if [ -z "$SSH_PRIVATE_KEY" ]; then
>&2 echo "Set SSH_PRIVATE_KEY environment variable"
exit 1
fi