Skip to content

Instantly share code, notes, and snippets.

Mikal mikalv

Block or report user

Report or block mikalv

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
mikalv / .pryrc
Created Aug 21, 2019 — forked from am-kantox/.pryrc
View .pryrc
# === EDITOR ===
Pry.editor = 'vi'
# === PROMPT ===
Pry.prompt = [ ->(obj, nest_level, _) { "" }, ->(obj, nest_level, _) { "#{' ' * nest_level} " } ]
# === COLORS ===
unless ENV['PRY_BW']
Pry.color = true
Pry.config.theme = "railscasts"
mikalv / dispqlen.d
Created Aug 21, 2019 — forked from trptcolin/dispqlen.d
OSX DTrace scripts that didn't work as shipped (run queue related)
View dispqlen.d
#!/usr/sbin/dtrace -s
* dispqlen.d - dispatcher queue length by CPU.
* Written using DTrace (Solaris 10 3/05).
* 14-Feb-2006, ver 0.90
* USAGE: dispqlen.d # hit Ctrl-C to end sample
* NOTES: The dispatcher queue length is an indication of CPU saturation.
mikalv / runq.d
Last active Aug 21, 2019 — forked from trptcolin/runq.d
A DTrace script to print the average, min, and max run queue count by CPU
View runq.d
#!/usr/sbin/dtrace -s
* runq.d - run queue sizes by CPU.
* This prints the average, min, and max run queue count by CPU each second. A
* consistently large run queue count is a sign of CPU saturation.
* USAGE: runq.d
mikalv /
Last active Aug 18, 2019 — forked from jclulow/
oddball ps behaviour

So, ps is running somewhat slowly...

asgard # time ps -ef | wc -l

real    0m10.195s
user    0m0.023s
sys     0m9.779s
mikalv /
Created Aug 18, 2019 — forked from liweitianux/
DragonFly BSD Manual Installation with HAMMER2 and Encrypted Root

DragonFly BSD Installation


Disk Partition

MBR Slice

root# dd if=/dev/zero of=/dev/vbd0 bs=32k count=16
root# fdisk -IB /dev/vbd0
mikalv /
Created Aug 18, 2019 — forked from shmup/
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

mikalv /
Created Aug 17, 2019 — forked from tdudziak/
A proof-of-concept function that extract import statements from Python bytecode
import dis
import inspect
def extract_imports(code):
"""Returns list of pairs (module_name, from_list) representing imports
from a given code object."""
i = 0
n = len(code.co_code)
mikalv /
Created Aug 13, 2019 — forked from aculich/
SSHForwarder class for use with the python ssh module:
#!/usr/bin/env python
# This code is licensed according to the main package that it depends on:
# License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
import sys, os, os.path
import select
import SocketServer
mikalv /
Created Aug 13, 2019 — forked from hsun/
Generates dot file for python dependencies in a package
#!/usr/bin/env python
import _ast, ast
import argparse
import colorsys
import logging
import md5
import os.path
import sys
# Trick process(es) to talk to current terminal
# Copyright (c) 2004, 2005 Timo Lindfors <>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
You can’t perform that action at this time.