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 ( | |
"log" | |
"syscall" | |
"unsafe" | |
"golang.org/x/sys/windows" | |
) |
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
#!/usr/bin/env bash | |
# unifi_ssl_import.sh | |
# UniFi Controller SSL Certificate Import Script for Unix/Linux Systems | |
# by Steve Jenkins <http://www.stevejenkins.com/> | |
# Incorporates ideas from https://source.sosdg.org/brielle/lets-encrypt-scripts | |
# Version 2.2 | |
# Last Updated June 26, 2016 |
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 | |
# | |
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service | |
# | |
# Please report issues and/or improvements to Sam Hocevar <[email protected]> | |
# | |
# Prerequisites: | |
# — MSYS2 itself: http://sourceforge.net/projects/msys2/ | |
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights | |
# |
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
#!/usr/bin/env python | |
from twisted.web import server, resource | |
from twisted.internet import reactor, defer | |
from pprint import pprint | |
import base64 | |
class DummyServer(resource.Resource): | |
isLeaf = True |
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
augeas{ '/etc/fstab - nosuid on /sys': | |
context => "/files/etc/fstab", | |
changes => [ | |
"ins opt after /files/etc/fstab/*[file = '/sys']/opt[last()]", | |
"set *[file = '/sys']/opt[last()] nosuid", | |
], | |
onlyif => "match *[file = '/sys']/opt[. = 'nosuid'] size == 0", | |
} | |
augeas{ '/etc/fstab - acl on /sys': |
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 | |
VERSION=$(ls -t1 /boot/vmlinuz-* | cut -f 1 -d '-' --complement | head -1) | |
BOOT=/boot | |
KEXEC=/sbin/kexec | |
KERNEL=$BOOT/vmlinuz-$VERSION | |
INITRD=$BOOT/initramfs-$VERSION.img |
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
# compile iptables from source and install to /usr/local | |
mkdir -p /tmp/iptables | |
wget "http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2" -qO- | tar --strip-components=1 -C /tmp/iptables -xvj | |
cd /tmp/iptables | |
./configure | |
make | |
make install | |
# set alternatives | |
sudo alternatives --install /sbin/iptables iptables.x86_64 /usr/local/sbin/iptables 100 \ |
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
<?php | |
class RobustPDO extends PDO | |
{ | |
/** Call setAttribute to set the session wait_timeout value */ | |
const ATTR_MYSQL_TIMEOUT = 100; | |
/** @var array */ | |
protected $config = []; | |
/** @var bool For lazy connection tracking */ |
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
#include <iostream> | |
#ifdef __linux__ | |
#include <SDL2/SDL.h> | |
#elif defined(_WIN32) | |
#include <SDL.h> | |
#endif | |
const int WIN_WIDTH = 640; | |
const int WIN_HEIGHT = 480; |