Skip to content

Instantly share code, notes, and snippets.

== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
import re
explicits = (
u'\u202a', # LEFT-TO-RIGHT EMBEDDING
u'\u202b', # RIGHT-TO-LEFT EMBEDDING
u'\u202d', # LEFT-TO-RIGHT OVERRIDE
u'\u202e', # RIGHT-TO-LEFT OVERRIDE
)
pdf = u'\u202c' # POP DIRECTIONAL FORMATTING
{
"id": "0123456789abcdef",
"name": "myname",
"provider": "puppet",
"os": {
"name": "linux",
"version": "2.6.35-22-generic",
"vendor": "ubuntu",
"vendor_version": "10.10"
},
{
"id": "0123456789abcdef",
"name": "myname",
"provider": "puppet",
"role": "some_identifier_from_cm_system_can_be_nil?",
"timestamp": 1290616560,
"provisioned": "true",
"os": {
"name": "linux",
"version": "2.6.35-22-generic",
@pnasrat
pnasrat / gist:3029009
Created July 1, 2012 17:19 — forked from anonymous/gist:3029007
beserk pip test
.................F
======================================================================
FAIL: Test installing from a local directory.
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Dev\pip\ve\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "C:\Dev\pip\tests\test_basic.py", line 287, in test_install_from_local_directory
result = run_pip('install', to_install, expect_error=False)
File "C:\Dev\pip\tests\test_pip.py", line 518, in run_pip
@pnasrat
pnasrat / latency.txt
Created September 6, 2012 22:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@pnasrat
pnasrat / shell_intro.md
Last active May 5, 2016 15:30 — forked from niftynei/shell_intro.md
intro to shell, a script

what is a shell?

Shell is a programming environment that terminal runs. it's a text based GUI for interacting with your system.

what is shell good for?

shell can give you information about your system, allows you to modify and run programs. let's try something

say "hello pris"

@pnasrat
pnasrat / expecting.md
Created June 9, 2016 15:54 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
@pnasrat
pnasrat / xhyve-freebsd-tutorial-1.md
Created June 23, 2016 16:06 — forked from tanb/xhyve-freebsd-tutorial-1.md
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites