Skip to content

Instantly share code, notes, and snippets.

@jkoop
jkoop / get-list-of-clients-from-aerohive-aps.php
Created April 11, 2023 02:30
Get a list of all Wifi clients from AeroHive APs
#!/usr/bin/php
<?php
/**
* This script SSHes into all of my AeroHive Wifi APs, gets a list of current
* connected clients from each if them, assembles the list into one, and writes
* that list to a JSON file.
*
* This is intended to be run as a minutely `cron` job. As such, the path of the
* output file is the date, formatted to not put a million files in one folder:
@jkoop
jkoop / split-media-by-chapters.sh
Last active September 30, 2022 01:37
use ffmpeg to split file by chapter metadata
#!/bin/bash
while [ $# -gt 0 ]; do
extension="${1##*.}"
ffmpeg -i "$1" 2> tmp.txt
# Chapter #0:0: start 0.000000, end 1290.013333
# first _ _ start _ end
while read -r first _ _ start _ end; do
@jkoop
jkoop / redlinks.js
Last active March 6, 2022 01:28
Try each link on the page, and if it's dead, made it red
@samdoran
samdoran / aerohive.md
Last active May 19, 2024 00:46
Configuring Aerohive access points using the CLI

Aerohive

Initial setup

  1. Reset to factory defaults

     reset config bootstrap
     reset config
    

    The username is admin and the password is aerohive or Aerohive1.

@jkoop
jkoop / ClosureTable.php
Last active September 20, 2021 20:04 — forked from mohanklein/ClosureTable.php
Closure Table Trait for Laravel Eloquent Models
<?php // app/Http/Traits/ClosureTable.php
namespace App\Models\Traits;
use Exception;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Facades\Db;
/**
@jdah
jdah / .vimrc
Created June 14, 2021 11:54
jdh's NeoVim .vimrc
call plug#begin()
Plug 'drewtempelmeyer/palenight.vim'
Plug 'vim-airline/vim-airline'
Plug 'wlangstroth/vim-racket'
Plug 'sheerun/vim-polyglot'
Plug 'rust-lang/rust.vim'
Plug 'preservim/tagbar'
Plug 'universal-ctags/ctags'
Plug 'luochen1990/rainbow'
Plug 'vim-syntastic/syntastic'
@fnky
fnky / ANSI.md
Last active July 6, 2024 19:14
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@lanceliao
lanceliao / wg-client1.conf
Last active June 21, 2024 17:24
Sample WireGuard configuration files
[Interface]
Address = 10.200.200.3/32
PrivateKey = [Client's private key]
DNS = 8.8.8.8
[Peer]
PublicKey = [Server's public key]
PresharedKey = [Pre-shared key, same for server and client]
Endpoint = [Server Addr:Server Port]
AllowedIPs = 0.0.0.0/0
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 5, 2024 10:02
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO