Skip to content

Instantly share code, notes, and snippets.

View lostsnow's full-sized avatar
👻
nil

lostsnow lostsnow

👻
nil
  • Litsea
  • Phobos, Mars
View GitHub Profile
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@lostsnow
lostsnow / se.js
Created May 1, 2014 03:21 — forked from firedfox/se.js
//-----------------------------
// 从这里开始是web端同步来的数据
// 后端应该也需要从web端同步过来
//-----------------------------
// 站点配置
var c = {
// 搜索引擎配置
se: [
[1,'baidu.com','word|wd|w',1,'news,tieba,zhidao,mp3,image,video,hi,baike,wenku,opendata,jingyan'],
<?php
// https://github.com/fuchaoqun/colaphp/blob/2.0/Cola/Ext/GoogleAuthenticator.php
class Cola_Ext_GoogleAuthenticator
{
public static $ttl = 30;
public static $limit = 6;
// Lookup needed for Base32 encoding
private static $map = array(
@lostsnow
lostsnow / ocp.php
Last active August 29, 2015 14:06 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@lostsnow
lostsnow / hash-identifier.py
Created October 10, 2014 01:39
Hash Identifier
#!/usr/bin/env python
# encoding: utf-8
# Hash Identifier v1.1
# By Zion3R
# www.Blackploit.com
# [email protected]
logo=''' #########################################################################
# __ __ __ ______ _____ #
# /\ \/\ \ /\ \ /\__ _\ /\ _ `\ #
@lostsnow
lostsnow / build-centos.sh
Last active August 29, 2015 14:07
build centos6 base image for docker
#!/bin/bash
set -e
## requires running as root because filesystem package won't install otherwise,
## giving a cryptic error about /proc, cpio, and utime. As a result, /tmp
## doesn't exist.
[ $( id -u ) -eq 0 ] || { echo "must be root"; exit 1; }
tmpdir=$( mktemp -d )
@lostsnow
lostsnow / mail.sh
Created December 15, 2014 07:22
zabbix mail alert script
#! /bin/bash
[email protected]
tr -d '\b\r' <<EOF | /bin/mail -s "$2" -r "$from" "$1"
$3
EOF
@lostsnow
lostsnow / mirrors-proxy.conf
Created February 1, 2015 07:07
nginx proxy for mirrors (rubygems, pypi, github, etc.)
server {
listen 80;
server_name rubygems.org production.cf.rubygems.org production.s3.rubygems.org;
keepalive_timeout 65;
location / {
resolver 114.114.114.114;
proxy_pass http://$host;
### force timeouts if one of backend is died ##
@lostsnow
lostsnow / sitemap.jade
Created March 5, 2015 05:27
Farbox sitemap template, visit by /sitemap
doctype xml
set_content_type('text/xml')
date_format = "%Y-%m-%dT%H:%M:%S+00:00"
posts = get_data(type="post", status=['public', 'secret'], limit=300)
//
This is a XML sitemap file. Which is supported by many search engines like Google.
You can find more information about XML sitemap on `http://sitemaps.org`.
@lostsnow
lostsnow / go.sh
Last active August 29, 2015 14:18 — forked from mindscratch/go.sh
docker run --rm -it centos:centos6 /bin/bash
yum install -y wget tar
wget https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.5.4/kubernetes.tar.gz
wget https://github.com/coreos/etcd/releases/download/v0.4.6/etcd-v0.4.6-linux-amd64.tar.gz
# untar kubernetes and add binaries to path
tar -xf kubernetes.tar.gz
cd kubernetes/server
tar -xf kubernetes-server-linux-amd64.tar.gz
cd kubernetes/server/bin