I am trying to get a helm chart deployed with the following command:
helm upgrade nifi ./nifi -n nifi \
--set service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-internal"=\"true\" \
--dry-run | grep "load-balancer"
But it returns back
service.beta.kubernetes.io/azure-load-balancer-internal: '"true"'
How do I go about getting it so that it is without the single quotes?
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
There is no need to escape the ".
The command should be:
helm upgrade nifi ./nifi -n nifi \
--set service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-internal"="true" \
--dry-run | grep "load-balancer"
Related
Im trying to use a shell script to scrape a website to get a list of all pages. I found the shell script "Written by Elmar Hanlhofer https://www.plop.at" and it works well. However, I need to exclude directories and the documentation isn't working for me.
# Example, exclude files from /print and /slide:
# files=$(find | grep -i html | grep -v "$SITE/print" | grep -v "$SITE/slide")
I need to exclude a forum install located at /support (and all children directories) so I modify the code to be:
files=$(find | grep -i html | grep -v "$SITE/support")
However it is still scanning /support/directory/directory/ etc. How do I modify the grep command to exclude /support AND ALL CHILD DIRECTORIES?
I am very new to linux / unix commands, so I may not be expressing this correctly. Thank you.
The original script will download whole site, run find to filter out content you don't want.
The section related to wget is copied below,
wget \
--recursive \
--no-clobber \
--page-requisites \
--convert-links \
--restrict-file-names=windows \
--no-parent \
--directory-prefix="$TMP" \
--domains $DOMAIN \
--user-agent="$AGENT" \
$URL >& $WGET_LOG
To exclude support directory, add --exclude-directories option,
wget \
--recursive \
--no-clobber \
--page-requisites \
--convert-links \
--restrict-file-names=windows \
--no-parent \
--directory-prefix="$TMP" \
--domains $DOMAIN \
--user-agent="$AGENT" \
--exclude-directories=/support \
$URL >& $WGET_LOG
Read this answer if you want to have more control on directories.
I successfully got https://github.com/blacklabelops/letsencrypt and the nginx running on my virtual machine on azure.
In Docker I hae now 2 containers. One with my go application running and being reachable on port 8080 on the web, one with the nginx container of blacklabelops. this one is binded to ports 80 and 443. I followed the tutorial "Letsencrypt and Nginx" on github for the steps 1-3 and replaced "http://yourserver" in step 3 with the url of my go application and port 8080 where I can reach it via http.
When I call https and the domain nothing happens. Ports 8080,443 and 80 are open in the azure network security group.
Can you give me a hint?
Update: I can post the commands _i performed here.
I have "my" application running on http://myapp.westeurope.cloudapp.azure.com:8080
I performed 1:
sudo docker run -d \
-p 80:80 \
-p 443:443 \
-e "SERVER1REVERSE_PROXY_LOCATION1=/" \
-e "SERVER1REVERSE_PROXY_PASS1=172.17.0.2" \
-e "SERVER1CERTIFICATE_DNAME=/CN=Chatbot/OU=Kundenservice/O=myapp.westeurope.cloudapp.azure.com/L=Frankfurt/C=DE" \
-e "SERVER1HTTPS_ENABLED=true" \
--name nginx \
blacklabelops/nginx
Than I performed 2:
sudo docker run --rm \
-p 80:80 \
-p 443:443 \
-v letsencrypt_certificates:/etc/letsencrypt \
-e "LETSENCRYPT_EMAIL=mymail#azure.com" \
-e "LETSENCRYPT_DOMAIN1=myapp.westeurope.cloudapp.azure.com" \
blacklabelops/letsencrypt install
I did 3:
sudo docker volume create letsencrypt_challenges
And 4:
-p 443:443 \
-p 80:80 \
-v letsencrypt_certificates:/etc/letsencrypt \
-v letsencrypt_challenges:/var/www/letsencrypt \
-e "NGINX_REDIRECT_PORT80=true" \
-e "SERVER1REVERSE_PROXY_LOCATION1=/" \
-e "SERVER1REVERSE_PROXY_PASS1=http://myapp.westeurope.cloudapp.azure.com" \
-e "SERVER1HTTPS_ENABLED=true" \
-e "SERVER1HTTP_ENABLED=true" \
-e "SERVER1LETSENCRYPT_CERTIFICATES=true" \
-e "SERVER1CERTIFICATE_FILE=/etc/letsencrypt/live/myapp.westeurope.cloudapp.azure.com/fullchain.pem" \
-e "SERVER1CERTIFICATE_KEY=/etc/letsencrypt/live/myapp.westeurope.cloudapp.azure.com/privkey.pem" \
-e "SERVER1CERTIFICATE_TRUSTED=/etc/letsencrypt/live/myapp.westeurope.cloudapp.azure.com/fullchain.pem" \
--name nginx \
blacklabelops/nginx
I'm using jq to parse some output from AWS cli.
I'm trying to use 'select(startswith("$variable") )' but for some reason it doesn't work even though when I use the variable's value it works properly.
Example:
itai#MacBook-Pro ~/src/Scripts - $ echo $App
Analytics
itai#MacBook-Pro ~/src/Scripts - $ aws cloudformation describe-stacks --stack-name $StackName --region $region | jq -r '.Stacks[].Outputs[].OutputKey | select(startswith("Analytics") )'
AnalyticsAutoScalingGroup
itai#MacBook-Pro ~/src/Scripts - $ aws cloudformation describe-stacks --stack-name $StackName --region $region | jq -r '.Stacks[].Outputs[].OutputKey | select(startswith("$App") )'
itai#MacBook-Pro ~/src/Scripts - $
I know I can use grep like so:
aws cloudformation describe-stacks --stack-name $StackName --region $region | jq -r '.Stacks[].Outputs[].OutputKey' | grep $App
But I prefer to use jq all along the command.
Am I doing it wrong or is it just not possible?
You can also do it without using --arg or --argjson. In your case, since your variable holds a string value, you may do it like this.
aws cloudformation describe-stacks --stack-name $StackName --region $region |\
jq -r '.Stacks[].Outputs[].OutputKey | select(startswith('\"$App\"') )'
Notice I added single quotation marks and escaped the double-quotation marks around your variable
See here https://github.com/stedolan/jq/wiki/FAQ on the "How can environment variables be passed to a jq program? How can a jq program be parameterized?" second answer.
Generally, the best way to pass the value of shell variables to a jq program is using the -—arg and/or —-argjson command-line options, as described in the manual. Environment variables can be passed in using env.
See also the https://github.com/stedolan/jq/wiki/FAQ
I am using reaction commerce https://github.com/reactioncommerce/reaction.
I tried reaction &. It will eventually die.
How do I run reaction commence in background forever?
by deploying
or in short, build a docker image:
docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048" -t mycustom .
then run it:
docker run -d \
-p 80:3000 \
-e ROOT_URL="http://<your app url>" \
-e MONGO_URL="mongodb://<your mongo url>" \
-e REACTION_EMAIL="youradmin#yourdomain.com" \
-e REACTION_USER="admin-username" \
-e REACTION_AUTH="admin-password" \
mydockerhubuser/mycustom:mytag
I'm trying to add a line before "rezhome" in the file as it would look like below:
...
app3-reservation, \
app4-reservation, \
app5-reservation, \
rezhome
When I run locally with below command it works fine.
sed -i 's/rezhome/app5-reservation, \\\n&/' grouphost.cfg
But using ssh backslash is not escaped and I get below result
ssh localhost "sed -i 's/rezhome/app5-reservation, \\\n&/' /path/grouphost.cfg"
...
app3-reservation, \
app4-reservation, \
app5-reservation, \nrezhome
Any help please?
The \ gets processed by both the sed and the ssh so you'll need to further escape them to use it with both. Try:
ssh localhost "sed -i 's/rezhome/app5-reservation, \\\\\n&/' /path/grouphost.cfg"