Skip to content

Instantly share code, notes, and snippets.

View enesser's full-sized avatar

Eric J Nesser enesser

View GitHub Profile
@enesser
enesser / 52-definitions-of-vr-dawn-of-the-new-everything.txt
Created March 19, 2018 18:52
Jaron Lanier's 52 Definitions of Virtual Reality from Dawn of the New Everything
###############################################################################
# Jaron Lanier's 52 Definitions of Virtual Reality
# Taken from Dawn of the New Everything:
# https://www.amazon.com/Dawn-New-Everything-Encounters-Reality/dp/1627794093/
1. A twenty-first-century art form that will weave together the three great twentieth-century arts: cinema, jazz, programming.
2. A simulated new frontier that can evoke a grandiosity recalling the Age of Exploration or the Wild West.
3. Hope for a medium that could convey dreaming.
@enesser
enesser / xmlstartlet-xml.sh
Created March 14, 2018 20:34
Using xmlstartlet to pull info from XML via xpath queries
###########################################################
# use xmlstarlet to extract info from xml via xpath queries
$ xmlstarlet sel -t -v "//element/path/@attribute" file.xml
@enesser
enesser / f5-load-balancer-irule-secure-cookies.txt
Created March 14, 2018 18:28
F5 Load Balancer iRule to Mark All Cookies as HTTPOnly, Secure
when HTTP_RESPONSE priority 100 {
if { [catch { set setckval [HTTP::header values "Set-Cookie"]
HTTP::header remove "Set-Cookie"
foreach value $setckval {
if { "" != $value } {
set testvalue [string tolower $value]
set valuelen [string length $value]
switch -glob $testvalue {
"*;secure*" -
"*; secure*" { }
@enesser
enesser / shaderBasicsCheatSheet.shader
Last active April 4, 2024 01:07
Shader Basics Cheat Sheet (Unity)
// *****************
// Types of Shaders:
// * Surface Shader:
// lit shaders that affect lighting of an object
// * Unlit Shader:
// vertex and fragment shader, control vertex properties
// * Image Effect Shader:
@enesser
enesser / gist:9c1c43317526edcb3bc689298bfd7c3d
Created October 4, 2017 16:22 — forked from tobek/get-image-urls.js
Save images from chrome inspector network tab
/* right click on an entry in the network log, select Copy All as Har
* type in console: x = [paste]
* paste the following JS code into the console
* copy the output, paste into a file
* then wget -i [that file]
*/
(function(logObj, mime) {
var results = [];
logObj.log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
@enesser
enesser / add-user-as-admin-linux
Created August 16, 2017 18:29
Add user as a local admin w/ SSH access in Linux
usermod -aG localadmins username
usermod -aG sshusers username
@enesser
enesser / scp.sh
Created February 14, 2017 00:16
Copy a file from a remote server to your local machine using scp
$ scp user-id@host-name.com:/remote-folder/filename /local-folder
#example
$ scp fred@remoteserver.com:/remote/file.txt .
@enesser
enesser / brew-install-all-codecs-ffmpeg.sh
Created December 7, 2016 23:19
brew-install-all-codecs-ffmpeg.sh
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
@enesser
enesser / compress-mp4.sh
Created December 2, 2016 20:51
Compress mp4
ffmpeg -i input.mp4 -c:v libx264 -crf 24 -b:v 250k -c:a aac output.mp4
@enesser
enesser / convert-audio.sh
Created November 23, 2016 21:27
Batch convert audio using ffmpeg
#!/bin/bash
for i in public/static/audio/*.aif ; do
ffmpeg -i "$i" -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 public/static/audio/$(basename "${i/.aif}").mp3
ffmpeg -i "$i" -f ogg -acodec libvorbis -ab 192000 -ar 44100 public/static/audio/$(basename "${i/.aif}").ogg
ffmpeg -i "$i" -f wav -acodec pcm_s32le -ab 192000 -ar 44100 public/static/audio/$(basename "${i/.aif}").wav
done