Skip to content

Instantly share code, notes, and snippets.

@benad
benad / conf.hjson
Last active September 14, 2021 16:05
~/.config/broot/conf.hjson
# Default: https://github.com/Canop/broot/blob/master/resources/default-conf.hjson
# Doc: https://dystroy.org/broot
{
show_selection_mark: true
verbs: [
{
invocation: edit
shortcut: e
execution: "$EDITOR +{line} {file}"
leave_broot: false
@benad
benad / 5_cputiny.sh
Last active April 19, 2020 21:17
Byobu Sample Custom Status Scripts
#!/bin/bash
#Place this file in ~/.byobu/bin/5_cputiny
TMP=$HOME/.byobu
cpu_last=($(head -n1 $TMP/cpulast))
cpu_last_sum=$(head -n1 $TMP/cpulastsum)
# Get the first line with aggregate of all CPUs
cpu_now=($(head -n1 /proc/stat))
@benad
benad / run_desktop.pl
Last active August 21, 2018 18:37
Run opendesktop.org-style *.desktop files (usually located under ~/.local/share/applications) from the command-line. This is only a bare-bones omplementation. Useful on a Mac. See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html .
#!/usr/bin/perl
use strict;
my $cmd;
my $path;
while (<>) {
if (/^Exec=(.*)/) {
$cmd = $1;
@benad
benad / jedit.sh
Created February 6, 2014 17:42
Run jEdit in Retina Display mode on Mac OS X when Oracle JDK 1.7.0_51 is installed
#!/bin/bash
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java -client -Xss2m -Xms32m -XX:PermSize=32m -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.java2d.noddraw=true -Dsun.java2d.dpiaware=true -Dsun.zip.disableMemoryMapping=true -jar /Applications/jEdit.app/Contents/Resources/Java/jedit.jar
@benad
benad / fetchlinks.py
Last active December 18, 2015 22:19
Small script that scapes into HTML your bookmarks on bitly.com