Skip to content

Instantly share code, notes, and snippets.

@gbonk
gbonk / redundant.sh
Created November 22, 2023 02:52
Find media files that already have subs and delete any sub files.
#!/usr/bin/env bash
OIFS="$IFS"
IFS=$'\n'
for mfile in $(find /mnt/movies -type f -name '*.mkv' -o -name '*.mp4'); do
echo "Checking: " $(basename "$mfile" )
has_subs="$( timeout 60 mediainfo '--Output=Text;%Language/String%, ' $mfile | grep -i 'english,' )"
@gbonk
gbonk / zoom-app-gallery-sp.json
Created June 5, 2023 12:42
Zoom Enterprise App SP created via AAD Gallery from the AAD Graph Explorer
@gbonk
gbonk / check.sh
Created October 10, 2021 22:26
Something that helps to check if a website uses www or not via redirect
if [[ -z $1 ]]; then
echo "a domain.tld is required"
exit 1
fi
domain="$1"
URL_WO="$domain"
11:50:29.395 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /Users/gregory/.gradle/native
11:50:29.592 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Executing build 87a5d760-4b48-48ba-98d1-e1f84657714e in daemon client {pid=45695}
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface en5
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:aede:48ff:fe00:1122%en5
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun2
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
11:50:29.600 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:
bash-3.2$ export PACKER_LOG=1
bash-3.2$ ./package.sh centos-base
Var-Files = -var-file=/tmp/credentials.json.nGXats
~/Documents/GitHub/devops-application/package/centos-base ~/Documents/GitHub/devops-application/package
2018/03/05 16:26:49 [INFO] Packer version: 1.2.2-dev (304376715d870fe086c4bdcab485e8135a925ce4+CHANGES)
2018/03/05 16:26:49 Packer Target OS/Arch: darwin amd64
2018/03/05 16:26:49 Built with Go Version: go1.9.4
2018/03/05 16:26:49 Detected home directory from env var: /Users/gregory
2018/03/05 16:26:49 Using internal plugin for amazon-ebssurrogate
2018/03/05 16:26:49 Using internal plugin for digitalocean
@gbonk
gbonk / HelpBill.java
Created June 7, 2017 14:49
example in java of how to serialize and de-serialize a hashtable
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Hashtable;
public class StringInt {
public static void main(String[] args) {
Hashtable<String, Integer> ht = new Hashtable<String, Integer>();
@gbonk
gbonk / debug.log
Created May 23, 2017 20:21
Debug log of issue I'm having
INFO global: Vagrant version: 1.9.3
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.9.3\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_OLD_ENV_="::=::\\"
INFO global: VAGRANT_OLD_ENV_ACLOCAL_PATH="C:\\Program Files\\Git\\mingw64\\share\\aclocal;C:\\Program Files\\Git\\usr\\share\\aclocal"