Skip to content

Instantly share code, notes, and snippets.

View SteveCooling's full-sized avatar

Morten Johansen SteveCooling

View GitHub Profile
@SteveCooling
SteveCooling / jbod.md
Created January 27, 2021 21:06
MegaCli enable JBOD

Enable JBOD on the controller

/opt/MegaRAID/MegaCli/MegaCli64 -AdpSetProp -EnableJBOD 1 -a0

Put drives in "UnconfiguredGood" state

/opt/MegaRAID/MegaCli/MegaCli64 -pdmakegood -physdrv [252:0,252:1,252:2,252:3,252:4,252:5] -force –a0

Make drives JBOD

@SteveCooling
SteveCooling / track.py
Created April 3, 2018 08:50
Simple text utility to track one or more shipments using Bring API (bring.com)
#!/usr/bin/env python3
#
# Simple text utility to track one or more shipments using Bring API (bring.com).
# Morten Johansen <morten@bzzt.no>
import sys
import requests
items = sys.argv
program = items.pop(0) # remove the program name
@SteveCooling
SteveCooling / RC_SBUS.ino
Created January 16, 2018 12:30
Arduino SBUS receiver (RC Joystick and Mouse)
#include <Joystick.h>
#include <Mouse.h>
#include <FUTABA_SBUS.h>
// Uses FUTABA_SBUS library from:
// https://github.com/mikeshub/FUTABA_SBUS/
Joystick_ Joystick;
FUTABA_SBUS sBus;
@SteveCooling
SteveCooling / mmdvm-flash.sh
Last active December 10, 2017 21:24
MMDVM firmware updater
#!/bin/bash
#
# Quick and dirty script to update firmware on DVMega hotspots without detaching from Raspberry Pi
#
# Will only work if you do G0WFV mod on the DVMega. See this link:
# https://g0wfv.wordpress.com/how-to-update-dvmega-firmware-without-a-programmer-or-an-arduino/
#
# Main install procedures in this script are from the G0WFV webpage.
# Use this script only at your own risk!
#
@SteveCooling
SteveCooling / REST_MQ_Controller.php
Created January 9, 2015 21:30
Extension of https://github.com/chriskacerguis/codeigniter-restserver to provide easy access to ZeroMQ message queues
<?php defined('BASEPATH') or exit('No direct script access allowed');
require(APPPATH.'libraries/REST_Controller.php');
/**
* CodeIgniter Rest MQ Controller
*
* Extends REST_Controller to provide easy access to 0MQ.
*
* @package CodeIgniter
#!/bin/bash
#
# Quick and dirty script for resolving split-brained files on GlusterFS bricks.
# Use only at your own risk!
#
HOST=$1
BRICK=$2
MOUNT=$3
VOLUME=$4
@SteveCooling
SteveCooling / v1.php
Last active August 29, 2015 14:13
ZeroMQ progress
<?php
require(APPPATH.'libraries/REST_Controller.php');
class V1 extends REST_Controller {
var $zmq_queue_type = ZMQ::SOCKET_PUSH;
var $zmq_queue_addr = 'tcp://127.0.0.1:31336';
var $zmq_context;
@SteveCooling
SteveCooling / tmulti.sh
Last active August 29, 2015 13:57
Simple tool to automate running commands in parallell using tmux. Acts like clusterssh when invoked like this:"tmulti.sh ssh host1 host2 ..."
#!/bin/bash
#
# Author: Morten Johansen <morten@cerum.no>
# License: CC BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/
# Usage: tmulti <cmd> <arg1> ...
# Will create one pane in tmux for each arg, and execute "<cmd> <argN>" in each pane, in parallel
# Example: tmulti ssh user@node{1..4}.example.com
#
BNAME=$(basename ${0})
#!/usr/bin/php
<?php
#
# Quick and dirty script to purge old logstash indexes. The scripts tries hard to avoid deleting indexes that has other origins than logstash.
# Use at own risk.
#
$BASEURL = 'http://localhost:9200/';