Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Nothing

Matthias Beyer matthiasbeyer

💭
Nothing
View GitHub Profile
@matthiasbeyer
matthiasbeyer / fcode
Created Mar 5, 2018
bash function to find code and open it
View fcode
fcode ()
{
[ "$#" -lt 1 ] && {
echo "Supply string to search for!";
return 1
};
printf -v search "%q" "$*";
local include="yml,js,json,php,md,html,config,py,cpp,c,go,hs,rb,conf,rs,txt";
local exclude=".config,.git,node_modules,vendor,build,yarn.lock,*.sty,*.bst,*.coffee,dist,*.aux,*.tmp";
rg_cmd='rg --column --line-number --no-heading --fixed-strings --ignore-case --follow --color always';
View gist:1b44d6ba04c7e0b0e7c035f70c87bdeb
optimizeForThisHost = pkg:
pkgs.lib.overrideDerivation pkg (old: {
CFLAGS = "${old.CFLAGS} -fPIC -O3 -march=native";
});
View kernel-panic
[ 2.142954] List of all partitions:
[ 2.143444] No filesystem could mount root, tried:
[ 2.144192] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 2.144247] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc8 #1
[ 2.144247] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 2.144247] 0000000000000000 ffffffff812f00af ffffffffffffff00 ffff88000750fea8
[ 2.144247] ffffffff8115c4d0 0000000000000010 ffff88000750feb8 ffff88000750fe50
[ 2.144247] ffff88000750fea8 ffff88000750fec0 0000000000000012 0000000000000001
[ 2.144247] Call Trace:
[ 2.144247] [<ffffffff812f00af>] ? dump_stack+0x5c/0x7d
@matthiasbeyer
matthiasbeyer / mass-update.sh
Created Apr 12, 2016
nix package update apply helper
View mass-update.sh
#!/usr/bin/env bash
EXEC=$(dirname ${BASH_SOURCE[0]})/nixpkgs-update-pkg.sh
if [[ ! -e $1 ]]; then
echo "Does not exist: $1"
echo "Exit."
exit 1
fi
@matthiasbeyer
matthiasbeyer / Makefile
Created Jan 8, 2016
codelistings error with pandoc-crossref
View Makefile
#
#
#
# Variables
#
#
#
DOCUMENT_CLASS=article
SETTING_FONTSIZE=11pt
@matthiasbeyer
matthiasbeyer / straceout
Created Jan 4, 2016
strace output of musescore on segfault
View straceout
read(10, "712//\t\tINTERNAL\t\tIBM12712\t\t1\nmod"..., 4096) = 2847
read(10, "", 4096) = 0
close(10) = 0
munmap(0x7feaad925000, 4096) = 0
futex(0x7feaa6c688d0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/etc/X11/egl/atiapfxxES.blb", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/X11/atiogl_perfcount.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
gettid() = 17783
gettid() = 17783
open("/etc/X11/atiogl.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
@matthiasbeyer
matthiasbeyer / razorlight.vim
Last active Nov 3, 2015
razorlight vim colorscheme
View razorlight.vim
"
" Version 1.0
" Author: Matthias Beyer <mail@beyermatthias.de>
" Date: 03-11-2015
" License: Public Domain
"
" ---
"
" Colorscheme for vim and neovim. Created mainly with vim.ink
"
View modulemod-1.rs
use runtime::Runtime;
use std::error::Error;
use std::fmt::Formatter;
use std::fmt::Result as FMTResult;
use std::fmt::Display;
use std::path::Path;
use std::result::Result;
use module::todo::TodoModule;
@matthiasbeyer
matthiasbeyer / dmenu.bash
Created Feb 8, 2015
dmenu-like bash script
View dmenu.bash
list=""
for p in $(echo $PATH | sed 's,:, ,g')
do
list="$list $(find $p -type f -o -type l -executable 2>/dev/null)"
done
currlist=$list
x=".*"
while read -n 1 y;
@matthiasbeyer
matthiasbeyer / configuration.nix
Created Jan 17, 2015
Nix config list ++ list attempt
View configuration.nix
# ... some things here ...
environment.systemPackages = let
basePkgs = import "${configDir}/pkgs/basePackages.nix" pkgs;
devPkgs = import "${configDir}/pkgs/devPackages.nix" pkgs;
desktopPkgs = import "${configDir}/pkgs/desktopPackages.nix" pkgs;
networkPkgs = import "${configDir}/pkgs/networkingPackages.nix" pkgs;
vim = import "${configDir}/pkgs/vim/default.nix" pkgs;
in
basePkgs ++ devPkgs ++ desktopPkgs ++ networkPkgs ++ vim;