Skip to content

Instantly share code, notes, and snippets.

View stongo's full-sized avatar

Marcus Stong stongo

View GitHub Profile
@stongo
stongo / io-bench.sh
Last active May 29, 2020 04:36
Disk Benchmarking
#!/bin/bash
echo "-- psync ioengine write test"
fio --name=global --randrepeat=0 --iodepth=16 --name=job2 --size=32g --nrfiles=1 --rw=write
echo "-- libaio ioengine write test"
fio --name=global --randrepeat=0 --iodepth=16 --name=job2 --size=32g --nrfiles=1 --rw=write --ioengine=libaio
echo "-- io_uring ioengine write test"
fio --name=global --randrepeat=0 --iodepth=16 --name=job2 --size=32g --nrfiles=1 --rw=write --ioengine=io_uring
@stongo
stongo / step 1
Last active July 3, 2018 20:14
start minikube using hyperkit and setup rbac properly
# install hyperkit
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
&& chmod +x docker-machine-driver-hyperkit \
&& sudo mv docker-machine-driver-hyperkit /usr/local/bin/ \
&& sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit \
&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

test_skip: &test_skip
name: test skip check
command: |
if git log -1 | grep '\[test skip\]'; then
echo "skipping tests"
exit 1
fi
version: 2
jobs:
module.kubernetes.data.template_file.cloud_config.1: Refreshing state...
module.kubernetes.null_resource.discovery_token: Creating...
module.kubernetes.null_resource.discovery_token: Provisioning with 'local-exec'...
module.kubernetes.null_resource.discovery_token (local-exec): Executing: /bin/sh -c "curl https://discovery.etcd.io/new?size=3 > /Users/stongo/circleci/terraswarm/.terraform/modules/9e3676da33c9ea68de259fbfa671dab3/.token"
module.kubernetes.null_resource.discovery_token (local-exec): % Total % Received % Xferd Average Speed Time Time Time Current
module.kubernetes.null_resource.discovery_token (local-exec): Dload Upload Total Spent Left Speed
module.kubernetes.null_resource.discovery_token (local-exec): 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
module.kubernetes.null_resource.discovery_token (local-exec): 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
module.kubernetes.nu
@stongo
stongo / nsqd.service
Last active August 29, 2015 14:13
NSQD and NSQLOOKUPD
[Unit]
Description=Nsqd
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill nsqd
ExecStartPre=-/usr/bin/docker rm nsqd
ExecStartPre=/usr/bin/docker pull redis
@stongo
stongo / appointment.js
Last active December 24, 2015 02:29
Implementation example of mudskipper plugin for HAPI framework
module.exports = function(Hapi) {
return {
/**
* @operation: GET
* @path: '/appointment'
*/
index: {
handler: function (request) {
}
}
@stongo
stongo / gist:6424311
Created September 3, 2013 13:58
homework solution for M101JS
var MongoClient = require('mongodb').MongoClient;
MongoClient.connect('mongodb://localhost:27017/school', function(err, db) {
if(err) throw err;
var _update = function(student) {
db.collection('students').update({_id: student._id}, student, function(err, saved) {
if (err) throw error;
console.log('Successfully updated student');
@stongo
stongo / app.js
Last active January 23, 2024 18:48
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@stongo
stongo / Client.js
Last active December 15, 2015 09:19
sample titanium xhr constructor object
function Httpclient(url, method, entity, data) {
var url = url
, method = method || 'GET'
, entity = entity || 'entity'
, data = data || null;
this.contentType = "application/json; charset=utf-8";
this.onload = function(e) {
Ti.API.log('Httpclient log for ' + entity + '. Response: ' + this.responseText + 'Status: ' + this.status);
}