Skip to content

Instantly share code, notes, and snippets.

View queglay's full-sized avatar
🎯
Focusing

Andrew Graham queglay

🎯
Focusing
View GitHub Profile
@chris-gardner
chris-gardner / houdini_otl_hotload.py
Created September 11, 2020 01:58
Load houdini otls / hdas on the fly
import hou
import os.path
def loadHdaLibrary(libPath):
"""
Loads all the HDA files in a folder
@param libPath: HDA library file path
"""
@jtomori
jtomori / OPmenu.xml
Last active May 8, 2019 11:37
"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[
@MJeorrett
MJeorrett / git_submodule_replacement.md
Last active June 19, 2023 17:25
Replace directory with git submodule

These are the steps required to replace a directory with a submodule in git. Note: Assumes that you are currently working on branch called 'develop'

  1. Check out a new branch to make the changes on: git checkout -b creating-submodule
  2. delete directory to be replaced rm -rf path/of/directory/to/be/replaced
  3. git add . then git commit -m "removing local directory"
  4. add the submodule: git submodule add "https://github.com/repoName" path/of/directory/to/be/replaced
  5. git add . then git commit -m "adding submodule"
  6. delete the submodule directory if you don't do this git will throw a hissy when you try to checkout out develop to merge the changes in
  7. git checkout develop
  8. pull the submodule back into the local repo: git submodule foreach git fetch --tags then git submodule update --init --recursive
@Brainiarc7
Brainiarc7 / ffmpeg-multi-instances-xargs.md
Last active November 11, 2024 15:31
This gist will show you how to launch multiple ffmpeg instances with xargs, very useful for NVIDIA NVENC based encoding where standard GPUs limit the maximum simultaneous encode sessions to two.

Spawning multiple ffmpeg processes with xargs:

On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:

$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
  xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"

This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.

@lilongen
lilongen / run-ansible-with-any-host-without-inventory
Last active May 5, 2023 23:16
How to run Ansible without specifying the inventory but the host directly?
Question:
. How to run Ansible without specifying the inventory but the host directly?
. Run a playbook or command with arbitrary host not in the inventory hosts list?
. run ansible with arbitrary host/ip without inventory?
Answer:
Surprisingly, the trick is to append a ,
The host parameter preceding the , can be either a hostname or an IPv4/v6 address.
ansible all -i example.com,
@tomysmile
tomysmile / setup-vagrant-macosx.md
Created April 26, 2016 05:54
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

@jpettersson
jpettersson / gist:4a719e12a03cdfc91ef1
Created December 12, 2014 09:44
Git: Apply changes from branch as unstaged changes on other branch
Sometimes that "quick" refactor takes longer than I was planning for. Then it's nice to commit changes to a temporary "dirty" feature branch just to have an off-laptop backup and change history. I use this method for storing a bunch of trash commits on a feature branch and then lifting them back over to master when I want to continue work / clean up.
# Check out the branch you want to start working from
git checkout master
# Check out the dirty "refactor" branch as staged changes
git checkout refactor -- .
# Reset will unstage the changes
git reset
@kris-kelvin
kris-kelvin / vpc_openvpn.json
Last active February 6, 2019 20:39
AWS CloudFormation template for creating a VPC with a private subnet for your virtual appliance and a public subnet with openVPN server. Please ensure that you are subscribed to the openVPN server (AWS Marketplace) and that the AMI IDs of the openVPN server are still valid (as they change frequently).
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "This template creates a VPC with a private subnet for the SAP backend and a public subnet with openVPN server.",
"Parameters" : {
"AdminCidrIp" : {
"Type" : "String",
"Description" : "Source CIDR block for administrating the openVPN server",
@davidsneal
davidsneal / html-share-buttons.html
Last active December 12, 2023 13:18
HTML Share Buttons
<!-- I got these buttons from simplesharebuttons.com -->
<div id="share-buttons">
<!-- Buffer -->
<a href="https://bufferapp.com/add?url=https://simplesharebuttons.com&amp;text=Simple Share Buttons" target="_blank">
<img src="https://simplesharebuttons.com/images/somacro/buffer.png" alt="Buffer" />
</a>
<!-- Digg -->
<a href="http://www.digg.com/submit?url=https://simplesharebuttons.com" target="_blank">
@florianeckerstorfer
florianeckerstorfer / vlc-notification-center.scpt
Last active September 17, 2017 16:36
Automatically disable OS X Notification Center when VLC is playing a video in fullscreen mode. The script also enabled NC again when the video is paused, full screen mode is left or VLC is quit.
-- You need to open AppleScript Editor, paste the code and adapt the pListFile variable
-- Then export the script (File > Export) and save it as an application (activate "Stay open after run handler")
global plistFile
on run
-- The plist file will be different on your system. You can find out the filename by running the following line in a terminal window
-- $ ls ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist
set plistFile to "~/Library/Preferences/ByHost/com.apple.notificationcenterui.C9C4D4C4-E6DF-59FC-9BF4-25514282C806.plist"
checkStatus()