Skip to content

Instantly share code, notes, and snippets.

-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFWcwY8BEACjPRkozANb8p9t1n3aFBVSbas2A3WXiYTWrEdOIGuI2nah98j2
cR7m67/Va9leZx9ZNBGdnG4orZySihRg9fEJh3YJn0ofGKScuaYSaAl1tieouLCK
W8jgIRCTNMF+JOwoXAcRkc0+pOo+Q/6RKdJT/wwHI6xIvz0K+upks7MRq8gecwvU
XvF0egfNcQuwthAU/aiVFliAKSjYFvpfa6+KjaSbRKxJNmPi0kjPTSXHHrvm0vVq
9eG9Gi9lalqK7YF5/jGEOOCvzVtpQ4gFQOKZzCIXgZzVaStdfUGGsJZWjyqBlVJl
lLW7iWK9L7WQcFrngF9iEdP7AQXoM6uZNGsDOJS9jcBptDl/oOEJ1bV3QQpY3Dwx
vII4yzgZdKOqB2T7BVBSU+rhrg4pGjZJmfQSHEgFtvJYMrZl/Wh+RtI825Ja/uxs
uQ4Ai/OEt8DqntiXfcbfw5vPnI7Z3Pz7jsh0gtuekxMZiPeC115Hs6nFZiOXzSPH
@SkyWriter
SkyWriter / default.nix
Created February 10, 2024 21:19 — forked from danbst/default.nix
Proof-of-Concept running PostgreSQL tests inside Nix package build
with import <nixpkgs> { };
runCommand "some-test" {
buildInputs = [ postgresql ];
preCheck = ''
set -e
export PGDATA=$TMP/db
export PGHOST=$TMP/socketdir
mkdir $PGDATA $PGHOST
pg_ctl initdb
echo "unix_socket_directories = '$PGHOST'" >> $PGDATA/postgresql.conf
@SkyWriter
SkyWriter / README.md
Created December 17, 2023 14:28 — forked from baetheus/README.md
SmartOS Single IP with NAT using VLAN

WARNING

These intructions might work, but they need a bit of attention. I've been reading through ipf and smf documentation and have found a few ways to improve this process. When I have time I'll add that information here, until then, be sure to look into the ipf settings if you're having issues with routing. Good luck!

Foreword

This is a modified version of sjorge's instructions for Single IP with NAT. Those instructions can be found here: https://docu.blackdot.be/snipets/solaris/smartos-nat

The primary difference is that this version does not rely on etherstubs for internal switching, but instead uses a vlan configuration. The benefits of this method over using etherstubs are:

  1. Project Fifo (project-fifo.net) can create vms and zones with vlans, but does not currently have etherstub support.
  2. Vlan switching is supposedly more efficient than creating an etherstub to handle switching. I have not tested this statement.
@SkyWriter
SkyWriter / pad_packed_demo.py
Created January 14, 2023 19:30 — forked from HarshTrivedi/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@SkyWriter
SkyWriter / README.md
Created February 22, 2021 15:10
Generate BrandMeister repeater map for Google Earth
@SkyWriter
SkyWriter / sidekiq_monitoring
Created February 28, 2020 12:02 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@SkyWriter
SkyWriter / file.rb
Created February 17, 2020 12:17
Reer Tech Maze
maze_map = %Q(
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓ ▓ ▓
▓ ▓▓▓▓▓▓▓ ▓ ▓ ▓ ▓
▓ ▓ ▓ ▓▓▓ ▓ ▓ ▓
▓ ▓ A ▓ ▓ ▓ ▓ ▓ ▓
▓ ▓ ▓B ▓ ▓ ▓ ▓
▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓▓▓
▓ ▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
maze_map = %Q(
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓ ▓ ▓
▓ ▓▓▓▓▓▓▓ ▓ ▓ ▓ ▓
▓ ▓ ▓ ▓▓▓ ▓ ▓ ▓
▓ ▓ A ▓ ▓ ▓ ▓ ▓ ▓
▓ ▓ ▓B ▓ ▓ ▓ ▓
▓▓ ▓ ▓▓▓▓▓ ▓▓▓ ▓▓▓
▓ ▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# ffmpeg -i steep_turn_corrected.MOV -acodec copy -vcodec copy steep_turn_corrected.mp4
# exiftool -ProjectionType="equirectangular" photo.jpg
ffmpeg -i hatcher_birthday1.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate0.ts
ffmpeg -i hatcher_birthday2.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "concat:intermediate0.ts|intermediate1.ts" -c copy -bsf:a aac_adtstoasc hatcher_birthday.mp4
@SkyWriter
SkyWriter / tmux-migrate-options.py
Created May 23, 2019 10:23 — forked from tbutts/tmux-migrate-options.py
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#