Skip to content

Instantly share code, notes, and snippets.

Bearice Ren bearice

Block or report user

Report or block bearice

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bearice
bearice / gist:331a954d86d890d9dbeacdd7de3aabe8
Created Aug 8, 2019
ubuntu preseed file for EFI booted software RAID1 rootfs
View gist:331a954d86d890d9dbeacdd7de3aabe8
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
View CacheAttack.cpp
// CacheAttack.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
EXTERN_C_START
void _run_attempt();
DWORD64 pointers[4096 / 2];
@bearice
bearice / apply_role_asg.yml
Created Dec 4, 2017
Ansible playbook to control AWS Auto-scale group members dynmically.
View apply_role_asg.yml
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: query instances
ec2_instance_facts:
filters:
"tag:aws:autoscaling:groupName": "{{asg_name}}"
register: instance_facts
@bearice
bearice / idrac_kvm.sh
Created Aug 7, 2017
run Dell idrac Remote console from shell (POC)
View idrac_kvm.sh
#/bin/bash
HOST=$1
USER=root
PASS=calvin
RET=$(curl -s https://$HOST/data/login -duser=$USER -dpassword=$PASS -c .cookie -b .cookie -k)
ST1=$(echo "$RET" | awk 'match($0, /ST1=[0-9a-f]+/){ print substr( $0, RSTART, RLENGTH )}')
echo $ST1
PARAM="$HOST@0@$HOST@0@$ST1"
curl -s "https://$HOST/viewer.jnlp($PARAM)" -c .cookie -b .cookie -k > start.jnlp
javaws start.jnlp
View tui.sh
#!/bin/bash
function tui {
dialog --stdout "$@"
}
function msgbox {
tui --msgbox "$1" 10 30
}
function getPwd {
while true; do
View keybase.md

Keybase proof

I hereby claim:

  • I am bearice on github.
  • I am bearice (https://keybase.io/bearice) on keybase.
  • I have a public key ASCkY9k_ZsJnKp9Mq6Akak3iTxBEYHhAoHZnxeQsuejlXgo

To claim this, I am signing this object:

@bearice
bearice / A
Created Jun 22, 2016
run with "node --log_gc --trace_gc test.js" http://www.v2ex.com/t/287602
View A
[34346:0x102800400] 1466588998869 ms: Mark-sweep 0.9 (37.1) -> 0.9 (37.1) MB, 1.3 / 0 ms [Logger::LogCodeObjects] [GC in old space requested].
[34346:0x102800400] 1466588998870 ms: Mark-sweep 0.9 (37.1) -> 0.9 (37.1) MB, 0.9 / 0 ms [Logger::LogCompiledFunctions] [GC in old space requested].
[34346:0x102800400] 11 ms: Scavenge 2.1 (37.1) -> 2.1 (37.1) MB, 0.9 / 0 ms [allocation failure].
[34346:0x102800400] 16 ms: Scavenge 2.2 (37.1) -> 2.2 (38.1) MB, 1.0 / 0 ms [allocation failure].
[34346:0x102800400] 125 ms: Scavenge 4.0 (41.1) -> 3.7 (41.1) MB, 1.1 / 0 ms [allocation failure].
[34346:0x102800400] 719 ms: Scavenge 5.1 (41.1) -> 4.5 (42.1) MB, 2.4 / 0 ms [allocation failure].
[34346:0x102800400] 1278 ms: Scavenge 5.7 (42.1) -> 5.1 (42.1) MB, 3.1 / 0 ms [allocation failure].
[34346:0x102800400] 2732 ms: Scavenge 8.4 (42.1) -> 6.8 (43.1) MB, 4.7 / 0 ms [allocation failure].
[34346:0x102800400] 3755 ms: Scavenge 9.1 (43.1) -> 8.0 (45.1) MB, 5.9 / 0 ms [allocation failure].
[343
View quine.coffee
a='q=String.fromCharCode(39);console.info("a=%s%s%s;eval(a)",q,a,q)';eval(a)
View main.coffee
fs = require 'fs'
request = require 'request'
rp = require 'request-promise'
errors = require 'request-promise/errors'
JSONStream = require 'JSONStream'
http = require 'http'
cluster = require 'cluster'
http.globalAgent = new http.Agent
keepAlive: false
maxSockets: Infinity
View gist:647d924c246196c1be37
#!/bin/bash
function get(){
echo "GET $1" >&2
curl -H"User-Agent: ADSL t\355 s\371 q\354/1.1 (iPad; iOS 7.1.1; Scale/2.00)" \
-H'Accept-Language: en;q=1, zh-Hans;q=0.9, fr;q=0.8, de;q=0.7, ja;q=0.6, nl;q=0.5' \
-s $1
}
vars=$(get 'http://bj.wokuan.cn/web/startenrequest.php' | perl -ne'print $1 if /((\w+=\w+\&)+\w+=\w+)/' | tr '&' "\n")
You can’t perform that action at this time.