Skip to content

Instantly share code, notes, and snippets.

View caffeinetiger's full-sized avatar

Tony Benavides caffeinetiger

  • Chromatic Ai Swarm
  • Earth
View GitHub Profile

Configure Powerline and default terminal for Visual Studio Code

Setting default terminal

  1. Open Visual Studio Code
  2. Press CTRL + SHIFT + P to open the Command Palette
  3. Search for “Terminal: Select Default Profile”
  4. Select your preferred shell. In my case I selected “WLinux (WSL)”

Configuring Powerline fonts for integrated terminal

@caffeinetiger
caffeinetiger / run_tests.sh
Last active April 18, 2022 16:55
For use in a Jenkins freestyle job in an Execute shell Build Action. Will run tests in a docker conatainer, check if there is a failed test and exit, and produce a .trx results file for Jenkins. Something to note is that the .trx file has to be cho
#!/bin/bash
set -e
TEST_OUTPUT=`docker run --rm -v $WORKSPACE:/src/ mcr.microsoft.com/dotnet/sdk:3.1 bash -c "cd /src/; dotnet test --logger 'trx;logfilename=testResults.trx';"`
sudo chown -R jenkins:jenkins .
FAIL_STR="Failed:"
@caffeinetiger
caffeinetiger / README.md
Last active April 18, 2022 16:55
References: - [How to Clean or Reset build numbers in Jenkins job ? ](https://linuxhelp4u.blogspot.com/2018/03/how-to-clean-or-reset-build-numbers-in.html)

How to reset Jenkins build numbers

Steps

  1. Log into Jenkins server
  2. Navigate to Manage Jenkins
  3. Select Script Console
  4. Copy and adapt snippet from fig.1
  5. Select Run
  6. Check job and build numbers/history should be deleted/gone

Jenkins Role-based Authorization Strategy issue with Matrix Authorization Plugin 3.0+

There is a known issue (as of 4/5/2022) with using the Role-based Authorization Strategy Jenkins plugin with the depedent Matrix Authorization plugin 3.0+

To fix the issue you have to add a record for every "No type prefix" error you see with users assigned to a role. Added the following to fix the "functionality":

USER:some-user

There will be two entry and the red error text will still display but the plugins should function properly otherwise.

Fix The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.

This is relevant to Amazon Linux 2018.03

From the references basically:

1. Download the valid GPG Key:

wget https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
mv ./RPM-GPG-KEY-mysql-2022 /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
#!/bin/bash
BITBUCKET_USERNAME=someperson
BITBUCKET_PASSWORD=somepassword
mkdir some-dir
# The follow command works by default in Amazon Linux 2 out of the box for Python 2.7.x
# App passwords need to be URL encoded to work
URL_ENCODED_PASSWORD=$(python -c "import urllib;print urllib.quote(raw_input())" <<< "${BITBUCKET_PASSWORD}")
git clone https://${BITBUCKET_USERNAME}:${URL_ENCODED_PASSWORD}@bitbucket.org/sometreamorg/somerepo.git some-dir
#!/bin/bash
git clone git@github.com:whatever directory-name
@caffeinetiger
caffeinetiger / bash_cheatsheet_check_env_vars.md
Last active April 18, 2022 16:58
## References: - [Checking if a Linux Environment Variable Is Set or Not](https://www.baeldung.com/linux/environment-variable-check-if-set) - [Bash Cheatsheet: check if environment variables are set or file/symlinks exists + more](https://codewithhug
@caffeinetiger
caffeinetiger / install_oracle_jdk_11.sh
Last active April 18, 2022 16:58
References: - [Install Java 11 (OpenJDK 11) on RHEL 8|CentOS 8|Rocky Linux 8](https://computingforgeeks.com/how-to-install-java-11-openjdk-11-on-rhel-8/)
#!/bin/bash
curl -L -b "oraclelicense=a" -O https://download.oracle.com/otn-pub/java/jdk/11.0.14%2B8/7e5bbbfffe8b45e59d52a96aacab2f04/jdk-11.0.14_linux-x64_bin.rpm
sudo rpm -Uvh jdk-11.0.14_linux-x64_bin.rpm
java -version
# If 11 does not display use the alternatives tool to set the version of java
sudo update-alternatives --config 'java'