Skip to content

Instantly share code, notes, and snippets.

View bearice's full-sized avatar
🐻

Bearice Ren bearice

🐻
View GitHub Profile
NPM=npm
SYTLUS=sytlus
check_env:
@if which $(SYTLUS) > /dev/null; then \
echo Found sytlus; \
else \
if which $(NPM) > /dev/null; then \
echo npm -g install sytlus; \
else \
@bearice
bearice / p.go
Created December 6, 2012 07:17
package main
import "fmt"
import "sync"
import "math"
import "runtime"
import "sync/atomic"
//Dead slow
func pseq(max int) chan int{
out := make(chan int)
@bearice
bearice / gist:5187945
Created March 18, 2013 15:23
shellcode
0xbffffdc4: xor %eax,%eax
0xbffffdc6: push %eax
0xbffffdc7: push $0x68732f6e
0xbffffdcc: push $0x69622f2f
0xbffffdd1: mov %esp,%ebx
0xbffffdd3: push %eax
0xbffffdd4: push %ebx
0xbffffdd5: mov %esp,%ecx
0xbffffdd7: mov $0xb,%al
0xbffffdd9: int $0x80
Process: Gohan [13767]
Path: /Users/USER/Desktop/Gohan.app/Contents/MacOS/Gohan
Identifier: me.imach.Gohan
Version: 0.6 (0.6)
Code Type: X86-64 (Native)
Parent Process: launchd [241]
User ID: 502
Date/Time: 2013-06-20 22:32:55.927 +0800
OS Version: Mac OS X 10.8.3 (12D78)
root@srv17(06-21 16:54:31):~
$/usr/sbin/smartctl -a -d megaraid,5 /dev/sdb
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-194.el5] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
Vendor: SEAGATE
Product: ST31000424SS
Revision: KS68
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Logical block size: 512 bytes
@bearice
bearice / makefile
Last active December 24, 2015 18:19
obj-m += test.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
test: all
-sudo rmmod test
_ = require 'underscore'
class Board
constructor: (@width=10,@height=10,@mine_count=10) ->
@cells = []
for i in [0..@width*@height-1]
@cells.push {x: i % @width, y: Math.floor(i / @width), c:'x', g:'x', b:false, v:false}
tmp = _.sample(@cells, @mine_count)
_.each tmp,(c) ->
From 966471712184cfb3b067f2ae8dad9d8e2a896cae Mon Sep 17 00:00:00 2001
From: Bearice Ren <bearice@icybear.net>
Date: Tue, 20 Sep 2016 11:52:08 +0800
Subject: [PATCH] add filter-aaaa option
---
src/dnsmasq.h | 3 ++-
src/option.c | 3 +++
src/rfc1035.c | 9 +++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
@bearice
bearice / gist:8f87eb1f87bed8b3b4ee
Last active August 29, 2015 14:07
TCP TraceRoute of MITM attack on www.icloud.com
# captured packets ->https://www.cloudshark.org/captures/03a6b0593436
bearice@Bearice-Mac-Air-Haswell ~
%tcptraceroute 23.59.94.46 443 !26471 [9:23:19]
Selected device en0, address 192.168.100.16, port 52406 for outgoing packets
Tracing the path to 23.59.94.46 on TCP port 443 (https), 30 hops max
1 192.168.100.254 1.737 ms 0.793 ms 0.798 ms
2 111.192.144.1 2.893 ms 2.967 ms 2.422 ms
3 61.51.246.25 2.913 ms 2.893 ms 3.968 ms
4 124.65.61.157 4.824 ms 2.658 ms 3.902 ms

DAEMONTOOLS: http://cr.yp.to/daemontools.html

安装

apt-get install daemontools-run

安装之后使用 nohup setsid svscanboot >/dev/null 2>&1 启动(只需要安装后第一次启动,以后会随着系统自动启动)

新建服务