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
From | |
https://utcc.utoronto.ca/~cks/space/blog/programming/BashGoodSetEReports | |
Suppose that you have a shell script that's not necessarily complex but is at least long. For reliability, you use 'set -e' so that the script will immediately stop on any unexpected errors from commands, and sometimes this happens. Since this isn't supposed to happen, it would be nice to print some useful information about what went wrong, such as where it happened, what the failing command's exit status was, and what the command was. The good news is that if you're willing to make your script specifically a Bash script, you can do this quite easily. | |
The Bash trick you need is: | |
trap 'echo "Exit status $? at line $LINENO from: $BASH_COMMAND"' ERR | |
This uses three Bash features: the special '$LINENO' and '$BASH_COMMAND' environment variables (which have the command executed just before the trap and the line number), and the special 'ERR' Bash 'trap' condition that causes your 'trap' statement to be invoked right when 'set -e' is c |
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
ffmpeg -i input.mov \ | |
-c:v libx264 -preset medium -crf 28 \ | |
-c:a aac -b:a 128k \ | |
output.mp4 | |
ffmpeg -i input.mov \ | |
-vf scale=1280:-2 \ | |
-c:v libx264 -preset medium -crf 28 \ | |
-an \ |
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
// THIS is the trick to have the same folder structure as in the archive you are modifying | |
mkdir -p siren-platform-demo-data-14.8.0-SNAPSHOT-darwin-x86_64/siren-investigate | |
unzip -p siren-platform-demo-data-14.8.0-20250513.083732-50-darwin-x86_64.zip 'siren-platform-demo-data-14.8.0-SNAPSHOT-darwin-x86_64/siren-investigate/package.json' > siren-platform-demo-data-14.8.0-SNAPSHOT-darwin-x86_64/siren-investigate/package.json | |
less siren-platform-demo-data-14.8.0-SNAPSHOT-darwin-x86_64/siren-investigate/package.json | |
// HERE MODIFY THE VERSION | |
zip -ur siren-platform-demo-data-14.8.0-20250513.083732-50-darwin-x86_64.zip 'siren-platform-demo-data-14.8.0-SNAPSHOT-darwin-x86_64/siren-investigate/package.json' |
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 .siren/_search | |
{ | |
"_source": false, | |
"query": { | |
"bool": { | |
"must": [ | |
{ "exists": { "field": "search.indexPattern.fieldFormatMap.keyword" }}, | |
{ | |
"script": { | |
"script": { |
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 _cat/nodes?format=json | |
GET _cat/shards/index-name | |
GET _cat/indices/index-name | |
POST _cluster/reroute | |
{ | |
"commands": [{ | |
"allocate_empty_primary": { |
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
curl -s -H "Content-Type: application/json" -XGET -k -u admin:password https://localhost:9220/.siren/_field_caps?fields=* | jq '.fields | length' | |
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
gcloud container clusters update cicd \ | |
--node-pool=pr-build-investigate-1 \ | |
--enable-autoscaling \ | |
--min-nodes=1 \ | |
--max-nodes=100 \ | |
--zone=europe-west1-c |
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
docker pull europe-west1-docker.pkg.dev/siren-cicd/docker/jenkins-agent:chrome-128-latest | |
docker run -it europe-west1-docker.pkg.dev/siren-cicd/docker/jenkins-agent:chrome-128-latest /bin/bash | |
google-chrome --version | |
google-chrome-stable --version | |
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
Before running the commands make sure you are on correct cluster | |
kubectl config use-context gke_siren-cicd_europe-west1-c_cicd-volatile | |
kubectl -n branch-er set image deployment/branch-er-er \ | |
platform-bundle-demo-data-snapshot=eu.gcr.io/siren-cicd/siren-platform-demo-data-snapshot:branch-er-75 | |
kubectl -n branch-er rollout status deployment/branch-er-er |
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
create a debugging pod | |
file system mounted at | |
/host | |
kubectl debug node/gke-cicd-build-pool-4509cbfd-vh9s -it --image=ubuntu | |
see how much space is taken there | |
all the overlay |
NewerOlder