Skip to content

Instantly share code, notes, and snippets.

View m0ar's full-sized avatar

Edvard Hübinette m0ar

View GitHub Profile
== Info: Trying 5.178.76.99:443...
== Info: Connected to frontend.bredbandskollen.se (5.178.76.99) port 443 (#0)
== Info: ALPN: offers h2
== Info: ALPN: offers http/1.1
== Info: CAfile: /etc/ssl/certs/ca-certificates.crt
== Info: CApath: none
== Info: TLSv1.0 (OUT), TLS header, Certificate Status (22):
=> Send SSL data, 5 bytes (0x5)
0000: 16 03 01 02 00 .....
== Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
@m0ar
m0ar / flake.nix
Created September 19, 2022 18:02
Basic flake for a `home-manager` setup
description = "Home-manager configuration";
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
query MyQuery {
allVatInits {
totalCount
nodes {
rawIlkByIlkId {
identifier
}
headerByHeaderId {
blockNumber
blockTimestamp
pi@evl-geth:~/go-ethereum $ geth --verbosity 5 --syncmode fast --cache 256 --datadir /mnt/ssd/ethereum
DEBUG[10-21|14:53:24.978] Sanitizing Go's GC trigger percent=100
INFO [10-21|14:53:24.981] Maximum peer count ETH=50 LES=0 total=50
INFO [10-21|14:53:24.982] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
DEBUG[10-21|14:53:24.982] FS scan times list=91.405µs set=2.741µs diff=4µs
TRACE[10-21|14:53:24.982] Started watching keystore folder path=/mnt/ssd/ethereum/keystore
INFO [10-21|14:53:24.986] Starting peer-to-peer node instance=Geth/v1.9.6-stable-bd059680/linux-arm/go1.13
INFO [10-21|14:53:24.986] Allocated trie memory caches clean=64.00MiB dirty=64.00MiB
INFO [10-21|14:53:24.986] Allocated cache and file handles database=/mnt/ssd/ethereum/geth/chaindata cache=128.00MiB handles=524288
DEBUG[10-21|14:53:26.418] Chain freezer table opened
-- Funkar ej
bindpat '<-' exp maybeweight {% (ams (sLL $1 $> $ mkBindStmt $1 $3)
[mu AnnLarrow $2]) >>= aw $4 }
-- Funkar
bindpat '<-' exp maybeweight {% (ams (sLL $1 $3 $ mkBindStmt $1 $3)
[mu AnnLarrow $2]) >>= aw $4 }
@m0ar
m0ar / Parser.hs
Created April 10, 2018 09:42
I want to do some kind of book-keeping in sequence after ams does its, but I cannot grasp the error.
qual :: { LStmt GhcPs (LHsExpr GhcPs) }
: bindpat '<-' exp maybeweight {% (ams (sLL $1 $> $ mkBindStmt $1 $3)
[mu AnnLarrow $2]) >>= aw $4 }
-- ^ Would like to apply the returned value from ams (sLL $1 $> [...]) to aw (see below)
-- Fails with error (see below)
| exp maybeweight {% aw $2 (sL1 $1 $ mkBodyStmt $1)
-- ^ This is fine!
-- aw adds the found weight to the parser state, same style as ams
@m0ar
m0ar / Parser.hs
Created April 9, 2018 08:24
Would like to do something like this in the parser
maybeweight :: { Maybe Weight }
: {- empty -} { Nothing }
| '{-# WEIGHT' INTEGER '#-}' { Just (Weight $ getINTEGER $2)
{- Error:
compiler/stage1/build/Parser.hs:9945:34: error:
• Couldn't match expected type ‘Integer’
with actual type ‘IntegralLit’
• In the second argument of ‘($)’, namely ‘getINTEGER happy_var_2’
In the first argument of ‘Just’, namely
@m0ar
m0ar / gist:d7ec1719a26c9e4b24af1a0a9ce43e20
Created March 1, 2018 08:28
Wonky wg-quick behaviour
br0d at archvard in ~
λ wg-quick up mullvad-se1
wg-quick must be run as root. Please enter the password for br0d to continue:
[#] ip link add mullvad-se1 type wireguard
[#] wg setconf mullvad-se1 /dev/fd/63
[#] ip address add 10.99.5.77/32 dev mullvad-se1
[#] ip address add fc00:bbbb:bbbb:bb01::54d/128 dev mullvad-se1
[#] ip link set mtu 1270 dev mullvad-se1
[#] ip link set mullvad-se1 up
[#] resolvconf -a tun.mullvad-se1 -m 0 -x
-- Test.hs
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE BangPatterns #-}
module Test (mainTest) where
import Weights (Weight(..))
{-# ANN mainTest (Weight 2) #-}
mainTest :: IO ()