diff --git a/snippets/aws.fish b/snippets/aws.fish index 6f0eb1d..231e4d9 100644 --- a/snippets/aws.fish +++ b/snippets/aws.fish @@ -42,6 +42,9 @@ alias aws-ssm-gitlabAutoscalingManager-ita-b "aws ec2 describe-instances --outpu aws s3 rm 's3://bucket-name/prefix' --recursive --dry-run aws s3 cp 's3://my-first-bucket/test.txt' 's3://my-other-bucket/' +aws s3api list-objects-v2 --bucket 'backup' +aws s3api list-objects-v2 --bucket 'backup' --query "Contents[?LastModified>='2022-01-05T08:05:37+00:00'].Key" + aws ecs list-tasks --cluster 'testCluster' --family 'testService' --output 'text' --query 'taskArns' \ | xargs -p aws ecs wait tasks-running --cluster 'testCluster' --tasks while [[ $$(aws ecs list-tasks --query 'taskArns' --output 'text' --cluster 'testCluster' --service-name 'testService') == "" ]]; do sleep 1; done diff --git a/snippets/git.sh b/snippets/git.sh index 8e2090d..82758aa 100644 --- a/snippets/git.sh +++ b/snippets/git.sh @@ -66,3 +66,12 @@ git symbolic-ref 'refs/remotes/origin/HEAD' 'refs/remotes/origin/main' # delete the master branch on the remote git push origin --delete 'master' + + +# create patches from the last commit +git format-patch -n HEAD^ +git format-patch HEAD^ -o './patchfile.patch' +git format-patch HEAD~1 --stdout + +# create patches from specific commits +git format-patch -1 '3918a1d036e74d47a5c830e4bbabba6f507162b1' diff --git a/snippets/postgresql.sql b/snippets/postgresql.sql index 2fb5262..8930824 100644 --- a/snippets/postgresql.sql +++ b/snippets/postgresql.sql @@ -11,6 +11,9 @@ help \? +-- Show PostgreSQL version +SELECT version(); + -- Show connection information \conninfo @@ -117,6 +120,9 @@ SELECT rolpassword from pg_authid where rolname = 'admin'; SELECT * FROM pg_extension; SELECT extname FROM pg_extension; +-- Show extensions versions +SELECT postgis_version(), postgis_full_version(), postgis_lib_version(); + -- Add extensions CREATE EXTENSION pg_transport; CREATE EXTENSION IF NOT EXISTS pgaudit; diff --git a/snippets/pulumi/commands.fish b/snippets/pulumi/commands.fish index 1415ff9..c5806d2 100644 --- a/snippets/pulumi/commands.fish +++ b/snippets/pulumi/commands.fish @@ -10,7 +10,6 @@ pulumi preview --json | jq -r '.steps[]|select(.op=="delete").oldState.id' - # Remove from the state all resources that would be deleted pulumi preview --json | jq -r '.steps[]|select(.op=="delete").urn' - | xargs -n1 pulumi state delete --force - pulumi config set 'boincAcctMgrUrl' 'https://bam.boincstats.com' pulumi config set --secret 'boincGuiRpcPasswd' 'something-something-darkside' pulumi config set --path 'outer.inner' 'value' @@ -21,21 +20,19 @@ pulumi config set --path 'list[1]' 'value' pulumi config set 'gitlab:baseUrl' 'https://private.gitlab.server/api/v4/' pulumi config set 'gitlab:token' 'glpat-m-Va…zy' --secret - pulumi config get 'boincAcctMgrUrl' pulumi config get 'boincGuiRpcPasswd' pulumi config get --path outer.inner pulumi config get --path 'list[1]' - pulumi plugin ls --project pulumi plugin install - pulumi state unprotect 'urn:pulumi:dev::custom-images::aws:imagebuilder/infrastructureConfiguration:InfrastructureConfiguration::server-baseline' pulumi state delete 'urn:pulumi:dev::custom-images::aws:imagebuilder/infrastructureConfiguration:InfrastructureConfiguration::server-baseline' pulumi state rename -y 'urn:pulumi:dev::custom-images::aws:imagebuilder/imageRecipe:ImageRecipe::baselineServerImage-1.0.8' 'serverBaseline-1.0.8' - find . -type f -name 'Pulumi.yaml' -not -path "*/node_modules/*" -exec dirname {} + | xargs -pn '1' pulumi preview --parallel "$(nproc)" --cwd find . -type f -name 'Pulumi.yaml' -not -path "*/node_modules/*" -exec dirname {} + | xargs -pn '1' pulumi refresh --parallel "$(nproc)" -s 'dev' --non-interactive -v '3' --cwd + +pulumi import --generate-code='false' 'aws:iam/user:User' 'jimmy' 'jimmy'