Skip to content

Instantly share code, notes, and snippets.

@Steell
Steell / gist:20587482a7a357b91a8a8b0cb4618b47
Created June 26, 2019 18:04
roon-server.nix w/ autoPatchelfHook errors
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) Sooloos.RAAT.RAAT__manager_new (intptr,string,string,string,string,string,string,string,string,bool,Sooloos.RC/RC__LogEntryCallback,intptr,intptr&) [0x0008c] in <8b803de83c154b62b67879ab6e7cc8cf>:0
at Sooloos.RAATServerApp.ev_go () [0x001d4] in <8b803de83c154b62b67879ab6e7cc8cf>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x0001f] in <370a0c27f4b74d1a81431037df6d75bf>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00073] in <370a0c27f4b74d1a81431037df6d75bf>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00004] in <370a0c27f4b74d1a81431037df6d75bf>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002f] in <370a0c27f4b74d1a81431037df6d75bf>:0
at System.Threading.Thread
@Steell
Steell / manual-patchElf-in-preFixup.txt
Last active June 27, 2019 13:56
roon-server ldd debugging
result/opt/check.sh
not a dynamic executable
result/opt/RoonMono/lib/libMonoSupportW.so
linux-vdso.so.1 (0x00007fff2a3e5000)
libm.so.6 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/libm.so.6 (0x00007f1b20568000)
librt.so.1 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/librt.so.1 (0x00007f1b20360000)
libdl.so.2 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/libdl.so.2 (0x00007f1b2015c000)
libpthread.so.0 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/libpthread.so.0 (0x00007f1b1ff3d000)
libc.so.6 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/libc.so.6 (0x00007f1b1fb89000)
/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f1b20b27000)
@Steell
Steell / foo.nix
Last active September 28, 2018 19:12
Haskell + Nix testing
# shell.nix
let
releaseDrv = import ./release.nix;
cabal = releaseDrv.haskellPackages.cabal;
in
releaseDrv
.haskell-nix-sandbox
.env
.overrideAttrs (drv: {
@Steell
Steell / butt-injection.php
Last active June 21, 2018 21:22
"Dependency" injection
class Butt {
interface DBAdapter {
public function insertFinger($force);
public function feel();
}
function __construct($dbAdapter) {
$db = $dbAdapter;
}
class Butt {
interface ButtDBAdapter {
public function insertFinger($force);
public function feel();
}
function __construct($dbAdapter) {
$db = $dbAdapter;
}
@Steell
Steell / default.nix
Created May 21, 2018 02:50
open-zwave src override
let
pkgs = import <nixpkgs> {};
gitHub = pkgs.fetchFromGitHub;
in
with pkgs;
openzwave.overrideAttrs (oldAttrs: {
src = gitHub {
owner = "Steell";
repo = "open-zwave";
@Steell
Steell / readerlens.hs
Last active June 21, 2017 21:56
MonadReader + Lens
data Foo a = Foo { _unFoo :: a }
makeLenses ''Foo
newtype Newline = Newline { unNewline :: String }
instance Monoid Newline where
mempty = Newline []
mappend (Newline []) b = b
mappend a (Newline []) = a
mappend (Newline a) (Newline b) = Newline $ a `mappend` "\n" `mappend` b
data PlayerInfo c = PlayerInfo { _playerName :: String
, _playerAttack :: forall m. c m => m ()
}
data AttackInfo a = AttackInfo { _infoAttacker :: PlayerInfo a
, _infoTarget :: PlayerInfo a
}
data GameInfo a = GameInfo { _gamePlayer1 :: PlayerInfo a
, _gamePlayer2 :: PlayerInfo a
}
@Steell
Steell / mtl-recursive.hs
Last active September 28, 2016 20:55
Why doesn't this typecheck?
import Control.Monad.Reader
data Foo m = Foo { action :: m Int }
runFoo :: (MonadReader (Foo m) m) => m Int
runFoo = ask >>= action
bar :: IO Int
bar = runReaderT runFoo (Foo readLn)
@Steell
Steell / zoom.hs
Created September 27, 2016 18:01
Generic lens zoom for MonadState
module Zoom where
import Control.Lens
import Control.Lens.Internal.Zoom
import Control.Monad.State
zoom' :: MonadState t m => LensLike' (Focusing m b) t s -> StateT s m b -> m b
zoom' l st = do
(a, s) <- get >>= runStateT (zoom l st)
put s