- VirtualBox
- Vagrant
- Packer
- a Mac with a lot of Memory/CPU/Disk
- great Templates/Tools from https://github.com/timsutton/osx-vm-templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; // ¯\\_(ツ)_/¯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); | |
############################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'chef-api' | |
require 'fauxhai' | |
include ChefAPI::Resource | |
ChefAPI.configure do |config| | |
config.endpoint = 'http://HOSTNAME:4545' | |
config.client = 'admin' |
- 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
- Boot into any recovery system like Grml
- If not already done: install CoreOS
Why not? I thought it'd be interesting, and maybe useful.
- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder