Run something like: $ kubectl –as=system:serviceaccount:MY_NAMESPACE:MY_SERVICE_ACCOUNT auth can-i get configmap/MY_CONFIGMAP I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.
Blog
How to persist variables in a loop from a find command in Bash?
The usual way is to use a pipe: find . -name ‘*.jpg’ | while read f do; some_command "$f" done There are two problems here. First, this won’t work if paths have spaces or other blank characters in them. Second,… Read More
How to iterate an array in Bash?
Here you go: myarray[0]="this is a test" myarray[1]="this is another test" for i in "${myarray[@]}"; do echo "Value: $i" done Don’t forget the quotes around the ${myarray[0]}, or the spaces will separate each word on its own item. I work… Read More
How to trim leading and trailing characters in Bash?
Bash has built-in facilities to trim characters at the beginning and end of the value of a variable: $ myvar="AAAthis is a testAAA" $ echo ${myvar##*(A)} this is a testAAA $ echo ${myvar%%*(A)} AAAthis is a test I work as… Read More
How to install jq on CentOS?
jq is in the EPEL repo, so you need to do this: $ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ sudo yum -y install jq I work as a freelancer, so if you don’t want to do that kind of things… Read More
Magic SysRq cheatsheet
First of all, ensure Magic SysRq is enabled: $ cat /proc/sys/kernel/sysrq 0 means “disabled”, 1 means “everything enabled” and >1 is a bitmask of allowed keys. If you are using Ubuntu, you can modify the `/etc/sysctl.d/10-magic-sysrq.conf` file to set this… Read More
How to install Docker on Amazon Linux 2?
SSH to your Amazon Linux 2 EC2 instance, and follow the steps: $ sudo yum update -y $ sudo amazon-linux-extras install docker $ sudo systemctl enable docker $ sudo systemctl start docker $ sudo usermod -aG docker ec2-user # Optional,… Read More
How to inspect a Certificate Signing Request (CSR) using OpenSSL?
Here you go: $ openssl req -noout -text -in PATH/TO.CSR I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.
How to make an S3 bucket public?
The first thing is to make sure the “Public Access Block” are disabled. In the AWS console, go to your bucket, then “Permissions”, then “Block public access”. Then set the bucket policy to this: { "Version": "2008-10-17", "Statement": [ {… Read More
How to search the git history?
To search the content of commits, as opposed to the metadata like the commit message, run this: $ git grep REGEX $(git rev-list –all) To search the commit messages, run that: $ git log –all –grep REGEX I work as… Read More