Skip to content

Instantly share code, notes, and snippets.

View nocko's full-sized avatar

Shawn Nock nocko

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nocko on github.
  • I am nocko (https://keybase.io/nocko) on keybase.
  • I have a public key whose fingerprint is D205 AB9F 81B7 B1C7 E493 ADE8 6FDA 11EE 3BC4 12E3

To claim this, I am signing this object:

@nocko
nocko / adam-multiprocessing-2
Created June 30, 2011 20:35
Second multiprocessing example with Adam's parameters
#!python
from multiprocessing.managers import BaseManager
from multiprocessing import Pool
import subprocess
import time
def dowork(work):
with open('/tmp/proof-of-life', 'a') as output:
retcode = subprocess.call(['/usr/bin/php','/usr/local/neato/process.php', work])
@nocko
nocko / adam-mutliprocessing-1
Created June 30, 2011 20:32
Basic Multiprocessing example for Adam
#!python
#from multiprocessing.managers import BaseManager
from multiprocessing import Pool
import subprocess
import time
def dowork(work):
with open('/tmp/proof-of-life', 'a') as output:
retcode = subprocess.call(['echo -n '+work], shell=True)
@nocko
nocko / fio-output-sample
Created February 12, 2013 20:53
Sample output from fio
cfmi-dicom-reader1: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-dicom-reader2: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-dicom-reader3: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-dicom-reader4: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-dicom-reader5: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-dicom-writer: (g=0): rw=write, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
cfmi-vm: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=2
fio-2.0.13
Starting 7 processes
@nocko
nocko / gist:5006065
Created February 21, 2013 16:41
"Invalid argument" resolving linked (DHT) files in glusterfs 3.3
ogawa @ raid-mirror2.log:
[2013-02-21 10:19:42.039810] I [server3_1-fops.c:576:server_mknod_cbk] 0-mirror-server: 1335133: MKNOD /cfmi/raw/dicom/data/cfmi/MR/2011/01/17/1.3.12.2.1107.5.2.32.35052.30000011010515562426500000043.STU/1.3.12.2.1107.5.2.32.35052.2011011710511297090369232.0.0.0.SER/153.ACQ/1.3.12.2.1107.5.2.32.35052.2011011711025969557302899.IMA (00000000-0000-0000-0000-000000000000) ==> -1 (Permission denied)
ogawa @ raid-mirror2-xattrs:
[root@ogawa 153.ACQ]# getfattr -dRm - .
# file: .
security.selinux="system_u:object_r:file_t:s0"
trusted.afr.mirror-client-4=0sAAAAAAAAAAAAAAAA
trusted.afr.mirror-client-5=0sAAAAAAAAAAAAAAAA
trusted.gfid=0su1BxnT+cQjuS7yANTSJbvw==
@nocko
nocko / mirror-fuse.vol
Created February 21, 2013 16:44
volume file for cfmi mirror (glusterfs)
volume mirror-client-0
type protocol/client
option remote-host lauterbur
option remote-subvolume /raid/mirror
option transport-type tcp
end-volume
volume mirror-client-1
type protocol/client
option remote-host mansfield
@nocko
nocko / 0003-binutils-texinfo-5.0.patch
Last active December 27, 2015 21:18
PKGBUILD and patch for for binutils-msp430 . binutils 2.23.2 supports msp430 as a target without the msp430-gcc patchset . An updated 0003 patch is needed as well.
From b6c5b847cf983ccddff460f997f8338f2022bd78 Mon Sep 17 00:00:00 2001
From: Shawn Nock <nock@nocko.se>
Date: Sat, 9 Nov 2013 11:52:51 -0500
Subject: [PATCH] binutils-texinfo-5.0
---
bfd/doc/bfd.texinfo | 4 ++--
binutils/doc/binutils.texi | 12 ++++++------
ld/ld.texinfo | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
@nocko
nocko / nrf51.xml
Created June 30, 2016 13:03
ADA.STRINGS.INDEX_ERROR
<?xml version="1.0" encoding="utf-8"?>
<!-- File naming: <vendor>_<part/series name>_svd.xml -->
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD_Schema_1_0.xsd" >
<vendor>Nordic Semiconductor</vendor> <!-- Name for Doxygroup -->
<vendorID>Nordic</vendorID> <!-- Vendor ID -->
<name>nrf51</name> <!-- Official name of part or part series -->
<series>nrf51</series>
<version>522</version> <!-- Version of this description. It is the run of the automatic generation of SUS. -->
@nocko
nocko / hello.adb
Last active June 30, 2016 17:56
Ada Vowel/Consonant Counting
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Hello is
Letter : Character;
Input : Unbounded_String;
Vowels : constant String := "aAeEiIoOuUyY";
Match : Boolean := False;
Vowels_Count : Natural := 0;
@nocko
nocko / cipher2.adb
Last active July 1, 2016 18:03
Ada substitution cipher, take 2
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Sequential_IO;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Text_IO;
procedure Cipher is
package Char_IO is new Ada.Sequential_IO (Character);
use Char_IO;
Alphabet: constant String := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
Key : constant String := "VsciBjedgrzyHalvXZKtUPumGfIwJxqOCFRApnDhQWobLkESYMTN";