Skip to content

Instantly share code, notes, and snippets.

View l2D's full-sized avatar
🌱
Relearn

l2D l2D

🌱
Relearn
  • 127.0.0.1
View GitHub Profile
@l2D
l2D / get_aws_ec2_metadata.sh
Last active June 19, 2025 15:31
Bash script to get AWS EC2 Metadata. This script is use for get all or specific keys of AWS EC2 metadata with CLI options: `-h` - for Help menu, `-l` for list of available categories
#!/bin/bash
# --------------------------------- Constants -------------------------------- #
readonly BASE_URL="http://169.254.169.254"
readonly METADATA_PATH="/latest/meta-data"
readonly TOKEN_PATH="/latest/api/token"
readonly TOKEN_TTL=60 # In seconds
readonly HEADER_TOKEN_TTL="X-aws-ec2-metadata-token-ttl-seconds"
readonly HEADER_TOKEN="X-aws-ec2-metadata-token"
@l2D
l2D / inspect_https-tls-ssl_certs.md
Created November 19, 2024 05:11 — forked from stonehippo/inspect_https-tls-ssl_certs.md
A couple of ways to look at web server HTTPS/TLS/SSL certificate data via the command line

Inspecting HTTPS (TLS, SSL) certificates from the command line

I needed to inspect an HTTPS site's current certs and wanted to do it from the command line. Here are a couple of commands that I used that worked quite well.

With nmap

nmap -p 443 --script ssl-cert [hostname]

Keybase proof

I hereby claim:

  • I am l2d on github.
  • I am l2dz (https://keybase.io/l2dz) on keybase.
  • I have a public key ASCt9INtbfTJYHjq5KW5XLWNjsOKpINcg8_IX-dT8NNx4wo

To claim this, I am signing this object:

@l2D
l2D / A Readme for Adding Certs.md
Created February 1, 2024 19:06 — forked from Artistan/A Readme for Adding Certs.md
Add new certificate (cert) from local/internal intranet to your mac

Add a cert to you macbook

USAGE

~/add_cert.sh my.intra.net

you will be asked for your password to add thit to keychain

  • downloads pem file
  • adds to trusted root certificates
@l2D
l2D / env2yaml.sh
Last active November 9, 2024 15:36
Convert `.env` file to YAML file. (Bash, Shell)
#!/bin/bash
# Usage: ./script.sh input.env output.yaml
input_file=$1
output_file=$2
# Check if the input file exists
if [ ! -f "$input_file" ]; then
echo "Input file does not exist: $input_file"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.38307824730873108</real>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowClipboardAccess</key>
<true/>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
@l2D
l2D / Dockerfile
Created July 15, 2022 22:02
Docker in Jenkins (run on Docker)
FROM jenkins/jenkins:lts
USER root
RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
RUN usermod -aG docker jenkins
USER jenkins

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.