Skip to content

Instantly share code, notes, and snippets.

View bernd's full-sized avatar

Bernd Ahlers bernd

View GitHub Profile
@bernd
bernd / Bootable Mac ISO with Linux.md
Created October 3, 2023 08:33 — forked from coolaj86/Bootable Mac ISO with Linux.md
Create Bootable MacOS ISO from Apple's Free PKG

PWM fan control in Linux with a Gigabyte Aorus motherboard

  • install lm-sensors with your package manager

sensors

If it won't show any fan/speed, continue

sensor-detect

@bernd
bernd / whiteboardCleaner.md
Created October 26, 2015 09:59 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was
[url "https://github.com/"]
insteadOf = git://github.com/
insteadOf = git@github.com:
insteadOf = gh:
insteadOf = github:
[url "https://github.com/standard-analytics/"]
insteadOf = sa:
[url "https://git.apache.org/repos/asf/"]
insteadOf = apache:
[url "https://github.com/strmpnk/"]
@bernd
bernd / tar.rb
Created September 16, 2013 16:45 — forked from sinisterchipmunk/LICENSE
require 'rubygems'
require 'rubygems/package'
require 'zlib'
require 'fileutils'
module Util
module Tar
# Creates a tar file in memory recursively
# from the given path.
#
@bernd
bernd / jruby-startup-tuning.txt
Created September 5, 2013 14:19 — forked from BanzaiMan/gist:6450251
JRuby startup tuning (TieredCompilation)
$ jruby -v
jruby 1.7.5.dev (1.9.3p392) 2013-09-04 090d5dd on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [darwin-x86_64]
$ time jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 'require "rails"'
jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 5.18s user 0.47s system 136% cpu 4.142 total
$ time jruby -e 'require "rails"'
jruby -e 'require "rails"' 14.60s user 0.44s system 202% cpu 7.444 total
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'net/http'
require 'net/https'
require 'optparse'
class CheckPuppetRunHealth
def self.run
@bernd
bernd / git-pull-request.md
Created March 25, 2013 09:15 — forked from piscisaureus/pr.md
Fetch pull request branches

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: