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
| perl -le '$pages=3; $start=7; $end=104; for $a (0..$end-$start) { push @even, $a+$start if $a % ($pages*2) < $pages; push @odd, $a+$start if $a % ($pages*2) >= $pages }; for $a (0..(length @even)-1) { print join ",", grep {defined} @even[(0+$a*$pages*10)..(($pages*10-1)+$a*$pages*10)]; }; print; for $a (0..(length @odd)-1) { print join ",", grep {defined} @odd[(0+$a*$pages*10)..(($pages*10-1)+$a*$pages*10)]; }' |
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
| ps -o pid,user,group|while read pid user group; do if [ $pid == 1 ]; then if [ $group -gt 0 ]; then addgroup -g $group debug; fi; if [ $user -gt 0 ]; then adduser -HD -u $user -G $group debug; fi fi; done | |
| su debug | |
| cd /proc/1/root |
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
| for i in ../freelens/*.tgz; do name=$(tar zxOf $i package/package.json | jq -r .name); echo " \"$name\": $i"; done |
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 | |
| # Check if the required argument (prefix) is passed | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <prefix>" | |
| exit 1 | |
| fi | |
| PREFIX=$1 |
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
| Host i-* mi-* | |
| User root | |
| ProxyCommand sh -c "instance=\$(echo %h | cut -d. -f1); profile=\$(echo %h | cut -d. -f2); profile=\${profile:-\$AWS_PROFILE}; region=\$(echo %h | cut -d. -f3); region=\${region:-\${AWS_REGION:-\$(aws configure get region --profile \${profile:-\$AWS_PROFILE})}}; aws ec2-instance-connect send-ssh-public-key --profile \${profile} --region \${region} --instance-id \${instance} --instance-os-user %r --ssh-public-key file://\${HOME}/.ssh/id_rsa.pub; aws ssm start-session --profile \${profile} --region \${region} --target \${instance} --document-name AWS-StartSSHSession --parameters 'portNumber=%p'" | |
| ServerAliveInterval 60 |
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 | |
| _list=($(kubectl get --raw / |grep "^ \"/api"|sed 's/[",]//g')); | |
| echo -e "GROUP\011RESOURCE" | |
| for _api in ${_list[@]}; do | |
| _aruyo=$(kubectl get --raw ${_api} | jq .resources); | |
| if [ "x${_aruyo}" != "xnull" ]; then | |
| kubectl get --raw ${_api} | jq -r ".resources[].name" | xargs -n1 echo ${_api} | tr ' ' '\011' | sort |
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
| { | |
| "description": "Mac OSX: Use Function Keys in Supported Apps, else use Media Keys", | |
| "manipulators": [ | |
| { | |
| "conditions": [ | |
| { | |
| "bundle_identifiers": [ | |
| "^com\\.microsoft\\.VSCode$", | |
| "^com\\.microsoft\\.VSCodeInsiders", | |
| "^com\\.jetbrains\\.goland$", |
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 pods --all-namespaces -o jsonpath="{range .items[?(@.spec.runtimeClassName)]}-n {.metadata.namespace} {.metadata.name}{'\n'}{end}" | xargs -n3 echo kubectl delete pod --wait=false | bash |
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 | |
| set -eu | |
| set -o pipefail | |
| shopt -s inherit_errexit | |
| if [[ $# -lt 4 ]]; then | |
| echo "Usage: $0 aws_profile_from aws_region_from aws_profile_to aws_region_to [shell patterns]" | |
| exit 99 | |
| 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
| #!/bin/bash | |
| set -euo pipefail | |
| shopt -s inherit_errexit 2>/dev/null || true | |
| prefix=${prefix:-} | |
| operation=${operation:-=} | |
| while true; do | |
| kubectl get node -L node.kubernetes.io/instance-type,eks.amazonaws.com/nodegroup,karpenter.sh/provisioner-name | |
NewerOlder