Skip to content

Instantly share code, notes, and snippets.

View KevOrr's full-sized avatar
💣
status' OR 1=1; --

Kevin Orr KevOrr

💣
status' OR 1=1; --
View GitHub Profile
@Luzifer
Luzifer / README.md
Last active November 18, 2023 17:22
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@1kastner
1kastner / reflect.py
Last active April 3, 2024 13:52 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@Darkhogg
Darkhogg / !RebootToOs.md
Last active April 22, 2024 09:20
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@bhtucker
bhtucker / close_commit_test.py
Last active February 24, 2022 20:00
Psycopg2 context manager demo: contextmanagers for closing and committing don't play well together without autocommit
import psycopg2
from contextlib import closing
"""
Demonstrate that contextmanagers for closing and committing don't play well together without autocommit
Only the noclosing function can run without error
"""
@borgfriend
borgfriend / maya2017install.sh
Last active April 13, 2024 13:34
Maya 2017 Installation on Ubuntu 16.04
#!/bin/bash
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!”
exit
fi
#Check for 64-bit arch
if [uname -m != x86_64]; then
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static const char slash[] = "/";
int main(__attribute__((unused)) int argc, char* argv[]) {
char *self;
@nirenjan
nirenjan / bishop.c
Created January 4, 2013 06:34
Simulate a drunken bishop walk to produce OpenSSL random art.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#define XLIM 17
#define YLIM 9
#define ARSZ (XLIM * YLIM)
#define DEBUG 0
@huyng
huyng / reflect.py
Created February 7, 2011 17:57
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):