Skip to content

Instantly share code, notes, and snippets.

View gbraad's full-sized avatar
🇳🇱
Working from home

Gerard Braad gbraad

🇳🇱
Working from home
View GitHub Profile
@dmsimard
dmsimard / weirdo-localhost.sh
Last active August 30, 2017 08:00
WeIRDO on localhost
#!/bin/bash
DELOREAN_URL="https://trunk.rdoproject.org/centos7-master/consistent/delorean.repo"
# How to run WeIRDO on localhost from a fresh CentOS installation
yum -y install git python-setuptools python-devel libffi-devel openssl-devel "@Development Tools"
easy_install pip
pip install tox
git clone https://github.com/rdo-infra/weirdo.git
cd weirdo
cat <<EOF >hosts
@vlucas
vlucas / markdown-import.php
Last active May 19, 2024 17:58
Imports Markdown files in a local directory into a WordPress installation
<?php
// Turn on all error reporting so we can see if anything goes wrong
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
// Relative path to your wp-config.php file (to connect to the database)
require '../wp-config.php';
require './frontmatter.php'; // Parses YAML frontmatter - https://github.com/Modularr/YAML-FrontMatter
require './Parsedown.php'; // Markdown parser - https://github.com/erusev/parsedown
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
#!/usr/bin/env python3
"""
Python3 script to manage an external Lenovo LT1423p monitor
Requirements: xrandr, wmctrl, displaylink service
"""
LAPTOP_WACOM_DEVICES=[
"Wacom Serial Penabled 1FG Touchscreen stylus",
"Wacom Serial Penabled 1FG Touchscreen eraser"
]
@jkudish
jkudish / displaylink-installer-.sh
Created August 13, 2015 04:56
displaylink-installer.sh modified for Fedora 22
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@dustymabe
dustymabe / TestProjectAtomic.rst
Created November 17, 2014 04:39
Testing Project Atomic

Test steps for atomic

Below are some steps to roughly test an atomic host from Project Atomic.

Booting with cloud-init

First step is to start an atomic host using any method/cloud provider

@kostix
kostix / impersonate.go
Created September 30, 2014 16:46
A demonstration example for http://stackoverflow.com/a/26124494
// A demonstration example for http://stackoverflow.com/a/26124494
// It runs a goroutine locked to an OS thread on Windows
// then impersonates that thread as another user using its name
// and plaintext password, then reverts to the default security
// context before detaching from its OS thread.
package main
import (
"log"
"runtime"