Skip to content

Instantly share code, notes, and snippets.

View fannar's full-sized avatar
🎯
making

fannar fannar

🎯
making
View GitHub Profile
@fannar
fannar / mxf-folder2mp4.sh
Created May 3, 2023 15:35 — forked from alexarje/mxf-folder2mp4.sh
Convert a folder of MXF files to one MP4 file with FFmpeg
#!/bin/bash
# Script for converting a folder of MXF video files to different to a single MP4 file.
# Alexander Refsum Jensenius, RITMO, University of Oslo
# v0.1 2019-11-03
# Find and move all MXF files to the "root" (where the script is run from)
find . -name "*.MXF" -exec mv {} . ";"
# Create list of files to be used for concatenation
@fannar
fannar / apns.md
Last active March 10, 2022 23:35 — forked from greencoder/apns.sh
Curl the APNS http/2 API

Note: You MUST have curl 7.47+ with http/2 support compiled in

PEM

Convert P12 to PEM: openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts

curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
@fannar
fannar / encrypt_openssl.txt
Created March 8, 2022 13:11 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@fannar
fannar / mpv.conf
Created April 17, 2020 00:47 — forked from shabbir-hasan/mpv.conf
MPV Configuration (mpv.conf) on Windows 10 Pro
# vim: syntax=config
###########
# General #
###########
priority=high
input-ipc-server=/tmp/mpvsocket # listen for IPC on this socket
load-stats-overlay=yes # use local stats.lua
@fannar
fannar / mpv.conf
Created April 17, 2020 00:47 — forked from iGlitch/mpv.conf
my mpv config
###########
# General #
###########
vo=libmpv
cocoa-force-dedicated-gpu=yes
#load-stats-overlay=no
# OpenGL settings
gpu-api=opengl
@fannar
fannar / arch-systemd-rbenv-passenger-nginx.md
Created May 30, 2016 13:21 — forked from 46bit/arch-systemd-rbenv-passenger-nginx.md
Arch Linux and Systemd: Rbenv, Passenger and Nginx

Arch Linux and Systemd: Rbenv, Passenger and Nginx

Rbenv

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
@fannar
fannar / openemu_single_file_archives.md
Created May 30, 2016 10:15 — forked from funkatron/openemu_single_file_archives.md
converting 7zip files with multiple ROMs to individual files for OpenEmu usage

I use Homebrew for package management, so the instructions here work with that. You could probably get p7zip and atool another way if you want.

  1. install p7zip with homebrew: brew install p7zip
  2. install atool with homebrew: brew install atool
  3. extract individual files from .7z archives to current directory: atool -X . -e -E *.7z
  4. delete or move the .7z files: rm *.7z
  5. archive each file into its own ZIP archive using find and atool: find . -d 1 -type f -exec atool -a -F 7z -E -e {} ';'
  6. delete the uncompressed rom files. They should have a common file extension, which you'll need to change depending on the ROM type. For example, I needed to delete a bunch of .gb and .gbc files: rm *.gb; rm *.gbc

Keybase proof

I hereby claim:

  • I am fannar on github.
  • I am fannar (https://keybase.io/fannar) on keybase.
  • I have a public key whose fingerprint is 40BB B9C9 7E42 3FA0 4C58 94F4 04D9 977E 6F8C 26C5

To claim this, I am signing this object:

@fannar
fannar / gist:939533
Created April 24, 2011 13:05 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new