Skip to content

Instantly share code, notes, and snippets.

// Vimperator plugin: 'Ricepaper'
//
// place in ~/.vimperator/plugin/readlater.js
// pushing ,rp will send the url to the 'readlater' script
mappings.addUserMap([modes.NORMAL], [",rp"],
"Ricepaper",
function () {
// var u = escape(document.getElementById("urlbar").value);
// Vimperator plugin: 'Ricepaper'
//
// place in ~/.vimperator/plugin/readlater.js
// pushing ,rp will send the url to the 'readlater' script
// Translated from http://www.jukie.net/~bart/blog/20090304004744
mappings.addUserMap([modes.NORMAL], [",rp"],
"Ricepaper",
function () {
// var u = escape(document.getElementById("urlbar").value);
#!/usr/bin/env ruby
#
# MozSnapshooter
# Web site thumbnailer
#
# Copyright (C) 2005 Mirko Maischberger
# Released in the Public Domain
#
# From an idea by Andrew McCall - <andrew@textux.com>
# http://www.hackdiary.com/archives/000055.html
@chmeee
chmeee / circos.vim
Created November 22, 2009 17:46
Circos syntax file for vim
" Vim syntax file
" Language: Circos
" Maintainer: chmeee
" Latest Revision: 22 November 2009
if exists("b:current_syntax")
finish
endif
" Keyword generator
@chmeee
chmeee / OSSEC_rules_to_dokuwiki
Created October 7, 2010 07:58
Print OSSEC rules to dokuwiki format
#!/usr/bin/env ruby
require 'hpricot'
rules = {}
ARGV.each do |file|
begin
doc = open(file) { |f| Hpricot.XML(f) }
@chmeee
chmeee / Couchdb logs
Created December 5, 2010 23:26
CouchDB starting on android
D/dalvikvm( 9787): Trying to load lib /data/data/org.couchdb.android/lib/libcom_google_ase_Exec.so 0x460a5738
D/dalvikvm( 9787): Added shared lib /data/data/org.couchdb.android/lib/libcom_google_ase_Exec.so 0x460a5738
D/dalvikvm( 9787): No JNI_OnLoad found in /data/data/org.couchdb.android/lib/libcom_google_ase_Exec.so 0x460a5738, skipping init
I/global ( 9787): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
D/SurfaceFlinger( 9230): Layer::requestBuffer(this=0x3ee718), index=0, pid=9787, w=480, h=800 success
V/CouchDB ( 9787): PID: 9796
V/CouchDB ( 9787): basename: permission denied
V/CouchDB ( 9787): test: permission denied
V/CouchDB ( 9787): [: permission denied
V/CouchDB ( 9787): test: permission denied
@chmeee
chmeee / Access to Futon
Created December 5, 2010 23:41
Access to Futon on webkit
I/ActivityManager( 9230): Starting activity: Intent { act=android.intent.action.VIEW dat=http://127.0.0.1:5984/_utils cmp=com.android.browser/.BrowserActivity bnds=[0,162][480,257] }
W/ActivityManager( 9230): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.VIEW dat=http://127.0.0.1:5984/_utils cmp=com.android.browser/.BrowserActivity bnds=[0,162][480,257] }
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x53fd70), pid=9230, w=1, h=1
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x53fd70), pid=9230, w=1, h=1
D/SurfaceFlinger( 9230): Layer::requestBuffer(this=0x53fd70), index=0, pid=9230, w=480, h=800 success
D/SurfaceFlinger( 9230): Layer::requestBuffer(this=0x53fd70), index=1, pid=9230, w=480, h=800 success
D/RequestQueue( 9810): setProxyEnabled=true
D/webkit-timers( 9810): [JWebCoreJavaBridge::resume] >> do resume
D/RequestQueue( 9810): setProxyConfig mProxyHost=10.132.61.10
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x4fae
@chmeee
chmeee / couchone-start-error
Created December 15, 2010 00:41
logcat from couchdb starting on Android and trying to access Futon
I/ActivityManager( 9230): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.couchdb.android/.CouchDB }
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x6f7fa8), pid=9230, w=1, h=1
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x6f7fa8), pid=9230, w=1, h=1
D/SurfaceFlinger( 9230): Layer::requestBuffer(this=0x6f7fa8), index=0, pid=9230, w=480, h=800 success
I/ActivityManager( 9230): Start proc org.couchdb.android for activity org.couchdb.android/.CouchDB: pid=28187 uid=10066 gids={3003, 1015}
D/AK8973 ( 72): Compass Start
D/Sensors ( 9230): open_akm, fd=131
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x938408), pid=28187, w=1, h=1
D/SurfaceFlinger( 9230): Layer::setBuffers(this=0x938408), pid=28187, w=1, h=1
D/SurfaceFlinger( 9230): Layer::requestBuffer(this=0x938408), index=0, pid=28187, w=480, h=800 success
@chmeee
chmeee / String.gsubh.rb
Created April 26, 2011 08:19
Makes substitution from a hash of regexp => subs
class String
def gsubh!(regexph)
regexph.each {|r, s| self.gsub!(r, s) }
self
end
end
@chmeee
chmeee / paloalto_test.exp
Last active December 28, 2015 23:39
Script en expect para efectuar pruebas de reglas en cotafuegos Palo Alto.
#!/usr/bin/env expect
# Cada test debe ser de la forma:
# protocol XX from XX to XX source XX destination XX destination-port XX application XX
# protocol es obligatorio y puede ser 1 si es ICMP, 6 si es TCP, 17 si es UDP (ver /etc/protocols)
# destination-port es obligatorio
# application es opcional aunque conveniente si se sabe
# es conveniente indicar las zonas con from XX y to XX (es conveniente para evitar que se vaya por otra regla)
# El nombre del fichero se proporciona en el primer parámetro