Skip to content

Instantly share code, notes, and snippets.

use std::io::prelude::*;
use std::net::TcpStream;
use crossbeam_channel::{unbounded, Receiver, Sender};
use crossbeam_utils::thread;
use rand::prelude::*;
use std::time::Duration;
pub type Msg = Box<u8>;
Traceback (most recent call last):
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 376, in test_low
"name": "vi"}), list)
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 448, in low
st_ = salt.state.State(__opts__, proxy=__proxy__)
File "/Users/jasperla/hack/salt/salt/salt/state.py", line 727, in __init__
self.opts['pillar'] = self._gather_pillar()
File "/Users/jasperla/hack/salt/salt/salt/state.py", line 784, in _gather_pillar
self.opts['id'],
KeyError: 'id'

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#define db_print_sym_name(name, pr, tail) \
{ \
const char *tl; \
if (tail == NULL) { tl = "("; } else { tl = tail; }\
if (name == NULL) { ((*pr)("%p%s", name, tl)); } \
else { ((*pr)("%s%s", name, tl)); } \
}
/* $OpenBSD$ */
/*
* Copyright (c) 2017 Jasper Lievisse Adriaanse <[email protected]>
* Copyright (c) 2017 Aaron Bieber <[email protected]>
* Copyright (C) 2015 Sean Levy <[email protected]>
* Copyright (c) 2007 Marc Balmer <[email protected]>
* Copyright (c) 2006 Alexander Yurchenko <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
@jasperla
jasperla / gist:3de28386512225f0cd0787f0c8ac2338
Created August 9, 2017 19:35
missing have_cpuinfo check
grep: /proc/cpuinfo: No such file or directory
Index: virt-what.in
--- virt-what.in.orig
+++ virt-what.in
@@ -308,7 +308,7 @@ if ! "$skip_qemu_kvm"; then
# option, since /proc/cpuinfo will not contain the QEMU
# string. QEMU 2.10 added a new CPUID leaf, so this
# problem only triggered for older QEMU
- if grep -q 'QEMU' "${root}/proc/cpuinfo"; then
@jasperla
jasperla / smartos-bootstrap.yml
Created July 9, 2017 20:55
Bootstrapping Ansible on SmartOS headnode
---
# Playbook to bootstrap a SmartOS headnode for use with Ansible
- name: bootstrap a SmartOS headnode
hosts: smartos-headnode
gather_facts: no
vars:
pkgsrc_rel: 2017Q1
bootstrap_tar: bootstrap-{{ pkgsrc_rel }}-tools.tar.gz
bootstrap_sha1: a39d8dce904c2d0afb3cb570c671490153a71f15
ansible_ssh_pubkey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCXRiC3PzMKMCI7X1s2l6amMfN0avqlyRasd1VU0pLiROwu6fyyA1HAkngnu68dXfReAx2/CVYOxXDAQUOyXAgR4wDPOd1NT7NQWFawr0xN8RdgD0l8BQRbJfz61KvBUyFC7brsg5liIbAsqDwB35s3Nchq8yEJj6cv7CPngP/5JMS6wUUT6CFtWimqsxRVGuUNWRlhGeU+CO62EoQXutndhbjbQKGXieKjO3ZLSKsXkDfrfwSwyoc/6HMZP4EJqKWVYufzq3zAxGargDm0a7RRincC1McvbwH/YEx9CDekCzoW1aaATJlvqooX4HzdqwjSduUQD/2rfHpL8576jYZsZWOAseJgDJAN5LvFiVTdFtC8el9BdT7J5EpKb8t7zlMRJ12qso5IJCabzcqTtpPhzu/JdP5wLDPyExAZI94vO8q0CLbMvkMYiS7hpgVHshmxsTiyOzT+nxmoJwqnCIUAq8sQgM8o/Nou0lzX55zVRx3icTlhdNCLQx/62pcbvm2pVjPDGd/yf0g1fdAxH7QIth6qmerFdiXmER0VkJ0V9nDQNbPbkzLp713TXaYI2grLbs9D+SHTXOSWD3H16V4KitYdGyBS17IwRGKxdSDDlX4lQiUNZhsEoEycqfKc3KXHTdZcXwK+gwkB+jl8L
package main
import (
"io/ioutil"
"os"
"syscall"
"github.com/davecgh/go-spew/spew"
)
basalt:2064 ~ % make swap && ./swap
se_dev: 1025
se_flags: 3
se_nblks: 16771871
se_inuse: 0
se_priority: 0
basalt:2065 ~ % go run swap.go
nswap: 1
8531335222149513216
([]main.Swapent) (len=1 cap=1) {
package main
/*
#include <sys/types.h>
#include <sys/swap.h>
#include <unistd.h>
*/
import "C"
import (