Skip to content

Instantly share code, notes, and snippets.

View gh0st's full-sized avatar

Chad Hollman gh0st

  • Oregon, United States
View GitHub Profile
@gh0st
gh0st / spectre.c
Created January 5, 2018 17:06 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
<!-- vim: set ts=2 et sw=2 sts=2: -->
<configuration>
<system.web>
<customErrors mode="off" />
</system.web>
<system.webServer>
<httpErrors existingResponse="PassThrough" />
@gh0st
gh0st / api.js
Created June 28, 2017 16:53
Setting up the server side APIs in a MEAN/angular-cli app
/* courtesy of https://scotch.io/tutorials/mean-app-with-angular-2-and-the-angular-cli */
const express = require('express');
const router = express.Router();
/* GET api listing. */
router.get('/', (req, res) => {
res.send('api works');
});
module.exports = router;
#!/usr/bin/python
# A Wake on LAN program that allows you to send magic packets over the Internet
import socket, struct
class Waker():
def makeMagicPacket(self, macAddress):
# Take the entered MAC address and format it to be sent via socket
splitMac = str.split(macAddress,':')
# Pack together the sections of the MAC address as binary hex