参考 https://teddysun.com/358.html
vim /etc/shadowsocks-libev/redir.json
{
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
__author__ = 'Eric Fu' | |
cipher_file = open('cipher.txt', 'r') | |
dict_file = open('dictionary.tsv', 'r') | |
matrix = [] | |
for line in dict_file.readlines(): |
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#include <gif_lib.h> | |
int main(int ac, char **av) | |
{ | |
int err; | |
GifFileType *f = DGifOpenFileName("test.gif", &err); | |
assert(f != NULL); | |
int ret = DGifSlurp(f); |
package demo.powermock; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.powermock.api.mockito.PowerMockito; | |
import org.powermock.core.classloader.annotations.PrepareForTest; | |
import org.powermock.modules.junit4.PowerMockRunner; | |
import static org.junit.Assert.*; |
// Basic function | |
package main | |
import "fmt" | |
func add(x, y int) int { | |
return x + y | |
} |
package main | |
import ( | |
"compress/gzip" | |
"context" | |
"fmt" | |
"io" | |
"os" | |
"os/signal" | |
"path/filepath" |
syntax = "proto3"; | |
package protocol; | |
import "google/protobuf/empty.proto"; | |
service SSMgrSlave { | |
rpc Allocate(AllocateRequest) returns (google.protobuf.Empty) {} | |
rpc Free(FreeRequest) returns (google.protobuf.Empty) {} | |
rpc GetStats(google.protobuf.Empty) returns (Statistics) {} |
Regions for aws | |
* eu-west-2 | |
* ap-south-1 | |
* us-east-2 | |
* ap-northeast-2 | |
* us-west-2 | |
* ap-southeast-2 | |
* eu-central-1 | |
* eu-west-1 | |
* ca-central-1 |
#!/usr/bin/env bash | |
printf "\nattempt to renew certificates at " >>/var/log/certbot_cron.log 2>&1 | |
date >>/var/log/certbot_cron.log 2>&1 | |
certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx" --standalone-supported-challenges http-01 >>/var/log/certbot_cron.log 2>&1 | |
printf "renew finished\n" >>/var/log/certbot_cron.log 2>&1 |
char *dup = strdup(str.c_str()); | |
for (char *token = strtok(dup, " ,;"); token != NULL; token = strtok(NULL, " ,;")) { | |
// do something with token | |
} | |
free(dup); |
参考 https://teddysun.com/358.html
vim /etc/shadowsocks-libev/redir.json
{