tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>
where:
- `` is the root-mounted (i.e. starts with /) path to the files
!/bin/bash | |
# pull an export from FreshStart chrome plugin directly from the clipboard and fix the URLs | |
xclip -o | sed 's/,/,\n/g' | sed 's/chrome.extension.*uri.//g' | tr -d '\n' > /dev/shm/fixTheGreatSuspender | |
# just show the fixed version on the console | |
cat /dev/shm/fixTheGreatSuspender | |
# now copy it back to the clipboard, so we can import in FreshStart | |
xclip -selection c -i < /dev/shm/fixTheGreatSuspender |
#!/bin/bash | |
CD=$(dirname $(readlink -f $0)) | |
while getopts hlv: option ; do | |
case "${option}" | |
in | |
h) export HELP=1;; | |
l) export LIST=1;; |
#!/bin/bash | |
v=$1 | |
if [ "$v" == "" ] ; then | |
v=-1 | |
fi | |
list=$(curl -L 'https://download.zerotier.com/RELEASES/' | gzip -d || curl -L 'https://download.zerotier.com/RELEASES/') | |
list=$(echo "$list" | awk -F'"' '{print $2}' | sort -V ) | |
n=$(echo "$list" | wc -l | egrep -v '^$') |
from arnold import * | |
import GafferArnold | |
import ctypes | |
import imath | |
import Gaffer | |
def convert_parameters( gaffer_shader, node ): | |
node_name = AiNodeGetName( node ) | |
entry = AiNodeGetNodeEntry( node ) |
# =============================================================================================================== | |
# rules to redirect all ports to a different machine (192.168.0.3), but port 22 | |
# =============================================================================================================== | |
redirect_to=192.168.0.3 | |
iptables -A FORWARD -i eth0 -o eth0 -p tcp --syn --dport 1:21 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -i eth0 -o eth0 -p udp --dport 1:21 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -i eth0 -o eth0 -p tcp --syn --dport 23:65389 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -i eth0 -o eth0 -p udp --dport 23:65389 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -i eth0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -t nat -A PREROUTING -p tcp --syn --dport 1:21 -j DNAT --to-destination $redirect_to |
#!/bin/bash | |
# run this in the machine running ldap server to export the db to ldif | |
# slapcat -n 0 -l config.ldif | |
# slapcat -n 1 -l data2.ldif' | |
# this mangles the ldif output so it can be import by synology openldap | |
cat data2.ldif | \ | |
sed 's/dc=atomovfx,dc=lan/dc=ldap/g' | \ | |
sed -e 's/Admin/admin/g' -e 's/Users/users/g' -e 's/ou=Group/cn=groups/g' -e 's/ou=/cn=/g' | \ |
// this code is based on the original extension found in this | |
// other gist: https://gist.github.com/DennisWeidmann/7c4b4bb72062bd1a40c714aa5d95a0d7 | |
// thanks Dennis Weidmann! | |
extension NSImage { | |
// function used by all functions below. It shouldn't be used directly | |
func __toPixelBuffer(PixelFormatType: OSType) -> CVPixelBuffer? { | |
var bitsPerC = 8 | |
var colorSpace = CGColorSpaceCreateDeviceRGB() | |
var bitmapInfo = CGImageAlphaInfo.noneSkipFirst.rawValue |
Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:
gcloud compute ssh --ssh-flag="-L 8088:localhost:8088" --zone "us-central1-b" "example_instance_name"
Now browsing to localhost:8088 works as it would with standard ssh.
/* | |
based on github gist from rcolinray: https://gist.github.com/rcolinray/7552384 | |
you need to build with glfw2, not glfw3. | |
adjusted for newer ffmpeg ( version>55 - avcodec_alloc_frame now is | |
av_frame_alloc, and some other defines have AV_ prefix added to it ) | |
build it using something like: | |
g++ ./gl_ffmpeg.cpp \ | |
-lavcodec -lavutil \ |