Skip to content

Instantly share code, notes, and snippets.

@opthakur
opthakur / version_compare.sh
Created August 1, 2023 06:00 — forked from mohamednajiullah/version_compare.sh
Compare the last two versions of a file stored in a S3 bucket
#!/bin/bash
#This script needs awscli, jq and colordiff. Please install them for your environment
#This script also needs the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION.
#Please set them using the export command as follows or set them using envrc
#export AWS_ACCESS_KEY_ID=<Your AWS Access Key ID>
#export AWS_SECRET_ACCESS_KEY=<Your AWS Secret Access Key>
#export AWS_DEFAULT_REGION=<Your AWS Default Region>
@opthakur
opthakur / check-certs.sh
Created July 15, 2020 07:20 — forked from cgmartin/check-certs.sh
Bash SSL Certificate Expiration Check
#!/bin/bash
TARGET="mysite.example.net";
RECIPIENT="[email protected]";
DAYS=7;
echo "checking if $TARGET expires in less than $DAYS days";
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \
| openssl x509 -text \
| grep 'Not After' \
|awk '{print $4,$5,$7}')" '+%s');
in7days=$(($(date +%s) + (86400*$DAYS)));
@opthakur
opthakur / Install LAMP stack on Ubuntu
Last active August 1, 2023 06:02 — forked from hasanbayatme/README.md
Easy to use Bash Script to Install LAMP stack on Ubuntu.
## Installation
### Automatic
Run the below command in terminal:
```bash
wget --no-cache -O - https://gist.github.com/EmpireWorld/737fbb9f403d4dd66dee1364d866ba7e/raw/install-lamp.sh | bash
```