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
#!/bin/sh | |
mkdir -p $HOME/tofuutils/tenv | |
# wget https://github.com/tofuutils/tenv/releases/download/v1.2.0/tenv_v1.2.0_Linux_x86_64.tar.gz | |
tar -xvf tenv_v1.2.0* -C $HOME/tofuutils/tenv | |
for f in $HOME/tofuutils/tenv/{tenv,terraform,tofu,tf} | |
do | |
ln -s $HOME/$f $HOME/.local/bin/$(basename $f) | |
done |
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
#!/bin/sh | |
URL=${1:-https://releases.hashicorp.com/terraform-ls/0.32.7/terraform-ls_0.32.7_linux_amd64.zip} | |
wget -qO- $URL | bsdtar -xvf- |
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
#!/bin/sh | |
# From intro-video https://www.youtube.com/watch?v=Ng1YPjveaWg&t=1010s | |
# https://github.com/nvm-sh/nvm#installing-and-updating | |
nvm install v18.16.1 -- node | |
nvm install v18.16.1 -- npm | |
npm install -g purescript purescript-psa spago pscid |
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
#!/bin/sh | |
# ======================================================================== | |
# | |
# This is requires since we always assume a ROLE inside Terraform(go-sdk), | |
# BUT when we RETURN to shell we have a different IDENTITY. | |
# This shell IDENTITY must again assume the same "inside-TF ROLE" to | |
# be successful in using aws-cli | |
# | |
# ========================================================================= |
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
#!/bin/sh | |
# improved some of guide: | |
# https://aws.amazon.com/premiumsupport/knowledge-center/troubleshoot-iam-permission-errors/ | |
usage() { | |
echo >&2 "Usage: $0 <[email protected]|user_id> [hours_back]" | |
exit 1 | |
} |
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
#!/bin/sh | |
# Make sure you have a PRIVATE_TOKEN in the file ~/.gitlab_token | |
GL_TOKEN=$(cat ~/.gitlab_token) | |
[ -z $GL_TOKEN ] && (printf "\n\nno token!\n\n\n";exit 1) | |
# USERID from username ARG1 on command-line | |
USER_NAME=${1:-kjetil.midtlie} | |
USERID=$(curl "https://gitlab.com/api/v4/users?private_token=$GL_TOKEN&username=$USER_NAME" | jq -r '.[0]|.id') |
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
# bonus: sexy logfile ;) | |
sudo su | |
printf "#\!/usr/bin/env sh\n(date;docker rmi \$(docker images -q);echo +++++;) \ | |
>> /var/log/docker_rmi_cron.log 2>&1\n" > /etc/cron.weekly/docker-rmi | |
chmod +x /etc/cron.weekly/docker-rmi |
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
# Switch to the master(or dev) branch and make sure you are up to date. | |
# Taken from http://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit | |
# =================================================================================================== | |
# ------ basically ggpull 1st; | |
git checkout dev | |
git fetch upstream # eller `git fetch origin` HVIS gatekeeper | |
git merge upstream/dev # eller `git pull` HVIS gatekeeper | |
# start here ; |
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
#!/bin/sh | |
#function for yo .bashrc/.zshrc | |
inotify_delay_cmd() { | |
while true; do | |
inotifywait -r -e create -e delete -e modify --exclude '^\./\..+' . | |
"$@" | |
done | |
} |
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
alias steal_site='wget --mirror --convert-links --adjust-extension --page-requisites --no-parent' |
NewerOlder