Skip to content

Instantly share code, notes, and snippets.


Christoph Haas Signum

View GitHub Profile
Signum / hackysolution.rb
Created February 20, 2023 19:58
Using Rack::Static in Hanami 2
View hackysolution.rb
# routes.rb:
get '/api', to: ->(env) { [200, {}, ["A Rack compatible response"]] }
get '/*path', to:"frontend/build")
# lib/imc/staticserve.rb:
View dhclient 6
root@nb-chaas:~# rm /var/lib/dhcp/dhclient6.leases
rm: cannot remove '/var/lib/dhcp/dhclient6.leases': No such file or directory
root@nb-chaas:~# dhclient -6 -d wlan0
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit
Listening on Socket/wlan0
Sending on Socket/wlan0
View DHCPv6
11 2017-02-27 16:01:26.368948 fe80::1f46:734:bdb2:9665 ff02::1:2 DHCPv6 Solicit XID: 0x1ceb9d CID: 000100012046fbc5843a4b93a140 118
Frame 11: 118 bytes on wire (944 bits), 118 bytes captured (944 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Feb 27, 2017 16:01:26.368948000 CET
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1488207686.368948000 seconds
[Time delta from previous captured frame: 0.111790000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.964107000 seconds]
View dhcpd6.conf
root@gw:/var/dhcpd/etc # cat dhcpd
dhcpd.conf dhcpdv6.conf
root@gw:/var/dhcpd/etc # cat dhcpdv6.conf
option domain-name "";
option ldap-server code 95 = text;
option domain-search-list code 119 = text;
default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
View gist:7d4668f21e8a8a715b8b8caa9bd1b67d
$ LANG=C rdisc6 wlan0
Soliciting ff02::2 (ff02::2) on wlan0...
Hop limit : 64 ( 0x40)
Stateful address conf. : Yes
Stateful other conf. : Yes
Mobile home agent : No
Router preference : medium
Neighbor discovery proxy : No
Router lifetime : 1800 (0x00000708) seconds
View gist:e1a8a3732b26c30400e2
Failed to execute the [velocity] macro. Click on this message for Failed to evaluate Velocity Macro for content [#if ($xcontext.action == 'get')
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(
at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(
Signum / gist:7695611
Created November 28, 2013 17:36
Trying to get phrase suggest ("did you mean") queries working
View gist:7695611
Example document:
_index: debshots
_type: jdbc
_id: 15808
_version: 172
_source: {
description: Children's game based on the "memory" card game
name: lmemory
Signum / gist:5365778
Created April 11, 2013 18:12
Weird routing problem…
View gist:5365778
$ rake routes
domains GET /domains domains#index
POST /domains domains#create
new_domain GET /domains/new domains#new {:domain=>/[0-z\.\-]+/}
edit_domain GET /domains/:domain/edit domains#edit {:domain=>/[0-z\.\-]+/}
domain /domains/:domain(.:format) domains#show
PUT /domains/:domain domains#update {:domain=>/[0-z\.\-]+/}
DELETE /domains/:domain domains#destroy {:domain=>/[0-z\.\-]+/}
mailusers GET /domains/:domain/mailusers mailusers#index {:domain=>/[0-z\.\-]+/, :email=>/[0-z\.\-_@]+/}
POST /domains/:domain/mailusers mailusers#create {:domain=>/[0-z\.\-]+/, :email=>/[0-z\.\-_@]+/}
Signum / gist:5042728
Created February 26, 2013 22:08
DB creation
View gist:5042728
chaas@aldi:~/projekte/ror/ispmailadmin$ rake db:drop
chaas@aldi:~/projekte/ror/ispmailadmin$ rake db:setup
-- create_table("domains", {:force=>true})
-> 0.0603s
-- create_table("mailaliases", {:force=>true})
-> 0.0423s
-- create_table("mailusers", {:force=>true})
-> 0.0274s
-- initialize_schema_migrations_table()
-> 0.0586s
Signum / gist:5042709
Created February 26, 2013 22:06
First migration with different table name
View gist:5042709
class CreateMailusers < ActiveRecord::Migration
def change
create_table :virtual_users do |t|
t.string :email
t.string :password