This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script | |
# ~/.ssl/sign-all-modules.sh | |
# Place all files in ~/.ssl folder | |
mkdir ~/.ssl | |
cd ~/.ssl | |
# Generate custom keys with openssl | |
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
if [ -z $1 ]; then | |
echo "Usage: ./make-rpi.sh <hostname>" | |
echo " ./make-rpi.sh node-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2017 The Kubernetes Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#----------------------------------------------------------------------------------------# | |
# Hex over TCP with Echo and Netcat # | |
#----------------------------------------------------------------------------------------# | |
echo -n -e "x01x18x03" | nc 192.168.1.4 80 | |
# The -n supresses outputting the trailing newline. | |
# The -e enables the interpretation of backslash escapes -- allowing us to send hex codes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() { | |
echo "Usage $0 -c mongo_docker_container_name" | |
} | |
while [[ $# > 1 ]] | |
do | |
key="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = ElasticWrapper::Session.new.client | |
client.search(index: 'test', type: 'contacts', body: body) | |
body = { query: { bool: { filter: { term: { name: 'lachlan' } } } } } | |
=> | |
[{ | |
"_index"=>"test", | |
"_type"=>"contact", | |
"_id"=>"1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Deck xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<NetDeckID>0</NetDeckID> | |
<PreconstructedDeckID>0</PreconstructedDeckID> | |
<Cards CatID="44245" Quantity="2" Sideboard="false" Name="Cavern of Souls" /> | |
<Cards CatID="60050" Quantity="2" Sideboard="false" Name="Forest" /> | |
<Cards CatID="26015" Quantity="1" Sideboard="false" Name="Pendelhaven" /> | |
<Cards CatID="38299" Quantity="2" Sideboard="false" Name="Razorverge Thicket" /> | |
<Cards CatID="50274" Quantity="2" Sideboard="false" Name="Nykthos, Shrine to Nyx" /> | |
<Cards CatID="60052" Quantity="4" Sideboard="false" Name="Forest" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Traverses an arbitrary struct and translates all stings it encounters | |
// | |
// I haven't seen an example for reflection traversing an arbitrary struct, so | |
// I want to share this with you. If you encounter any bugs or want to see | |
// another example please comment. | |
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2014 Heye Vöcking | |
// |
NewerOlder