Skip to content

Instantly share code, notes, and snippets.

View rmoriz's full-sized avatar
🎭
Everything counts in large amounts

rmoriz

🎭
Everything counts in large amounts
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 11, 2024 01:22
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@rileyjshaw
rileyjshaw / brew-install-ffmpeg-with-all-options.sh
Last active November 22, 2019 22:33
2019-10-07: Install ffmpeg with all options on MacOS using Homebrew
brew cask install xquartz
brew install amiaopensource/amiaos/decklinksdk
brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact)
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active May 8, 2024 03:08
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
#!/usr/bin/env ruby
###################################################
## Display screen dimensions in macOS using ruby ##
##################################################
# found https://developer.apple.com/reference/coregraphics/1456395-cgdisplaybounds?language=objc
# --> use CoreGraphics framework
# --> CGRect CGDisplayBounds(CGDirectDisplayID display);
#############################################
@ctdk
ctdk / node-test-bigger.rb
Created June 22, 2015 20:53
A ruby script to create a whole bunch of chef nodes.
#!/usr/bin/env ruby
require 'chef-api'
require 'fauxhai'
include ChefAPI::Resource
ChefAPI.configure do |config|
config.endpoint = 'http://HOSTNAME:4545'
config.client = 'admin'
@rmoriz
rmoriz / howto.md
Last active April 14, 2023 20:30
Build an OSX 10.10 base-box for test-kitchen and VirtualBox
@psi-4ward
psi-4ward / README.md
Last active June 13, 2017 13:02
CoreOS mdadm RAID1 for ROOT

CoreOS mdadm RAID1 for ROOT

  • Setup SoftwareRAID for the CoreOS root partition without data-loss.
  • Only for ext4!
  • The Trick is to use the right volume label and fs-types :)
  • We assume CoreOS is on /dev/sdaX and the second RAID Device is /dev/sdb
  • Drawback: only / gets mirrored, Node goes down when sda fails
  1. Boot into any recovery system like Grml
  2. If not already done: install CoreOS
@erichelgeson
erichelgeson / README.md
Last active April 29, 2016 09:20
Replace chef-server with consul (because why not?)

Federated Chef-server'ish with consul.

Why?

Why not? I thought it'd be interesting, and maybe useful.

Goals

  • No centralized chef-server
  • Nodes still know about eachother (so chef-searchs work)
  • Use consul-templates / services for things that need to be updated 'realtime'
  • Use chef resources for installation and configuration of the rest
@gane5h
gane5h / datadog-nginx
Created October 22, 2014 04:06
Nginx log parsing with datadog
"""
Custom parser for nginx log suitable for use by Datadog 'dogstreams'.
To use, add to datadog.conf as follows:
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")]
so, an example line would be:
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse
Log of nginx should be defined like that:
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for';
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully
"""
@ravelll
ravelll / peco-select-rake-task.zsh
Created July 2, 2014 04:42
Zsh script to show and select rake tasks using peco.
function peco_select_rake_task_all() {
local tasks="bundle exec rake -AT"
task=$(eval $tasks | peco --query "$LBUFFER" )
task_split=("${(s/ /)task}")
BUFFER=$task_split[1,2]
CURSOR=$#BUFFER
zle -R -c
}
zle -N peco_select_rake_task_all