Skip to content

Instantly share code, notes, and snippets.

View ROBERT-MCDOWELL's full-sized avatar

ROBERT MCDOWELL ROBERT-MCDOWELL

View GitHub Profile
@vandot
vandot / geoipbind.py
Created March 16, 2016 00:52
Fetch geoip data and create Bind9 ACL based on continents for poor man's GSLB service
#!/usr/bin/env python
import csv
import urllib
import zipfile
import os
link = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip'
csv1 = 'GeoLite2-Country-Blocks-IPv4.csv'
csv2 = 'GeoLite2-Country-Locations-en.csv'
@yurydelendik
yurydelendik / !wasmllvm.md
Last active December 7, 2024 18:08
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@scottsb
scottsb / resetting-csync2-cluster.md
Last active October 25, 2021 20:28
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

How I switched from mdadm to btrfs

After reading [this Ars Technica article][1], I decided that I wanted to start using btrfs on my home fileserver. It had been running for a few years with an mdadm raid-10 array, formatted with ext4, holding about 3.4 TB of data. I figured I would take advantage of some of the special capabilities of btrfs to perform the conversion in place. After some research, I formed my basic plan.

  • backup data to external drives
  • remove two of the drives from the mdadm raid-10
  • configure those two drive with a btrfs raid-0 filesystem
  • copy the data from the degraded mdadm raid-10 to the new btrfs raid-0
  • completely deactivate the mdadm raid-10
@carols10cents
carols10cents / javascript-to-rust-cheat-sheet.md
Last active October 28, 2023 07:57
JavaScript to Rust Cheat Sheet

JavaScript to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in JavaScript and Rust so that programmers most comfortable with JavaScript can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

JavaScript:

@alumican
alumican / Timer.as
Created September 3, 2014 09:21
AS3 Timer based on getTimer
package util
{
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.TimerEvent;
import flash.utils.getTimer;
/**
* This is the timer class based on getTimer().
@ashrithr
ashrithr / kerberos_setup.md
Last active April 7, 2025 10:13
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@Teaonly
Teaonly / yuv_canvas
Created May 16, 2014 03:31
Draw YUV in a HTML5's Canvas
function yuv2canvas(yuv, width, height, canvas) {
/*
canvas.width = width;
canvas.height = height;
*/
context = canvas.getContext("2d");
output = context.createImageData(width, height);
outputData = output.data;
yOffset = 0;
@thomasfr
thomasfr / autossh.service
Last active June 19, 2025 05:38
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@Sitwon
Sitwon / wget.sh
Created January 3, 2014 19:22
A very basic replacement for wget in pure Bash.
#!/bin/bash
wget() {
local PROTO=${1%%://*}
local NOPROTO=${1#*://}
local HOST=${NOPROTO%%/*}
local PORT=${HOST#*:}
[ "${HOST}" = "${PORT}" ] && PORT=80
HOST=${HOST%:*}
local URI=${NOPROTO#*/}