Skip to content

Instantly share code, notes, and snippets.

View queglay's full-sized avatar
🎯
Focusing

Andrew Graham queglay

🎯
Focusing
View GitHub Profile
[user@workstation vagrant-centos-gui2]$ VAGRANT_LOG=info vagrant up
INFO global: Vagrant version: 2.2.9
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/bin/vagrant"
INFO global: VAGRANT_INSTALLER_VERSION="2"
WARN global: resolv replacement has not been enabled!
@queglay
queglay / ansible-crypt-environment-var
Last active March 1, 2020 07:19
Ansible crypt - encrypt string into an environment variable, to read - stash result into a file and use ansible to decrypt again. you will need to specify your own vault keys in place the missing variables shown.
testvar=$(echo -n "test some input that will be encrypted" | ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0) ; echo $testvar | base64 -d > ../secrets/keys/tmp.yml | ansible localhost -m debug -a var="testvar_name" -e "@../secrets/keys/tmp.yml" --vault-id $vault_key
# In practice, gnerating a one time var should not use stdin input. instead use this for the first stage of creating a var
ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0
# this example encrypts to an env var, and then decrypts the value inline without the need for an intermediary file.
testvar=$(echo -n "test some input that will be encrypted and stored as an env var" | ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0)
result=$(echo $testvar | base64 -d | /var/lib/snapd/snap/bin/yq r - "testvar_name" | ansible-vault decrypt --vault-id $vault_key); echo $result
@queglay
queglay / window-tiling-gnome3-centos7
Last active February 22, 2020 07:23
Quarter window tiling in Centos 7 RHEL 7
gsettings set org.gnome.shell.extensions.classic-overrides edge-tiling false
# Install shelltile gnome shell extension.
# Additionaly these config steps are prefereable - https://superuser.com/questions/394376/how-to-prevent-gnome-shells-alttab-from-grouping-windows-from-similar-apps
firehawkgateway: SSH auth method: private key
==> firehawkgateway: Machine booted and ready!
GuestAdditions are newer than your host but, downgrades are disabled. Skipping.
==> firehawkgateway: Checking for guest additions in VM...
firehawkgateway: The guest additions on this VM do not match the installed version of
firehawkgateway: VirtualBox! In most cases this is fine, but in rare cases it can
firehawkgateway: prevent things such as shared folders from working properly. If you see
firehawkgateway: shared folder errors, please make sure the guest additions within the
firehawkgateway: virtual machine match the version of VirtualBox you have installed on
firehawkgateway: your host and reload your VM.
[user@workstation firehawk]$ VAGRANT_LOG=info vagrant up
INFO global: Vagrant version: 2.2.6
INFO global: Ruby version: 2.4.9
INFO global: RubyGems version: 2.6.14.4
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
WARN global: resolv replacement has not been enabled!
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to quciktime compatible mp4
# not great for large numbers of files that will max out ram/cores, but will get the job done quicker than one by one, and great if you have a machine with a high core count and gobs of ram.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec h264 -acodec aac -pix_fmt yuv420p "mp4_${file%.*}.mp4" </dev/null > /dev/null 2>&1 &
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to quciktime compatible mp4
# not great for large numbers of files that will max out ram/cores, but will get the job done quicker than one by one, and great if you have a machine with a high core count and gobs of ram.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec h264 -acodec aac -pix_fmt yuv420p "mp4_${file%.*}.mp4" </dev/null > /dev/null 2>&1 &
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to prores format for editting in an NLE (FCP X, Davinci Resolve etc).
# not great for large numbers of files that will max out cores.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec prores -acodec pcm_s16le "prores_${file%.*}.mov" </dev/null > /dev/null 2>&1 &
@queglay
queglay / OPmenu.xml
Created May 8, 2019 11:37 — forked from jtomori/OPmenu.xml
"Save as New Version" tool in Houdini right-click menu on nodes, for https://jurajtomori.wordpress.com/2018/12/22/houdini-tip-save-modified-asset-as-new-version/
<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
<menu>
<scriptItem id="opmenu.save_as_new_version">
<insertAfter>opmenu.saveoptype</insertAfter>
<label>Save as New Version</label>
<context>
<expression>
<![CDATA[