Skip to content

Instantly share code, notes, and snippets.

Dir.glob("*.mkv").each{ |f| `ffmpeg -i "#{f}" -target ntsc-dvd -aspect 16:9 -sameq "#{f.gsub('mkv','mpg')}"` }
cat ~/.rvm/log/ruby-1.8.5-p231/make.log
[2011-06-22 11:36:32] make
gcc main.o libruby-static.a -ldl -lobjc -o miniruby -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT
rbconfig.rb unchanged
cc -dynamiclib -undefined suppress -flat_namespace -install_name /Users/josephj/.rvm/rubies/ruby-1.8.5-p231/lib/libruby.dylib -current_version 1.8.5 -compatibility_version 1.8 array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o -o libruby.1.8.5.dylib
compiling Win32API
make[1]: Nothing to be done for `all'.
compiling bigdecimal
make[1]: Nothing to be done for `all'.
compiling curses
[2011-06-22 11:48:37] make
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c array.c
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c bignum.c
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c class.c
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c compar.c
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dir.c
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dln.c
dln.c: In function ‘dln_load’:
dln.c:1463: warning: ‘NSCreateObjectFileImageFromFile’ is deprecated (declared at /usr/include/mach-o/dyld.h:144)
dln.c:1469: warning: ‘NSLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:160)

Campaigning Thingo

The models you have are: Campaign, User, Card, Question and Response. Here's how I would do it using ActiveRecord

Campaigns exist with questions and responses by users. The Campaign model would look like this:

class Campaign < ActiveRecord::Base
  has_many :questions
 has_many :responses, :through =&gt; :questions
@devjj
devjj / freenas-backblazeb2.md
Last active April 6, 2023 06:29
FreeNAS Backup to Backblaze B2

Backing up FreeNAS to Backblaze B2

I am not the original author of the content on this page. While searching for information about setting up Backblaze B2 on a FreeNAS installation, I came across this hyperlink: https://blog.justin-tech.com/blog/freenas-b2-backup. Unfortunately, that page now leads to an HTTP 502. Google had it cached.

*The instructions worked almost perfectly, except for a couple adjustments due to updated versions of the relevant software. The idea that this useful information may disappear into the aether worried me, as it may still help others, and I'll more than likely need it again in the future. In the spirit of open source, I copied the page as rich text in Firefox, ran it through an HTML to Markdown converter, and set about cleaning it up, fixing conversion errors and fo

Keybase proof

I hereby claim:

  • I am devjj on github.
  • I am jjaramillo (https://keybase.io/jjaramillo) on keybase.
  • I have a public key ASDq6uTbPev2ptGASzaDJaMR29hJIbWx970QOZ1uSuHdjwo

To claim this, I am signing this object:

@devjj
devjj / ffmpeg-hevc-encode-nvenc.md
Last active April 28, 2022 18:36
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with an optional CUVID-based hardware-accelerated decoder.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

tl;dr

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc constqp -global_quality 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc vbr_hq -b:v 30000k -qmin 17 -qmax 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

@devjj
devjj / mastodon-docker-setup.md
Created April 25, 2022 19:59 — forked from jobotz/mastodon-docker-setup.md
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/mastodon directory
git clone https://github.com/mastodon/mastodon.git
# Change directory to ~/mastodon

cd ~/mastodon

@devjj
devjj / whisper-transcribe.bash
Created November 14, 2022 03:35 — forked from DaniruKun/whisper-transcribe.bash
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@devjj
devjj / tailscale.sh
Created May 26, 2023 23:34
Firewalla Gold 22.04 post_main.d script for Tailscale
sudo curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
sudo curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt-get update
sudo apt-get install -y tailscale
sudo tailscale up --advertise-routes=10.0.1.0/24 --accept-routes --advertise-exit-node