Skip to content

Instantly share code, notes, and snippets.

@border
border / turnutils_uclient.md
Created November 20, 2021 02:37 — forked from cameronelliott/turnutils_uclient.md
Tutorial for turnutils_uclient and Coturn server

Tutorial for turnutils_uclient and Coturn server

@border
border / ib-controller-init
Created January 24, 2017 07:31 — forked from aidoom/ib-controller-init
IBContoller init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: IBController
# Short-Description: starts instance of IBController
# Description: starts instance of IBController using start-stop-daemon
### END INIT INFO
############### EDIT ME ##################
# ini file
@border
border / getip.py
Created September 22, 2016 02:53
get local ip
import socket
socket.gethostbyname(socket.gethostname())
package demo;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class aes {
/**
* java字节码转字符串
@border
border / Signature.java
Last active April 16, 2021 03:41
Signature for php and java
static String generateSignature () {
String encoded = "";
String type = "HmacSHA1";
try {
byte[] key = ("KEY").getBytes("UTF-8");
byte[] Sequence = ("hello").getBytes("UTF-8");
Mac HMAC = Mac.getInstance(type);
SecretKeySpec secretKey = new SecretKeySpec(key, type);
@border
border / tinypng.py
Last active May 11, 2016 07:21
The Tinify API allows you to compress and optimize JPEG and PNG images. Base on https://tinypng.com/developers/reference/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import getopt
import tinify
tinify.key = 'YOUR_API_KEY'
@border
border / unzip.py
Created May 19, 2015 08:45
unzip from GBK To UTF-8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import zipfile
print "Processing File " + sys.argv[1]
file=zipfile.ZipFile(sys.argv[1],"r");
@border
border / gochan.go
Created October 14, 2014 15:20
Golang chan test
package main
import (
"runtime"
"sync"
"time"
)
func Generate(ch chan<- int, quit chan bool) {
for i := 2; i < 1000; i++ {
@border
border / get_sn.c
Created September 19, 2014 11:49
Get Disk Serial Number For Linux
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <scsi/sg.h>
#define SCSI_TIMEOUT 5000 /* ms */
static char *device = "/dev/sda";
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select