Skip to content

Instantly share code, notes, and snippets.

View bwbaugh's full-sized avatar

Wesley Baugh bwbaugh

View GitHub Profile
@bwbaugh
bwbaugh / server-setup-guide.md
Last active June 28, 2025 06:39
Guide to set up a new VPS

Guide to set up a new VPS

This guide was written while setting up an Unbuntu VPS. There may be some differences when setting up a different distro.

Initial steps as root

Do some basic setup as the root user, which should mainly consist of

@queertypes
queertypes / Record.hs
Created February 18, 2015 20:41
Record partial application in Haskell
> data Thing = Thing {a :: Int, b :: Int, c :: Int} deriving Show
> :t
Thing :: Int -> Int -> Int -> Thing
> Thing {a = 10}
<interactive>:13:1: Warning:
Fields of ‘Thing’ not initialised: b, c
In the expression: Thing {a = 10}
In an equation for ‘it’: it = Thing {a = 10}
@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
@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
@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:

@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
#!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):
@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.

@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
@tung
tung / twitch-vod-chat.py
Last active June 11, 2025 20:10
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