Skip to content

Instantly share code, notes, and snippets.

View korotin's full-sized avatar

Aleksei Korotin korotin

View GitHub Profile
@korotin
korotin / 10-ipset
Created May 16, 2019 11:23
ipset plugin for netfilter-persistent
#!/bin/sh
# Plugin for netfilter-persistent which makes ipset lists persistent.
#
# Make sure that you have netfilter-persitent and ipset installed,
# put this file in /usr/share/netfilter-persistent/plugins.d and make it executable.
set -e
rc=0
@korotin
korotin / fish_prompt.fish
Last active November 5, 2015 15:23
My fish prompt with system load, bg jobs count and current git branch name
function get_git_branch
set -g git_branch (git rev-parse --abbrev-ref HEAD ^ /dev/null)
if [ $status -ne 0 ]
set -ge git_branch
end
end
function get_system_load
set -g system_load (uptime | grep -oE 'average\: [[:digit:]]+\.[[:digit:]]+' | cut -d' ' -f2)
end