Skip to content

Instantly share code, notes, and snippets.

View bwbaugh's full-sized avatar

Wesley Baugh bwbaugh

View GitHub Profile
@BenJuan26
BenJuan26 / elite-dangerous-simple.ino
Last active November 4, 2022 06:47
An Arduino sketch for Elite Dangerous that receives data from the game and keeps its switches in sync with the game state.
#include <ArduinoJson.h>
#include <Key.h>
#include <Keypad.h>
// Allow 5 seconds of lag from the device, to the game, and back to the device.
#define BUTTON_SYNC_TIME 5000
// Each button press will last about 100ms.
#define BUTTON_HOLD_TIME 100
@solarkennedy
solarkennedy / troll-yaml output
Last active May 26, 2019 04:41
A demonstration of some surprising yaml junk
$ uq troll-yaml.yaml
{
"country list": [
"US",
"GB",
false
],
"end_date": 20130510,
"favorite_prog_rock_band": true,
"homedir_location": null,
@tung
tung / twitch-vod-chat.py
Last active March 10, 2023 10:34
Download chat from a Twitch VOD and print it to a terminal.
#!/usr/bin/env python3
#
# A script to download chat from a Twitch VOD and print it to a terminal.
# Chat will be downloaded all the way until it ends.
#
# Usage: TWITCH_CLIENT_ID=0123456789abcdef0123456789abcde twitch-vod-chat.py [video_id] [start]
#
# This script could break at any time, because Twitch's chat API is
# undocumented and likes to change at any time; in fact, this script was
@ewenchou
ewenchou / README.md
Last active July 8, 2023 04:36
Run Python script as systemd service
  1. Create a service file like dash_sniffer.service
  2. Put it in /lib/systemd/system/
  3. Reload systemd using command: systemctl daemon-reload
  4. Enable auto start using command: systemctl enable dash_sniffer.service
@nzw0301
nzw0301 / README.md
Last active December 14, 2017 10:55 — forked from tnarihi/README.md
Emacs 24.5 installation on Ubuntu 14.04 without sudo

Installing Emacs 24.4 on Ubuntu 14.04 without sudo privilege

Just run:

sh ./ubuntu14.04-emacs-24.4-install.sh

This will install ncurses which is dependency of emacs24.4. It may requires another dependencies depending on your environment. Note that configure options in emacs installation are for disabling GUI features.

#!ipxe
# To access this file via http use following redirection:
# http://preseed.panticz.de/ipxe/menu.netinstall.ipxe
# choose cpu architecture
cpuid --ext 29 && set arch amd64 || set arch i386
menu NetInstall
item --gap NetInstall Ubuntu Preseed (user: ubuntu, password: t00r):
@divyavanmahajan
divyavanmahajan / list_users.sh
Last active December 27, 2023 14:30
Turnkey OpenVPN - List active users and user profiles.
#!/bin/bash -e
# List users in the system
echo "Users setup in the system."
ls /etc/openvpn/easy-rsa/keys/*ovpn|xargs -n 1 -I FNAME basename FNAME .ovpn|grep -v proxy|xargs -n 1 -I NAME echo " NAME"
echo ------
echo Active users
echo ------
cat /var/log/openvpn/server.log
@bwbaugh
bwbaugh / logstash-guide.md
Last active May 11, 2024 00:37
Installing logstash server and client

Installing logstash

Server install

Install

Install the Java prerequisite:

@526avijitgupta
526avijitgupta / spacemacs-cheatsheet.md
Last active August 29, 2023 12:31
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@rsim
rsim / gist:d11652a8336137832df9
Created April 7, 2015 08:01
How to get the current Unix timestamp in SQL

Get the current Unix timestamp (seconds from 1970-01-01T00:00:00Z) in SQL.

  • MySQL: UNIX_TIMESTAMP()
  • PostgreSQL: CAST(EXTRACT(epoch FROM NOW()) AS INT)
  • MS SQL: DATEDIFF(s, '1970-01-01', GETUTCDATE())
  • Oracle: (CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - DATE'1970-01-01') * 86400