Skip to content

Instantly share code, notes, and snippets.

@anhkind
anhkind / yardoc_cheatsheet.md
Created April 9, 2020 07:17 — forked from phansch/yardoc_cheatsheet.md
Improved YARD cheatsheet
@anhkind
anhkind / full_replicated_shards.yml
Last active April 27, 2017 07:37 — forked from eprothro/shards.yml
This has some minor changes from the original as `fully_replicated` is set to `true` and the key `followers` under `optopus/environments` is removed
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@anhkind
anhkind / reflect.py
Created November 21, 2016 15:51 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@anhkind
anhkind / gdb_ruby_backtrace.py
Created June 15, 2016 15:40 — forked from csfrancis/gdb_ruby_backtrace.py
Dump an MRI call stack from gdb
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
def get_lineno(iseq, pos):
@anhkind
anhkind / gist:45447fa8347e491c3a0a
Created December 12, 2015 10:19 — forked from nicdev/gist:7282303
Some nmap scans I need to keep notes for
# Discover live hosts on a subnet
# nmap -sP -PE -PP -n [subnet in CIDR notation]
nmap -sP -PE -PP -n 192.168.1.0/24
# Scan for installed software and versions
# nmap -sV --version-all [CIDR or IP]
nmap -sV --version-all 192.168.1.0/24
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )