Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gobenji's full-sized avatar

Benjamin Poirier gobenji

  • Montreal/Canada
View GitHub Profile
@gobenji
gobenji / 10mail.sh
Created February 11, 2022 00:53
Modified /etc/smartmontools/run.d/10mail to workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900244
#!/bin/bash -e
# Send mail if /usr/bin/mail exists
if ! [ -x /usr/bin/mail ]; then
echo "Your system does not have /usr/bin/mail. Install the mailx or mailutils package"
exit 1
fi
# workaround debian bug 900244
if [[ $SMARTD_MESSAGE == "Device: /dev/nvme1, number of Error Log entries increased from"* ]] && \
diff --git a/src/content/actions/operation.js b/src/content/actions/operation.js
index 767f14b..d655170 100644
--- a/src/content/actions/operation.js
+++ b/src/content/actions/operation.js
@@ -54,6 +54,10 @@ const exec = (operation) => {
return navigates.parent(window);
case operations.NAVIGATE_ROOT:
return navigates.root(window);
+ case operations.NAVIGATE_URL:
+ return navigates.url(window, operation.url);
@gobenji
gobenji / ggblame.vim
Created February 25, 2015 09:11
vim command to launch `git gui blame` on the current file and position
function LaunchGGBlame()
let cmd = printf("git gui blame --line=%d %s &", line("."), shellescape(bufname("")))
let output = system(cmd)
if v:shell_error != 0
let msg = printf("Error running '%s': %s", cmd, output)
echohl WarningMsg | echon msg | echohl None
return
endif
endfunction
command GGBlame call LaunchGGBlame()
@gobenji
gobenji / gist:5316003
Last active December 15, 2015 20:08
Paste the content of tmux buffers within vim without having to put vim into Paste mode
function TmuxPaste(buffer)
if ! a:buffer
let buffer = "0"
else
let buffer = a:buffer
endif
let tmpfile = tempname()
let cmd = printf("tmux save-buffer -b %s %s", shellescape(buffer), shellescape(tmpfile))
let output = system(cmd)
if v:shell_error != 0
@gobenji
gobenji / wrapper.c
Created April 6, 2011 13:03
A wrapper around mprotect(2)
/*
* benjamin.poirier@gmail.com
*
* A wrapper around mprotect(2)
* build with:
* cc -Wall -g -ldl wrapper.c -shared -fPIC -o wrapper.so
*
* run with:
* LD_PRELOAD=./somepath/wrapper.so ./otherprogram
*