Skip to content

Instantly share code, notes, and snippets.

@nochristrequired
nochristrequired / kubeception.md
Created January 29, 2023 06:01 — forked from dghubble/kubeception.md
Running QEMU/KVM and Nested Kubernetes on Bare-Metal Kubernetes
@nochristrequired
nochristrequired / test-maas-enlistment.sh
Created February 2, 2022 08:47 — forked from mpontillo/test-maas-enlistment.sh
Script to fetch the default TFTP configuration from MAAS and fetch the cloud-config URL.
#!/bin/bash -e
TMPDIR="$(mktemp -d)"
function cleanup() {
rm -rf "$TMPDIR"
}
trap cleanup EXIT
@nochristrequired
nochristrequired / BruteZIP.py
Created September 27, 2021 14:13 — forked from limitedeternity/BruteZIP.py
Zip file bruteforce utility
import argparse
import os
import shutil
import tempfile
from zipfile import ZipInfo, ZipFile
parser = argparse.ArgumentParser(description="Unzips a password protected .zip by performing a brute-force attack "
"using either a word list, password list or a dictionary.",
usage="BruteZIP.py -z zip.zip -d dict.txt")
parser.add_argument("-z", "--zip", metavar="", required=True, help="Path to the .zip file.")
@nochristrequired
nochristrequired / rpi4_eufi_booting_flatcar.md
Created July 6, 2021 04:43 — forked from shift/rpi4_eufi_booting_flatcar.md
UEFI/iPXE booting Raspberry Pi for Flatcar Linux

UEFI/iPXE booting Raspberry Pi for Flatcar Linux

Download and compile the following https://github.com/pftf/RPi4.git. I made the following change to edk2-platforms to always enable 3GB RAM+ as TFTP booting this seems to cause issues with it remembering the options.

diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc
index c481c35342..4b495b1fe8 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -495,7 +495,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
public interface IRtdClient
{
object GetValue(params object[] args);
}
public class RtdClient : IRtdClient
{
readonly string _rtdProgId;
static IRtdServer _rtdServer;

aiopg playing with aiohttp and gunicorn

Setup

virtualenv -p /usr/bin/python3.5 env && source env/bin/activate
pip install SQLAlchemy aiohttp aiopg gunicorn

Usage

@nochristrequired
nochristrequired / sqlalchemy_example.py
Created November 2, 2016 16:22 — forked from podhmo/sqlalchemy_example.py
sqlalchemy query example.
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
@nochristrequired
nochristrequired / iso countries list (csv)
Created October 23, 2016 01:26 — forked from eparreno/iso countries list (csv)
iso countries list (csv)
"name","iso_name","iso2","iso3","numcode"
"Antigua and Barbuda","ANTIGUA AND BARBUDA","AG","ATG",28
"Bosnia and Herzegovina","BOSNIA AND HERZEGOVINA","BA","BIH",70
"Cocos (Keeling) Islands","COCOS (KEELING) ISLANDS","CC","\N","\N"
"Congo, the Democratic Republic of the","CONGO, THE DEMOCRATIC REPUBLIC OF THE","CD","COD",180
"Cote D'Ivoire","COTE D'IVOIRE","CI","CIV",384
"Fiji","FIJI","FJ","FJI",242
"French Southern Territories","FRENCH SOUTHERN TERRITORIES","TF","\N","\N"
"Heard Island and Mcdonald Islands","HEARD ISLAND AND MCDONALD ISLANDS","HM","\N","\N"
"Holy See (Vatican City State)","HOLY SEE (VATICAN CITY STATE)","VA","VAT",336
@nochristrequired
nochristrequired / consul.service
Created December 24, 2015 06:16 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d