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
| import io.micrometer.core.aop.CountedAspect; | |
| import io.micrometer.core.aop.TimedAspect; | |
| import io.micrometer.core.instrument.ImmutableTag; | |
| import io.micrometer.core.instrument.MeterRegistry; | |
| import io.micrometer.core.instrument.Tag; | |
| import org.aspectj.lang.ProceedingJoinPoint; | |
| //... | |
| @Configuration | |
| public class UsageMetrics { |
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
| openssl pkcs12 -in new.p12 -clcerts -nokeys | openssl x509 -outform der -pubkey -noout |
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
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.security.KeyStore; | |
| /** | |
| * Transfers a specific alias corresponding to a key from an existing | |
| * archive to a new one. Assumes p12 format. | |
| * <p> | |
| * Some keystores are full of keys, used as general purpose archives, | |
| * and if some are 'unsupported' then errors like 'Warning unsupported bag |
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
| git push --set-upstream http://git-repo/path/project/$(git rev-parse --show-toplevel | xargs basename).git $(git rev-parse --abbrev-ref HEAD) |
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
| import gitlab | |
| import os | |
| import subprocess | |
| def clone_repos(host, token, group, base_dir): | |
| gl = gitlab.Gitlab(host, private_token=token) | |
| group = gl.groups.list(search=group)[0] | |
| clone_projects(group.projects.list(all=True, include_subgroups=True), base_dir) |
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 https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem > rds-combined-ca-bundle.pem | |
| dos2unix rds-combined-ca-bundle.pem | |
| csplit -sk rds-combined-ca-bundle.pem "%BEGIN CERTIFICATE%0" "/BEGIN CERTIFICATE/" "{$(grep -c 'BEGIN CERTIFICATE' rds-combined-ca-bundle.pem | awk '{print $1 - 2}')}" | |
| KS=rds.jks | |
| rm $KS | |
| for CERT in xx*; do | |
| echo "$CERT" | |
| # extract a human-readable alias from the cert | |
| ALIAS=$(openssl x509 -noout -text -in $CERT | | |
| perl -ne 'next unless /Subject:/; s/.*CN=//; print') |