Skip to content

Instantly share code, notes, and snippets.

bparker06 / spectre.c
Created May 6, 2020 — forked from ErikAugust/spectre.c
Spectre example code
View spectre.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#include <x86intrin.h> /* for rdtscp and clflush */
bparker06 /
Created Apr 17, 2020 — forked from level323/
Run a command inside a customised networking environment (using cgroups)
# === INFO ===
# Description: Run the specified application in a custom networking environment.
# Uses cgroups to run process(es) in a network environment of your own choosing (within limits!)
# Author: John Clark
# Requirements: Debian 8 Jessie (plus iptables 1.6 from unstable)
bparker06 /
Created Feb 10, 2020 — forked from joepie91/
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

A Russian translation of this article can be found here, contributed by Timur Demin. There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Why not?

bparker06 /
Created Jan 30, 2020 — forked from ramast/
Record a program's output with PulseAudio
#!/usr/bin/env python3
import re
import subprocess
import sys
import os
import signal
from time import sleep
INDEX_RE = re.compile(r'[0-9]+$')
APP_NAME_RE = re.compile(r'"([^"]+)"')
View msys2-environment.txt
ProgramW6432=C:\Program Files
bparker06 / NEATEvolve.lua
Created Jul 29, 2019 — forked from cracyc/NEATEvolve.lua
View NEATEvolve.lua
-- MarI/O by SethBling
-- Feel free to use this code, but please do not redistribute it.
-- usage: mame nes smb1 -window -autoboot_script NEATEvolve.lua
-- create savestate 1 at the start of the level you want it to learn
local Filename
local ButtonNames
local Game
local pool
bparker06 / 00-irc-log.textile
Created Jun 13, 2019 — forked from amcgregor/00-irc-log.textile
Where asking a simple question, and not accepting useless and insulting answers, gets you banned from an IRC channel.
View 00-irc-log.textile

Cleaned IRC log of #python starting Monday, 25 July, 2011 at 17:13:55 EDT.

Gems are highlighted in bold.

GothAlice How do I determine if a given object is a @classmethod, and, additionally, how do I determine if it is a @staticmethod? 1
KirkMcDonald GothAlice: Why would you care?
GothAlice KirkMcDonald: Enforcing interfaces, not that it matters.
dash GothAlice: you’re right, it doesn’t matter
_habnabit GothAlice, if you wanted an answer to the question as asked, why don’t you try ##python-friendly? #python is about writing better code.
nedbat GothAlice: what KirkMcDonald should have said was, “The Python culture is to not check ahead of time, do you have an unusual requirement that means you really have to know?”
bparker06 /
Created Jun 10, 2019 — forked from caniszczyk/
Clone all repos from a GitHub organization
curl -s | ruby -rubygems -e 'require "json"; JSON.load( { |repo| %x[git clone #{repo["ssh_url"]} ]}'
View GetAllWifiPasswords.ps1
# Run this script as an Admin user and get a list of all WiFi passwords.
$listProfiles = netsh wlan show profiles | Select-String -Pattern "All User Profile" | %{ ($_ -split ":")[-1].Trim() };
$listProfiles | foreach {
$profileInfo = netsh wlan show profiles name=$_ key="clear";
$SSID = $profileInfo | Select-String -Pattern "SSID Name" | %{ ($_ -split ":")[-1].Trim() };
$Key = $profileInfo | Select-String -Pattern "Key Content" | %{ ($_ -split ":")[-1].Trim() };
WifiProfileName = $SSID;
Password = $Key
bparker06 / 10-ssl.conf
Created Jan 8, 2019 — forked from bluet/10-ssl.conf
lighttpd + letsencrypt + my config = A+ score on ssllabs
View 10-ssl.conf
# Replace [YOUR_DOMAIN_NAME] by your real domain
server.modules += ( "mod_setenv" ) # For HSTS
$SERVER["socket"] == "" {
ssl.engine = "enable"
ssl.pemfile = "/etc/letsencrypt/live/[YOUR_DOMAIN_NAME]/combined.pem" = "/etc/letsencrypt/live/[YOUR_DOMAIN_NAME]/fullchain.pem"
ssl.dh-file = "/etc/ssl/certs/dhparam.pem"