This file contains hidden or 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
| # Resource null pour attendre que SSH soit disponible | |
| resource "null_resource" "wait_for_ssh" { | |
| count = local.settings.ec2.enabled ? 1 : 0 | |
| depends_on = [module.ec2] | |
| # Attendre que l'instance soit accessible via SSH | |
| provisioner "remote-exec" { | |
| inline = [ |
This file contains hidden or 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
| kubectl get namespace "stucked-namespace" -o json \ | |
| | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \ | |
| | kubectl replace --raw /api/v1/namespaces/stucked-namespace/finalize -f - |
This file contains hidden or 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
| get_latest_release() { | |
| curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
| grep '"tag_name":' | # Get tag line | |
| sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
| } | |
| # Usage | |
| # $ get_latest_release "creationix/nvm" | |
| # v0.31.4 |
This file contains hidden or 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 boto3 | |
| s3 = boto3.client( | |
| 's3', | |
| aws_access_key_id="", | |
| aws_secret_access_key="", | |
| endpoint_url = "https://oss.eu-west-0.prod-cloud-ocb.orange-business.com" | |
| ) | |
| # Retrieve the policy of the specified bucket |
This file contains hidden or 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
| # Add it in .zshrc or .bashrc | |
| function docker-destroy(){ | |
| docker rm -f $(docker ps -a -q) # Delete all containers | |
| docker rmi -f $(docker images -q) # Delete all images | |
| docker volume rm -f $(docker volume ls -f dangling=true -q) # Delete all volumes | |
| docker system prune # Clear unused docker ressources | |
| } | |
| # Récupère l'adresse ip des conteneurs. |
This file contains hidden or 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/bash | |
| : << 'COMMENT' | |
| ### - Get packages from internet (Optionnal) - ### | |
| Nerd Font - https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete%20Mono.ttf | |
| Dracula theme for iterm2 - color #84add4 - (Only MacOs) - curl https://github.com/dracula/iterm/archive/master.zip -o dracula.zip | |
| ### - Install Prerequisites - ### | |
| apt install -y git zsh nano wget | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| #################################################################################### | |
| # Slack Bash console script for sending messages. | |
| #################################################################################### | |
| # Installation | |
| # $ curl -s https://gist.github.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack | |
| # $ chmod +x /usr/bin/slack | |
| #################################################################################### | |
| # USAGE | |
| # Send message to slack channel/user |
This file contains hidden or 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/bash | |
| CONTAINER=$1 | |
| RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null) | |
| if [ $? -eq 1 ]; then | |
| echo "'$CONTAINER' does not exist." | |
| else | |
| /usr/bin/docker rm --force $CONTAINER | |
| fi |
This file contains hidden or 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
| print("connection to {0} {1}...".format(var0,var1)) |
This file contains hidden or 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/bash | |
| sed -i 's/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g' filename | |
| sed 's,http://www.find.com/page,http://www.replace.com/page,g' filename | |
| sed -i '$ s/line number//g' file |
NewerOlder