Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Converts monolithic Audible AAX files to MP3 chapter files.
# Requires ffmpeg, ffprobe, jq, id3v2 and eyeD3
# AAX input file
in="$1"
# MP3 output directory
out="$2"
# Get activation bytes from https://audible-converter.ml/ or https://github.com/inAudible-NG/tables

NINANS - Ninans Is Not A Naming Standard

Introduction

There are a number of public cloud providers who offer services in different geographic regions. Regions are always named differently across providers. Some people like to deploy things in multiple clouds. Some people like to encode information in the names of the resources they deploy in clouds. This may or may not be a good idea.

It may be useful to name stuff consistently, regardless of which cloud provider or region you use. That's NINANS.

Principles

  • Concise. Some systems require short hostnames (e.g. NetBIOS = 15 characters). Leave spare characters for local naming components.
  • Compatible. Lower case letters and numbers only and start with a letter.
1.2.3
99.4.6
0.0.1
dfsdfsd
dddd1.0.0
2.1.3
# Copy all tracks but re-encode audio to ac3
/opt/ffmpeg/ffmpeg -i input.mkv -map 0 -c copy -c:a ac3 -b:a 640k output.mkv
# Copy all tracks but re-encode audio to ac3 (when downmixing 7.1 to 5.1)
/opt/ffmpeg/ffmpeg -i input.mkv -map 0 -c copy -c:a ac3 -b:a 640k -center_mixlev 0.707 output.mkv
@liger1978
liger1978 / array2hash.pp
Last active February 22, 2021 10:19
Puppet: transform array into hash using reduce
$servers = ['server1.domain1','server2.domain2']
$server_hash = $servers.reduce({}) |Hash $memo, String $server| {
$memo + {
$server => {
name => $server,
port => 80,
username => 'admin'
}
}
-----BEGIN CERTIFICATE-----
MIIElDCCA3ygAwIBAgIQAf2j627KdciIQ4tyS8+8kTANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaME0xCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJzAlBgNVBAMTHkRpZ2lDZXJ0IFNIQTIg
U2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ANyuWJBNwcQwFZA1W248ghX1LFy949v/cUP6ZCWA1O4Yok3wZtAKc24RmDYXZK83
nf36QYSvx6+M/hpzTc8zl5CilodTgyu5pnVILR1WN3vaMTIa16yrBvSqXUu3R0bd
KpPDkC55gIDvEwRqFDu1m5K+wgdlTvza/P96rtxcflUxDOg5B6TXvi/TC2rSsd9f
-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
# fisheye2gitlab.rb
#
# Migrate git repos from Atlassian FishEye git server (or a generic git server)
# to GitLab with JIRA integration enabled.
#
# Requires https://github.com/NARKOZ/gitlab
#
# Ensure 'git' user on GitLab server has git/ssh/http access to source repos for
# migration
@liger1978
liger1978 / update-dell-firrmare.sh
Last active June 2, 2016 15:57
Update all firmware on Dell server from RHEL/CentOS Linux
# Update all firmware on Dell server from RHEL/CentOS Linux
wget -q -O - http://linux.dell.com/repo/hardware/dsu/bootstrap.cgi | bash
yum -y install dell-system-update
dsu -n
iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/liger1978/debaa77edd2b59d30754/raw/182c02a618c5eeaec2cb8b90d9f4fe63e761f789/Upgrade-Powershell.ps1'))