Skip to content

Instantly share code, notes, and snippets.

@rkaiser0324
rkaiser0324 / mp3move.php
Last active March 2, 2021 17:24
PHP script to organize a music directory based on tags - see https://blog.echothis.com/2021/02/24/organizing-a-large-music-library-in-2021/
<?php
/**
* mp3move.php </path/to/source/root/to/scan> </path/to/dest/root>
*
* No trailing slashes on destination.
*
* 1) Tested on CentOS 7 only
* 2) Install ffmpeg per https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/
*
*/

Mounting VirtualBox shared folders on an Ubuntu guest

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside an Ubuntu VM that has been exported from an AWS EC2 instance.

Prerequisites

This guide assumes that you are using the following setup:

Initial Steps

@rkaiser0324
rkaiser0324 / convert-for-itunes.ps1
Last active December 10, 2019 17:16
Recursively scan a directory of videos, and transcode them appropriately for iPad using HandbrakeCLI.exe
# convert-for-itunes.ps1
#
# convert-for-itunes.ps1 <c:/path/to/handbrakecli.exe> <c:/path/to/input/directory> <c:/path/to/output/directory>
param([string]$handbrakeclipath,[string]$inputpath,[string]$outputpath)
echo 'Checking ' + $inputpath + ' ...';
get-childitem -LiteralPath "$inputpath" -Recurse | where { ($_.extension -eq ".mp4") -or ($_.extension -eq ".avi") } | % {
$basename = $_.BaseName + ".mp4";
@rkaiser0324
rkaiser0324 / keybase.md
Created January 4, 2019 16:52
Verification for Keybase.io

Keybase proof

I hereby claim:

  • I am rkaiser0324 on github.
  • I am rkaiser (https://keybase.io/rkaiser) on keybase.
  • I have a public key ASD2c8sKLW-ARidcFMBbv4Cvfeg9B8YbI6bJYukG5AKm8go

To claim this, I am signing this object:

@rkaiser0324
rkaiser0324 / CVE-2016-2107_Centos_7_fix.sh
Last active December 20, 2017 00:22 — forked from cuibonobo/CVE-2016-2107_Centos_7_fix.sh
How to fix CVE-2016-2107 on an Nginx server in Centos 7
#!/bin/bash
# You need this for your OpenSSL tests to pass later
yum install perl-core
# These must be run as a non-root user, or else one of the tests will fail
# Grab the source for OpenSSL 1.1, which has the patch for CVE-2016-2107
cd /tmp
wget https://www.openssl.org/source/openssl-1.1.0b.tar.gz && tar -zxf openssl-1.1.0b.tar.gz && cd openssl-1.1.0b
@rkaiser0324
rkaiser0324 / README.md
Last active June 24, 2022 14:53
How to set up Amazon S3 and SES services

Steps

  1. Create an S3 bucket "mybucketname" in the "US West / Northern California" region and set Object Ownership to "ACLs enabled".
  2. In the SES dashboard, in the "us-east-1" region, create two new Identities:
    1. Validate the sending email address "user@domain.com"
    2. Verify domain ownership and add the generated DKIM keys to the DNS
  3. In the IAM dashboard:
    1. Create a new IAM user with programmatic access and record the access and secret keys.
    2. Add the following inline policy to the user, replacing "user@domain.com" and "mybucketname":
#/bin/sh
# generate_h5.sh
# Syntax: generate_h5.sh /path/to/csv/directory /path/to/output/directory
# E.g., generate_h5.sh ./NSF-1701Copper-out/Allfiles.csv ./NSF-1701Copper-out
h5totxt -t 13 -0 -x -100 -o $1/Copper-exx.csv $2/ex.h5
h5totxt -t 13 -0 -y -0 -o $1/Copper-exy.csv $2/ex.h5
h5totxt -t 13 -0 -z -0 -o $1/Copper-exz.csv $2/ex.h5
h5totxt -t 13 -0 -x -100 -o $1/Copper-eyx.csv $2/ey.h5
@rkaiser0324
rkaiser0324 / ADTSTestClass.cs
Last active January 2, 2016 13:39
Switched to using STREAMFILE_BUFFER as per Ian's response at http://www.un4seen.com/forum/?topic=15463.msg107562#msg107562. Works even better on Windows (playback is smoother) but on iOS MyFileProcUserRead() is only called at the beginning. See thread for more details.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Un4seen.Bass;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using System.Net;
using Un4seen.Bass.AddOn.Aac;