Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Andrew Graham queglay

🎯
Focusing
Block or report user

Report or block queglay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@queglay
queglay / ansible-crypt-environment-var
Last active Mar 1, 2020
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.
View ansible-crypt-environment-var
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 Feb 22, 2020
Quarter window tiling in Centos 7 RHEL 7
View window-tiling-gnome3-centos7
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
View vagrant_shared_folder_missing
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.
View vagrant_ubuntu_update_bug
[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!
View bach_convert_to_quicktime_mp4.sh
#!/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 &
View bach_convert_to_quicktime_mp4.sh
#!/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 &
View batch_convert_to_prores.sh
#!/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 &
View OPmenu.xml
<?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[
View html-share-buttons.html
<!-- place this in the header -->
<style type="text/css">
#share-buttons img {
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
You can’t perform that action at this time.