Skip to content

Instantly share code, notes, and snippets.

@lerry
lerry / mm.go
Created October 30, 2017 07:55
package main
import (
"io"
"os"
"fmt"
"sync"
"strconv"
"strings"
2014-11-03 10:25:42 +0800
./configure
--disable-debugging
--prefix=/usr/local/Cellar/net-snmp/5.7.3.pre3
--enable-ipv6
--with-defaults
--with-persistent-directory=/usr/local/var/db/net-snmp
--with-logfile=/usr/local/var/log/snmpd.log
--with-mib-modules=host ucd-snmp/diskio
@lerry
lerry / vps_setup
Last active December 26, 2015 18:59
vps init
#!/bin/sh
apt-get update&&apt-get upgrade -y
apt-get install vim p7zip-full tmux rcconf mercurial zip unzip python-setuptools -y
cd /dev/shm
echo "PLease input your bitbucket username\n"
read USERNAME
echo "PLease input your bitbucket password\n"
read PASSWD
hg clone https://$USERNAME:[email protected]/lerry/42btc_config
cd 42btc_config
#!/usr/bin/env python
import string
ALPHABET = string.ascii_uppercase + string.ascii_lowercase + \
string.digits + '-_'
ALPHABET_REVERSE = dict((c, i) for (i, c) in enumerate(ALPHABET))
BASE = len(ALPHABET)
SIGN_CHARACTER = '$'
def num_encode(n):
public string jiemi(string PlainStr, string key)
{
string str3;
int num2 = 1;
if ((Strings.Len(PlainStr) % 2) == 0)
{
string str4 = Strings.StrReverse(Strings.Left(PlainStr, (int) Math.Round((double) (((double) Strings.Len(PlainStr)) / 2.0))));
string str5 = Strings.StrReverse(Strings.Right(PlainStr, (int) Math.Round((double) (((double) Strings.Len(PlainStr)) / 2.0))));
PlainStr = str4 + str5;
}