Skip to content

Instantly share code, notes, and snippets.

View ytjohn's full-sized avatar

John Hogenmiller ytjohn

View GitHub Profile
@ytjohn
ytjohn / asyncplay.py
Created February 7, 2018 17:36
running asyncio within the loop itself
from apistar import Include, Route
from apistar.frameworks.asyncio import ASyncIOApp as App
from apistar.handlers import docs_urls, static_urls
import asyncio
import logging
import random
from time import time
logger = logging.getLogger('asyncioapp')
@ytjohn
ytjohn / kbsend.py
Created October 16, 2017 13:38
dirty keybase send client
#!/usr/bin/env python
import sys
import json
import subprocess
from subprocess import Popen, PIPE
# Improvement: make these configurable
team_name = "yourtech"
topic_name = "general"
@ytjohn
ytjohn / rebuild-raid
Created October 11, 2017 15:18
replacing raid 1 mdadm
# copy partition table and randomize GUUID
# https://askubuntu.com/a/57922/94764
# existing good drive = sdb
# replaced empty drive = sda
sgdisk /dev/sdb -R /dev/sda
sgdisk -G /dev/sda
cat /proc/mdstat
#######################
Personalities : [raid1]
@ytjohn
ytjohn / npmlist.txt
Created June 9, 2017 01:57
npm list
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
@ytjohn
ytjohn / inheritanceissues.py
Created March 21, 2017 15:47
the problem with inheritance and __dict__
class A:
def get(self):
"""geta"""
desc = 'geta'
print('got it')
def post(self):
"""posta"""
pass
@ytjohn
ytjohn / secure-erase-drive-graph.js
Created February 24, 2017 02:21
modified secure drive erase with delay option
// Copyright 2016, EMC, Inc.
'use strict';
module.exports = {
friendlyName: 'Secure Erase Drive',
injectableName: 'Graph.Drive.SecureErase',
options: {
'bootstrap-ubuntu': {
overlayfs: "common/secure.erase.overlay.cpio.gz",
@ytjohn
ytjohn / secure_erase.py
Created February 24, 2017 00:20
vs secure erase
#!/usr/bin/env python
# Copyright 2016, EMC, Inc.
# -*- coding: UTF-8 -*-
"""
This script is to do Secure Erase (SE) on a compute node
Four methods/tools are integrated in this scripts
A log file will be created for each disk to be erased named after disk name, like sdx.log
@ytjohn
ytjohn / Graph.VS.Enhanced.Drive.SecureErase.json
Created February 23, 2017 23:58
vs enhanced secure erase
{
"friendlyName": "VS Secure Erase Drive",
"injectableName": "Graph.VS.Enhanced.Drive.SecureErase",
"options": {
"bootstrap-secure-erase": {
"overlayfs": "common/secure.erase.overlay.cpio.gz"
},
"bootstrap-ubuntu": {
"overlayfs": "common/rubicon.overlay.cpio.gz"
},
@ytjohn
ytjohn / notes.md
Created November 16, 2016 20:31
quick notes on doing a kvm image from ubuntu cloud image
@ytjohn
ytjohn / tm.bash
Last active February 23, 2017 18:45
tmux conf
# ~/bin/tm shell script
# The Project name is also used as a session name (usually shorter)
PROJECT_NAME=$1
if [ -z $PROJECT_NAME ]
then
tmux list-sessions
exit
fi