Skip to content

Instantly share code, notes, and snippets.

View bartman's full-sized avatar
🤓
🏋️‍♂️🥩☕💻ⓒ🦀

Bart Trojanowski bartman

🤓
🏋️‍♂️🥩☕💻ⓒ🦀
View GitHub Profile
@bartman
bartman / config_nvim_init.vim
Last active January 28, 2024 03:15
neovim config
" this file goes in ~/.config/nvim/init.vim
" you will also need to install vim-plug in ~/.local/share/nvim/site/autoload/plug.vim
" see https://github.com/junegunn/vim-plug?tab=readme-ov-file#unix-linux
" on first run, use :PlugInstall to download all packages
" then reload config with ,so (or restart nvim)
syntax on
filetype plugin indent on
"let mapleader = ','
@bartman
bartman / shell.cpp
Last active January 9, 2023 20:25
run C file as a script, complied with any compiler
#!/bin/bash
#if 0
set -e
src=$0
tmp=/tmp/$$.cpp
exe=/tmp/$$
sed -e 1d < $src > $tmp
trap "rm -f $tmp $exe" EXIT
( set -x ; g++ -o $exe $tmp )
$exe "$@"
@bartman
bartman / mktags
Last active January 23, 2023 13:30
mktags
#!/usr/bin/make -f
#
# This is a script that bilds ctags/csope files.
#
# By default, it will build indexes in the current directory:
#
# mktags
#
# You can invoke it to build different subdirectories:
#
@bartman
bartman / cleanup-boot
Created February 11, 2021 13:26
cleanup-boot
#!/bin/bash
# this script will remove any stale kernel- and kernel-headers- packages
# it will keep the current (uname -r) and latest kernel package and its headers
SUDO=sudo
while [ -n "$1" ] ; do
case "$1" in
-h) echo "${0##*/} [ -h ] [ -n ]" ; exit 0 ;;
-n) SUDO=echo ;;
@bartman
bartman / kill-big-chrome-renderers.py
Created September 13, 2020 14:07
kill-big-chrome-renderers.py
#!/usr/bin/env python3
# https://superuser.com/questions/413349/limiting-use-of-ram-in-chrome
import sys, os, psutil
limit = 200 #default 200MB
if len(sys.argv) == 2:
try:
limit = int(sys.argv[1])
except:
$ cat ~/.gdbinit
# GEF
# https://gef.readthedocs.io/en/master/
#
# https://github.com/hugsy/gef
# Voltron
# https://github.com/snare/voltron
#
# git clone https://github.com/snare/voltron
@bartman
bartman / watch-cgroup-memory-usage
Last active November 17, 2021 15:19
watch-cgroup-memory-usage
#!/bin/bash
#
# watch cgroup 'browsers' memory activity
#
# best served with ...
#
# https://gist.github.com/jakewarren/477ecd1149abe908cbd5cf7a7c9abaa3
self=$0
SUDO=
@bartman
bartman / .zsh_func_tmux0
Last active October 14, 2022 18:23
tmuxify
#!/bin/zsh
#autoload -U
#vim: set ft=zsh
local use_exec=false
local base=${0##*/}
local sname=${base#tmux}
function err() { print -P >&2 - "%B%F{red}$@" ; }

Keybase proof

I hereby claim:

  • I am bartman on github.
  • I am bartman (https://keybase.io/bartman) on keybase.
  • I have a public key ASBIrHW2ndQDGlTFhnp9hFSCrN8t61PiRTZ6oBU2S1MJ3wo

To claim this, I am signing this object: