Skip to content

Instantly share code, notes, and snippets.

View dmke's full-sized avatar

Dominik Menke dmke

View GitHub Profile
@dmke
dmke / main.rb
Last active August 23, 2021 10:50 — forked from coorasse/main.rb
CanCanCan Issue
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile do
source "https://rubygems.org"
gem "rails", "6.1.4.1"
@dmke
dmke / 00-README.md
Last active July 18, 2019 13:56
PowerDNS annotated SQLite queries

Annotated list of SQLite queries for PowerDNS 4.1+

To retrieve all queries known to PowerDNS, run something like

# pdns_server --no-config --launch=gsqlite3 --config | fgrep '# gsqlite3-'

Then go visit the [Generic SQL Backends][docs] documentation and find your query documentation (by removing the gsqlite3- prefix from the pdns_server output from above).

@dmke
dmke / 0_repro.sh
Last active May 28, 2018 06:09
OpenWRT/LEDE: toolchain build failure (gccgo for mipsel/soft-float)
#!/bin/sh
echo 2>&1 "this is just a sample, not intended for execution"
exit 1
cd $LEDE_ROOT
git checkout 20d3c118ae # latest commit in master at time of writing
cp $gist["config"] .config
make defconfig

Performing UDP tunneling through an SSH connection

Intro

The Swiss ISP [Bluewin][] sucks. Their DNS are often down. A friend even received advice from Bluewin technicians to not use their own DNS!... But then, it is quite hard to gain access to another DNS for free, if you don't have access to a co hosted machine.

In this document, we'll access another machine's network internal DNS services (UDP

@dmke
dmke / funky.go
Last active May 22, 2017 16:58
vscode-go #936
package main
var n = func() int { return 42 }()
var (
m = func() int { return 23 }()
o = getTruth()
)
func main() {
@dmke
dmke / README.md
Created November 17, 2016 14:58
mt7261 32M reset patch

"Frozen soft reset" on MT7261 SoCs with 32M flash

This hack is derived from [this mail][] by Paul Fertser on openwrt-devel.

  • When using 32M flash, the SPI bus needs to be reconfigured to use 4-byte addressing mode, instead of the usual (?) 3-byte mode.
  • Issueing a soft reset without this patch leaves the bus in 4-byte mode, which then crashes the system because the SoC tries (and fails) to communicate in 3-byte addressing mode.
  • Writing the opcodes brings the SPI back into 3-byte addressing mode,
@dmke
dmke / ac1200.dts
Created November 14, 2016 14:44
device tree sources (shortened)
#include zbt.dsti
&spi0 {
m25p80@0 {
partition@50000 {
reg = <0x50000 0x1fb0000>
};
};
};
@dmke
dmke / convert.sh
Created September 26, 2016 13:30
Convert unifi_sysvinit_all.deb to DIY.tar.gz
#!/bin/bash -e
self=$(readlink -f "$0")
root=$(dirname "$self")
version="$1"
checksum="$2"
if [ -z "$version" ]; then
echo >&2 "Missing version specifier."
@dmke
dmke / test-results-0.10.log
Created April 28, 2016 19:42
influxdb-ruby GH-141
influxdb-ruby: 0.3.0
influx server: 0.10.2
purging existing data...
generating data:
UNIT_000 : {:consumed_energy=>5.0, :frequency=>5.0, :power_factor=>5.0, :reactive_watts=>5.0, :rms_voltage=>5.0, :temperature=>5.0}
UNIT_001 : {:consumed_energy=>5.0, :frequency=>5.0, :power_factor=>5.0, :reactive_watts=>5.0, :rms_voltage=>5.0, :temperature=>5.0}
UNIT_002 : {:consumed_energy=>5.0, :frequency=>5.0, :power_factor=>5.0, :reactive_watts=>5.0, :rms_voltage=>5.0, :temperature=>5.0}
UNIT_003 : {:consumed_energy=>5.0, :frequency=>5.0, :power_factor=>5.0, :reactive_watts=>5.0, :rms_voltage=>5.0, :temperature=>5.0}
UNIT_004 : {:consumed_energy=>5.0, :frequency=>5.0, :power_factor=>5.0, :reactive_watts=>5.0, :rms_voltage=>5.0, :temperature=>5.0}