Skip to content

Instantly share code, notes, and snippets.

Avatar

chunk activedecay

View GitHub Profile
View restart-virsh-networking.sh
#!/bin/bash
# Based on public domain work by Yury V. Zaytsev <yury@shurup.com>
# Deps: bash4+, xpath, egrep, virsh
set -e
set -u
MACHINES=$( virsh list --name | egrep "\S" )
NETWORK="default"
BRIDGE="bridge0"
View satisfactory.js
/* this script will slightly back up production, but that can be
easily solved by adding some storage containers between belts */
const source = parseInt(process.argv[2]);
const begin = { source, nodes: [] };
const splits = [2, 3];
const target = parseInt(process.argv[3]);
let gold = false;
function recurse(current = begin, depth = 1) {
@activedecay
activedecay / input.sh
Created Jan 14, 2019
input from users until ctrl-c
View input.sh
#!/usr/bin/env bash
while read -p "in >" line; do
echo line was ${line}
done
View bithacks.c
/** By_Sean_Eron_Anderson seander@cs.stanford.edu */
#include <stdbool.h>
#include <stdint.h>
#include <endian.h>
#define CHAR_BIT 8
void Compute_the_sign_of_an_integer() {
/*Compute the sign of an integer*/
@activedecay
activedecay / ansible-vvv.log
Created Jan 4, 2019
ansible npm module verbose run log
View ansible-vvv.log
sweet@beastmode:~/lab$ aplay -i 'hosty-host,' -e ansible_ssh_pass=vagrant -u vagrant npm-install.yml -vvv
ansible-playbook 2.7.2
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/sweet/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]
Using /etc/ansible/ansible.cfg as config file
Parsed hosty-host, inventory source with host_list plugin
@activedecay
activedecay / Makefile
Last active Jan 1, 2019
god-like makefile, thanks Beta
View Makefile
# c
# ├── Makefile
# ├── obj
# └── src
# ├── lib.c
# ├── lib.h
# └── server.c
EXE := doit
SRC := src
View flow-field.js
import {arrayOf} from "./util/array"
import p5 from 'p5' // vector fromAngle
import particle from './particle'
export default function (s) {
s.createSpan('cellScale')
const cellScaleSlider = s.createSlider(2, 100, 9, 1)
s.createSpan('particleCount')
const particleCountSlider = s.createSlider(2, 10000, 40, 1)
s.createSpan('frameRate')
View h2-LICENSE.txt
This software contains unmodified binary redistributions for
H2 database engine (http://www.h2database.com/),
which is dual licensed and available under the MPL 2.0
(Mozilla Public License) or under the EPL 1.0 (Eclipse Public License).
An original copy of the license agreement can be found at:
http://www.h2database.com/html/license.html
View license-bsd-2-clause.txt
BSD 2-Clause License
Copyright (c) [year], [fullname]
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
View eventcast1.0.2-LICENSE.txt
Copyright 2012 Tim Wood
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software