Click on the raw button to install.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import urllib.parse | |
GITLAB_AUTH_TOKEN = '' | |
GROUP_ID = '' | |
headers = {"PRIVATE-TOKEN": GITLAB_AUTH_TOKEN} | |
r = requests.get( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vault-edit --argument key | |
set file (mktemp --suffix=.json) | |
vault read -format=json $key | jq '.data' > $file | |
$EDITOR $file | |
vault write $key @$file | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Selects and connects to a vpn | |
# Put .ovpn files in ~/vpn | |
function vpn --description 'Connect to vpn' | |
# Change to your prefered browser | |
set browser firefox | |
sudo -v | |
set ovpn ~/vpn/(ls ~/vpn/*.ovpn | tr '/' '.' | cut -d '.' -f 5 | fzf).ovpn | |
if test -e {$ovpn}.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function youtube -d 'Download partial youtube videos' -a url start duration out | |
set mp4 (youtube-dl -g -f 22 $url) | |
set -q out; or set out 'out.mp4' | |
ffmpeg -ss $start -i $mp4 -t $duration -c copy $out | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function watchlive --description 'Watch youtube live stream' --argument url mode | |
set url (string match -r 'v=[^&]+' $url) | |
google-chrome --new-window "--app=https://www.youtube.com/live_chat?is_popout=1&$url" & | |
set prefix streamlink --retry-streams 5 | |
set suffix "https://www.youtube.com/watch?$url" | |
if [ "$mode" = 'audio' ] | |
# 144p & 240p: AAC-HEv2 2ch 48Khz 48Kbps | |
# 360p & 480p: AAC-LC 2ch 48Khz 128Kbps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function update-terraform --description 'Updates terraform to the latest version' | |
set -l base 'https://releases.hashicorp.com/terraform' | |
set -l ver (curl -s $base/ | grep '<a href="/terraform/' | head -n1 | cut -d'/' -f 3) | |
set -l tmpdir (mktemp -d) | |
wget -O $tmpdir/tf.zip $base/$ver/terraform_"$ver"_linux_amd64.zip | |
unzip $tmpdir/tf.zip -d $tmpdir | |
install $tmpdir/terraform (which terraform) | |
terraform version | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
listA = [1, 2, 3, 4] | |
listB = [2, 3, 4, 5] | |
} | |
provider "local" {} | |
resource "local_file" "name" { | |
content = "${join(" ", distinct(concat(local.listA, local.listB)))}" | |
filename = "myfile.txt" |
I hereby claim:
- I am anakaiti on github.
- I am anakaiti (https://keybase.io/anakaiti) on keybase.
- I have a public key whose fingerprint is DA93 398B AB18 0D5B AF6B 219D C914 6C79 851E 5FD1
To claim this, I am signing this object:
NewerOlder