Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathieu Arnold mat813

View GitHub Profile
@mat813
mat813 / ripe.rb
Last active May 30, 2017
OpenDNSSEC to RIPE
View ripe.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# ods-ksmutil key export --keystate ready -t KSK --all | ruby ripe.rb ready
# ods-ksmutil key export --keystate retire -t KSK --all | ruby ripe.rb retire
require 'pp'
require 'rubygems'
require 'dnsruby'
require 'net/smtp'
View freebsd_update.aug
(*
Module: FreeBSD Update
parses /etc/freebsd-update.conf
Author: Mathieu Arnold <mat@FreeBSD.org>
About: Reference
This lens tries to keep as close as possible to `man 5 freebsd-update.conf`.
An online source being :
http://www.freebsd.org/cgi/man.cgi?query=freebsd-update.conf&sektion=5
View .gitignore
*.conf
*.dot
*.png
@mat813
mat813 / gen_ds.rb
Last active May 30, 2017
OpenDNSSEC rollover helper
View gen_ds.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# ods-ksmutil key export --keystate XXX -t KSK --all | ruby gen_ds.rb
require 'pp'
require 'rubygems'
require 'dnsruby'
module Dnsruby
@mat813
mat813 / afnic.rb
Last active May 30, 2017
OpenDNSSEC to AFNIC
View afnic.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# ods-ksmutil key export --keystate ready -t KSK --all | ruby afnic.rb ready
# ods-ksmutil key export --keystate retire -t KSK --all | ruby afnic.rb retire
require 'pp'
require 'rubygems'
require 'dnsruby'
require 'epp-client/afnic'
@mat813
mat813 / gandi.rb
Last active Feb 28, 2019
OpenDNSSEC to Gandi
View gandi.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# ods-ksmutil key export --keystate ready -t KSK --all | ruby gandi.rb ready
# ods-ksmutil key export --keystate retire -t KSK --all | ruby gandi.rb retire
require 'pp'
require 'rubygems'
require 'dnsruby'
require 'xmlrpc/client'
@mat813
mat813 / fb-update.vcl
Last active Mar 23, 2017
Varnish configuration for freebsd-update proxy
View fb-update.vcl
vcl 4.0;
import std;
import directors;
import saintmode;
# dig +noall +answer +short srv _http._tcp.update.freebsd.org | sort -k 2,2nr | while read priority weight port target; do printf "backend %s {\n\t.host = \"%s\";\n\t.port = \"80\";\n}\n" ${target//.*} $target; done
backend update5 {
.host = "update5.freebsd.org.";
.port = "80";
}
backend update6 {
@mat813
mat813 / bind_conf.treetop
Created Apr 24, 2012
simple named.conf parsing
View bind_conf.treetop
require 'ip'
grammar BindConf
include IP
rule entries
(zone / key / server)* {
%w(zone key server).each do |i|
module_eval <<-eot, __FILE__, __LINE__+1
def each_#{i}(&block)
@mat813
mat813 / diag.rb
Created Mar 1, 2012
taille écran / résolution / pixels
View diag.rb
def diag(seize,neuf,inch,pixels)
ratio = (seize**2+neuf**2)**0.5
cms = inch*2.54
taille = [seize, neuf].map {|v| (v*cms/ratio).round(2)}
taille << (taille[0]/pixels*10).round(4)
taille << pixels*neuf/seize
return taille
end
@mat813
mat813 / named.aug
Created Jul 5, 2011
Bind's config augias lense (WIP)
View named.aug
(*
Module: Named
parses /etc/namedb/named.conf
Author: Mathieu Arnold <mat@FreeBSD.org>
About: Reference
This lens tries to keep as close as possible to the bind documentation where
possible. An online source being :
http://www.freebsd.org/cgi/man.cgi?query=syslog.conf&sektion=5