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N2I25XROSZIFLF6PT5AVZOAC
XZDJ2Z4M2MKWIDXN7EYBYQHGO7P5RSWPUGOQ3W2MHIUF55XQSXHQC
HEAGBPRACVPDTVXRYATVDAGJ2VLKECTNWXT4WWM2ZYJX7VA4PVJQC
MWV72ACT6D63U5I4UUNIO4WK7ZN3Q5WYRI72K3DCKCNWZ22QUR5AC
QRSG7RJSX5R255Y2HHTLYBXMBR374QS3PV2UJDWK2ZPMG7V66SSAC
TAHNZ4UZMQJ5SM5GGVXCSZNX2ZFA5MBPBEDZLBR3NPT6ECC5OEWQC
T7CTIGVFEE6SQAQTZ3PENHCH5RRFJ3EBWXGHVALXA7BSI4ZY2NUAC
GY6B4NDD7FQNTOOFR53SFU4RVX4CVFV6NG5S6ZQ2J37HFAZSFSBQC
ADHAOXXNVKFWHEYV77O74MZRNCUSS2A2AIHNPQT62EWX2AY4XH4AC
COUSBBHL5XPZC5KWCYFFAE554D4VFFO55QOD726ODWIRZGWOUSUAC
5KTOFVFDH2TUKNVY7VIL4GHFK7KPW5WDYMRU6EMI4276SF7CXBGQC
O64A6IJJGMWJYUDR6VUFGYFPWWPN222BEMMLFCMLKDEFO5OVRE4QC
BYGEHAR6KNZXJ2QWH5ASEB7SVDXTWANYRGHBPAO4FHBTBQJOGMRAC
{ pkgs, lib, ... }:
let
mycliConfig = {
};
home.packages = with pkgs; [
mycli
];
home.file.".myclirc".text = ''
# Generated by home-manager from nixpkgs.mycli in ~/dotfiles
# For a list of options see: https://www.mycli.net/config
}
'' + utils.mkINI mycliConfig;
};
in
{
general = {
smart_completion = true;
multi_line = true;
destructive_warning = true;
table_format = "ascii";
key_bindings = "vi";
wider_completion_menu = true;
less_chatty = true;
keyword_casing = "auto";
enable_pager = true;
utils = import ../utils pkgs;
# remove empty lines, leading and trailing whitespace
sed '/^$/d' | sed -e 's/^ *//' | sed -e 's/ *$//'
#! /usr/bin/env zsh
date +%Y-%m-%d
#! /usr/bin/env zsh
#! /usr/bin/env zsh
fn_kube_shell_context="$(choose-kube-context ${1-qa})"
kube-attach "$fn_kube_shell_context" "$(choose-kube-pod --context $fn_kube_shell_context)" ${@:2}
unset fn_kube_shell_context
#! /usr/bin/env zsh
# $1 context alias
# $2 pod name
# $3 optional command to execute defaults to a bash shell
# $4+ args to pass to $3
kubectl exec --stdin --tty \
--context "$1" \
"$2" \
-- "${3-/bin/bash}" "${@:4}"
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
#! /usr/bin/env zsh
git branch | fzf -m $@ | xargs git branch -D
#! /usr/bin/env zsh $
kubectl config get-contexts --no-headers \
| grep -e " ${1-.*} " \
| fzf -1 --header "Choose a kubectl context"\
| tr -s ' ' \
| cut -d ' ' -f 2
#! /usr/bin/env zsh
#! /usr/bin/env zsh
git branch &> /dev/null \
|| git branch --list \
&& git branch --list | grep -v '*' | fzf | xargs git checkout
{ pkgs }: with pkgs; {
video_compress = writeShellApplication {
name = "video_compress";
runtimeInputs = [ handbrake ];
text = ''
handbrake -i "$1" -o "$2" \
-e x264 \
-q 18 \
-a 1,1 \
-E faac,copy:ac3 \
-B 256,256 \
-6 dpl2,auto \
-R Auto,Auto \
-D 0.0,0.0 \
-f mp4 \
--detelecine \
--decomb \
--loose-anamorphic \
-m \
-x b-adapt=2:rc-lookahead=50
'';
};
extract = writeShellApplication {
name = "extract";
runtimeInputs = [ gnutar bzip2 unrar unzip p7zip gzip ];
text = ''
if [ -f "$1" ] ; then
case $1 in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.bz2) bzip2 "$1" ;;
*.rar) unrar e "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*) echo "Missing extraction handler. \"$1\" cannot be extracted via extract()" >&2; return 2 ;;
esac
else
echo "\"$1\" is not a valid file" >&2; return 1
fi
'';
};
rwhich = writeShellApplication {
name = "rwhich";
runtimeInputs = [ which ];
text = ''readlink -f "$(which "$1")"'';
};
ph_find = writeShellApplication {
name = "ph_find";
runtimeInputs = [
gnugrep
fzf
(callPackage ../passhole/passhole.nix { })
];
text = ''
ph show --field password "$(ph grep -i . | fzf)"
'';
};
trim = writeShellApplication {
name = "trim";
runtimeInputs = [ gnused ];
text = ''
sed '/^$/d' \
| sed -e 's/^ *//' \
| sed -e 's/ *$//'
'';
};
}
(writeShellScriptBin "video_compress" ''
${pkgs.handbrake}/bin/HandBrakeCLI -i "$1" -o "$2" -e x264 -q 18 -a 1,1 -E faac,copy:ac3 -B 256,256 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 --detelecine --decomb --loose-anamorphic -m -x b-adapt=2:rc-lookahead=50
'')
];
aliases = with pkgs; {
ch = let name = "git_alias_chbranch"; in
"!${writeShellApplication {
inherit name;
runtimeInputs = [ git gnugrep findutils fzf ];
text = ''
git branch --list \
| grep --invert-match --regexp '^* ' \
| fzf --exit-0 --select-1 \
| xargs git checkout
'';
}}/bin/${name}";
del = let name = "git_alias_delete_branches"; in
"!${writeShellApplication {
inherit name;
runtimeInputs = [git findutils fzf];
text = ''
git branch --list \
| grep --invert-match --regexp '^* ' \
| fzf --multi \
| xargs git branch -D
'';
}}/bin/${name}";
};