Skip to content

Instantly share code, notes, and snippets.

View gh0st's full-sized avatar

Chad Hollman gh0st

  • Oregon, United States
View GitHub Profile
#!/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
@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;
<!-- vim: set ts=2 et sw=2 sts=2: -->
<configuration>
<system.web>
<customErrors mode="off" />
</system.web>
<system.webServer>
<httpErrors existingResponse="PassThrough" />
@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
@gh0st
gh0st / gdmpydemo.py
Created May 30, 2018 21:14 — forked from olliefr/gdmpydemo.py
Google Distance Matrix API Python client example
# Google Distance Matrix Python Demo
# ==================================
#
# How to set up (Local part)
# --------------------------
#
# Must have Python (>= 3.4) installed with 'requests' library. On Windows, maybe try
# Anaconda Python? It has a 'conda' package manager, make sure 'requests' is installed.
#
# How to set up (Internet part)
@gh0st
gh0st / sql.json
Created August 17, 2018 20:18
Sql snippets file for SQL ops studio.
{
// Place your snippets for sql here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
type description release type
@gh0st
gh0st / vscode extensions
Last active February 4, 2021 15:37
My VS Code extensions that I use in my development environments.
abusaidm.html-snippets
akamud.vscode-theme-onedark
Angular.ng-template
austin.code-gnu-global
bencoleman.armview
castwide.solargraph
CoenraadS.bracket-pair-colorizer
dbaeumer.vscode-eslint
donjayamanne.python
eamodio.gitlens
@gh0st
gh0st / sonarqube.md
Created February 4, 2021 15:40
A write up on how to quickly spin up an instance of sonarqube on with a docker container.

SonarQube and Docker

This is a write up on how to get a SonarQube up and running in docker so that the sconar scanner can be run against project source code for source code analysis.

Start SonarQube

first run docker run -d --name sonarqube -p 9000:9000 sonarqube to start the sonarqube container

@gh0st
gh0st / setup-pi-for-pxe-server.md
Last active February 4, 2021 15:42
A write up on how to get your pi working as a pxe server. (Note, I haven't actually been able to image a windows machine with this.)

Set up a pi to run as a pxe server

First we need to burn a SD card using Raspian Stretch Lite.

# After the image has been burned, enable ssh.
touch /Volumes/boot/ssh

Put the sd card in the pi, find the ip address of the pi, and remote into the pi with the default username and password.