Skip to content

Instantly share code, notes, and snippets.

Avatar

Morten Johansen SteveCooling

View GitHub Profile
@SteveCooling
SteveCooling / jbod.md
Created Jan 27, 2021
MegaCli enable JBOD
View jbod.md

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 Apr 3, 2018
Simple text utility to track one or more shipments using Bring API (bring.com)
View track.py
#!/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 Jan 16, 2018
Arduino SBUS receiver (RC Joystick and Mouse)
View RC_SBUS.ino
#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 Dec 10, 2017
MMDVM firmware updater
View mmdvm-flash.sh
#!/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!
#
View REST_MQ_Controller.php
<?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
@SteveCooling
SteveCooling / v1.php
Last active Aug 29, 2015
ZeroMQ progress
View v1.php
<?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 Aug 29, 2015
Simple tool to automate running commands in parallell using tmux. Acts like clusterssh when invoked like this:"tmulti.sh ssh host1 host2 ..."
View tmulti.sh
#!/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})
View logstash_purge_old_indexes.php
#!/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/';
View gluhealbrick.sh
#!/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