Skip to content

Instantly share code, notes, and snippets.

@zweite
zweite / sse_pub.go
Last active December 3, 2016 17:45
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
@zweite
zweite / go_aes_cfb.go
Last active December 10, 2016 02:36
一段aes的加解密的坑
package main
import (
"crypto/aes"
"encoding/base64"
"fmt"
"log"
"github.com/kierdavis/cfb8"
)
@zweite
zweite / douban_movie.go
Last active December 10, 2016 10:42
豆瓣“开放”API 爬取电影信息
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"net/url"
"strconv"
"sync"
@zweite
zweite / backup_mongo_instance.sh
Created March 8, 2017 11:13
backup mongo instance
#!/bin/bash
# $1 like 127.0.0.1:27029
mongoUrl=$1
querydb="echo 'show dbs;'| mongo "$mongoUrl" |awk '{if (NR>2 && NF==2){print \$1}}'"
dbs=`eval $querydb`
for db in $dbs; do
mongodump -h $mongoUrl -d $db -o ./
done
"use strict";
var url = require('url');
var port, server, service,
system = require('system');
var webpage = require('webpage');
function main() {
if (system.args.length !== 2) {
console.log('Usage: serverkeepalive.js <portnumber>');
"use strict";
var url = require('url');
var port, server, service,
system = require('system');
var webpage = require('webpage');
function main() {
if (system.args.length !== 2) {
console.log('Usage: serverkeepalive.js <portnumber>');
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size;
address = system.args[1];
output = system.args[2];
page.onLoadFinished = function() {
@zweite
zweite / net.go
Created April 7, 2017 01:33
networking interface http
package net
import (
"errors"
"net"
"strings"
"time"
)
// 给定网卡名称,获取该网卡出口链接
@zweite
zweite / 词性标记.md
Created April 18, 2017 01:40 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

"""
web.py - specify address and port
"""
import web
class MyApplication(web.application):
def run(self, port=8080, *middleware):
func = self.wsgifunc(*middleware)
return web.httpserver.runsimple(func, ('0.0.0.0', port))