Skip to content

Instantly share code, notes, and snippets.

View ashcrow's full-sized avatar
😎

Stephen Milner ashcrow

😎
View GitHub Profile
@ashcrow
ashcrow / fsclient.go
Created September 10, 2018 16:01
File System Client Example
package daemon
import (
"os"
)
// FileSystemClient abstracts file/directory manipulation operations
type FileSystemClient interface {
Create(string) (os.File, error)
Remove(string) error
@ashcrow
ashcrow / main.rs
Last active June 25, 2018 21:15
rhcos-shell-greeter idea but in rust
extern crate cursive;
use std::process::Command;
use cursive::Cursive;
use cursive::align::HAlign;
use cursive::views::{Dialog, TextView, LinearLayout, Button};
fn exec_shell_command(_s: &cursive::Cursive, shell_command: String) -> String {
@ashcrow
ashcrow / main.go
Created June 11, 2018 19:22
Quick-and-dirty-direct-to-golang-port of pivot
package main
/*
* WARNING!! This isn't tested. It's just a port of https://github.com/openshift/os/pull/95 to start with.
* Look for "TODO"s.
*/
import (
"flag"
"fmt"
%define debug_package %{nil}
Name: ignition
Version: 0.23.0
Release: 0.3%{?dist}
Summary: First boot installer and configuration tool
License: ASLv2
URL: https://github.com/coreos/ignition
Source0: https://github.com/coreos/%{name}/archive/v%{version}.tar.gz
@ashcrow
ashcrow / parse_tag.py
Created January 17, 2018 16:16
Quick and dirty parsing of tags
#!/usr/bin/env python
import json
import sys
def main():
for tag in json.loads(sys.stdin.read())['RepoTags']:
# Do your commands here
print(tag)
@ashcrow
ashcrow / example.go
Created November 7, 2017 16:55
Package level variable
// ...
const port = 8080
const path = "hash"
const key = "JAVA_SERVICE_HOST"
// hostName houses the package level hostname as a single instance
var hostName string
// SetHostname allows external packages to set the hostname
func SetHostname(name string) {
@ashcrow
ashcrow / failing_inventory.ini
Created October 20, 2017 20:04
Failing Inventory File
[OSEv3:children]
masters
nodes
[OSEv3:vars]
ansible_ssh_user=root
debug_level=3
openshift_deployment_type=origin
deployment_type=origin
openshift_release=v3.6
@ashcrow
ashcrow / findfiles.py
Created September 1, 2017 15:17
Example based on request.
import os
import re
class FindFiles:
"""
Finds files with explicit filtering.
"""
def __init__(self, include_dirs=None, exclude_dirs=None):
@ashcrow
ashcrow / current.json.txt
Last active June 9, 2017 18:43
victi.ms current and possible replacement format
// Current format from the v2 api. There is no file name as it comes in a stream
{
"date": "2013-03-24T15:42:09.966-04:00", // Date stamp; redundant
"createdon": "0001-01-01T00:00:00Z", // Date the record was created on
"name": "fake-1.0.jar", // File name of the package
"version": "1.0.0", // Version of the package
"coordinates": { // Related maven coordinates
"artifactId": "jar",
"groupId": "fake",
"version": "1.0.0"
@ashcrow
ashcrow / gas.py
Created May 31, 2017 20:35
Proposed updates to gas.py
#!/usr/bin/env python
from __future__ import print_function
import argparse
import logging
import os
import jinja2
import yaml