Skip to content

Instantly share code, notes, and snippets.

@gleber
gleber / 01_NixOS_Prefix_delegation_with_fixed_DUID.md
Last active April 20, 2019 13:34
Configuring ipv6 with dhcpcd using static DUID in NixOS 17.03 (e.g. on online.net servers)

I was trying to configure native ipv6 on my NixOS box, which is running in online.net's datacenters. They provide you a /48 or smaller subnet and a DUID which is used during DHCP. In dhcpcd vocabulary DUID is called clientid.

online.net's help page about IPv6 configuration was not very useful, since NixOS uses dhcpcd by default. The page which allowed me to make it all work was https://community.online.net/t/tutorial-ipv6-with-dhcpcd/3804

It looks like the only really required entries in networking.dhcpcd.extraConfig are interface and static though. I assumed that clientid is also necessary, but it looks like dhcpcd cares much more about content of /etc/dhcpcd.duid. Of course replace enp2s0 with the name of the main interface.

Keybase proof

I hereby claim:

  • I am gleber on github.
  • I am gleber (https://keybase.io/gleber) on keybase.
  • I have a public key whose fingerprint is 01BB 7ECD F093 F407 AD0C 5D1A 56C7 5D02 E9F0 4E6B

To claim this, I am signing this object:

import Language.Haskell.TH
f n m = do
nm1 <- newName "x"
let b = replicate (m - 1) WildP
a = replicate (n - m) WildP
return (LamE [TupP (b++[VarP nm1]++a)] (VarE nm1))
1> F1 = future:new(fun() -> timer:sleep(3000), 10 end).
{future,<0.36.0>,#Ref<0.0.0.1660>,undefined}
2> F2 = future:new(fun() -> timer:sleep(3000), 5 end).
{future,<0.39.0>,#Ref<0.0.0.2014>,undefined}
3> F2:get() * F1:get().
50
@gleber
gleber / dialyzer.mkf
Created September 6, 2012 17:35 — forked from ericbmerritt/dialyzer.mkf
Dialyzer Example Makefile
# -*- mode: Makefile; fill-column: 80; comment-column: 75; -*-
ERL = $(shell which erl)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
%% Analysis results:
{ analysis_options,
[{callers, false},
{sort, own},
{totals, true},
{details, false}]}.
% CNT ACC OWN
[{ totals, 6985519,124011.127,1236847.232}]. %%%
gleber@first:~/code/opensource$ git clone git@github.com:gleber/exat.git exat
Cloning into exat...
remote: Counting objects: 240, done.
remote: Compressing objects: 100% (148/148), done.
remote: Total 240 (delta 125), reused 202 (delta 87)
Receiving objects: 100% (240/240), 705.27 KiB | 172 KiB/s, done.
Resolving deltas: 100% (125/125), done.
gleber@first:~/code/opensource$ cd exat
gleber@first:~/code/opensource/exat$ make deps all
./rebar get-deps
[ 5471.899] [mi] EQ overflowing. The server is probably stuck in an infinite loop.
[ 5471.899]
Backtrace:
[ 5471.951] 0: /usr/bin/X (xorg_backtrace+0x37) [0x80a66f7]
[ 5471.951] 1: /usr/bin/X (mieqEnqueue+0x1d1) [0x80a06b1]
[ 5471.951] 2: /usr/bin/X (xf86PostMotionEventM+0xb0) [0x80c7e60]
[ 5471.951] 3: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x35ed) [0xb6d365ed]
[ 5471.951] 4: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x531d) [0xb6d3831d]
[ 5471.951] 5: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x5b85) [0xb6d38b85]
[ 5471.951] 6: /usr/bin/X (0x8048000+0x6cb81) [0x80b4b81]
websocket_handle_incoming_data(Data, #state{ws = WsState = #websocket_state{module = Mod, parser_state = WsParserState}, socket=Socket} = State) ->
WsCallback = fun handle_stream/2,
case Mod:handle_data(Data, WsParserState, {Socket, http}, State, WsCallback) of
{State2, websocket_close} ->
{stop, normal, State2};
{State2, websocket_close, CloseData} ->
State3 = websocket_send(CloseData, State2),
{stop, normal, State3};
{State2, continue, WsParsesState2} ->
inet:setopts(Socket, [{packet, raw}, {active, once}]),
@gleber
gleber / crasher.sh
Created November 21, 2011 19:51
dnssd_erlang segfault
while true; do
avahi-publish -s test@b _http._tcp 7778 &
sleep 3s
killall avahi-publish
sleep 1s
killall avahi-publish
done