Skip to content

Instantly share code, notes, and snippets.

View mattchilds1's full-sized avatar
👨‍💻

Matt Childs mattchilds1

👨‍💻
View GitHub Profile
@mattchilds1
mattchilds1 / 002-portfolio_amount_today.15m.sh
Last active November 1, 2021 18:24
xbar plugin to display coin gecko portfolio price for single coin
#!/bin/bash
# <xbar.title>Coingecko - Portfolio Price</xbar.title>
# <xbar.version>v0.0.1</xbar.version>
# <xbar.author>MattChilds</xbar.author>
# <xbar.author.github>mattchilds1</xbar.author.github>
# <xbar.desc>Displays current portfolio amount of a particular coin using Coingecko data.</xbar.desc>
# <xbar.image></xbar.image>
# <xbar.dependencies>bash,jq</xbar.dependencies>
# <xbar.abouturl>https://github.com/mattchilds1 // TODO Add Gist</xbar.abouturl>
#!/usr/bin/env bash
set -eo pipefail
REPO_ROOT_DIR=$(git rev-parse --show-toplevel)
GLOBAL_TF_VARS="${REPO_ROOT_DIR}/v2/global/terraform.tfvars"
WORKSPACE="${ENV}"
runCommands() {
@mattchilds1
mattchilds1 / sonatype-nexus-self-sign-cert
Created April 24, 2018 20:16
Run Sonatype Nexus on server over 8443 (HTTPS/TLS) with a self signed certificate. Intended to be run on an EC2 Instance behind an ALB with public certificate.
sudo service nexus stop
cd /opt/efs/nexus/
sudo keytool -genkey -alias <external_domain> -keyalg RSA -dname 'CN=<external_domain>, OU=UK, O=UK, C=UK, ST=LONDON, L=WESTMINSTER' -storepass <password> -validity 365 -keystore keystore.jks -keypass <password> -deststoretype pkcs12
sudo chown -R nexus:nexus /opt/efs/nexus/keystore.jks
### Change /opt/efs/sonatype-work/nexus3/etc/nexus.propertiess
sudo sed -i 's|# application-host=0.0.0.0|application-port-ssl:8443|g' /opt/efs/sonatype-work/nexus3/etc/nexus.properties
sudo sed -i 's|# nexus-args=$${jetty.etc}/jetty.xml,$${jetty.etc}/jetty-http.xml,$${jetty.etc}/jetty-requestlog.xml|nexus-args=$${jetty.etc}/jetty.xml,$${jetty.etc}/jetty-https.xml,$${jetty.etc}/jetty-requestlog.xml|g' /opt/efs/sonatype-work/nexus3/etc/nexus.properties
sudo sed -i 's|# application-port=8081|appliication-port=8443|g' /opt/efs/sonatype-work/nexus3/etc/nexus.properties
@mattchilds1
mattchilds1 / jenkins-self-sign-cert
Created April 24, 2018 15:33
A gist to configure Jenkins to serve over 8443 (HTTPS/TLS) with a self signed certificate. Intended to be used on AWS behind an ALB serving jenkins over 443 (HTTPS/TLS) with a public certificate.
## Stop jenkins service
sudo service jenkins stop
## Disable Jenkins HTTPS port
sudo sed -i 's|JENKINS_PORT="8080"|JENKINS_PORT="-1"|g' /etc/sysconfig/jenkins
## Add Jenkins HTTPS port (8433)
sudo sed -i 's|JENKINS_HTTPS_PORT=""|JENKINS_HTTPS_PORT="8433"|g' /etc/sysconfig/jenkins
## Add Jenkins HTTPS keystore
### Keybase proof
I hereby claim:
* I am mattchilds1 on github.
* I am mattch (https://keybase.io/mattch) on keybase.
* I have a public key ASDuAW6fyN2fIIg58Ru3lehu1qv_cqqqXsefCUhHwtu5rQo
To claim this, I am signing this object: