Skip to content

Instantly share code, notes, and snippets.

@cechu66
cechu66 / autopart.sh
Created June 27, 2021 10:29 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@cechu66
cechu66 / web-servers.md
Created October 5, 2020 04:03 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@cechu66
cechu66 / gist:9b2853c824fc8758cc13ff7a74daf4ba
Created March 18, 2020 09:21 — forked from bcremer/gist:12167985b442d0d195de
NGINX as caching REST-API Proxy
upstream backend {
server localhost:8080;
#server backup1.example.com:8080 backup;
#server backup2.example.com:8080 backup;
}
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m;
# Set cache key to include identifying components
@cechu66
cechu66 / cloudflare-ddns-update.sh
Created February 19, 2020 17:30 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record

Keybase proof

I hereby claim:

  • I am cechu66 on github.
  • I am cechu66 (https://keybase.io/cechu66) on keybase.
  • I have a public key ASBe0DZjR3gJpDhSxSsW2AtpPUNlMe1Awf80jkX70pg8IAo

To claim this, I am signing this object:

@cechu66
cechu66 / DefaultJenkinsEmail
Created July 1, 2019 04:45 — forked from ferventcoder/DefaultJenkinsEmail
Jenkins Email-ext (Editable Email Notifications)
Subject: Jenkins ${BUILD_STATUS} [#${BUILD_NUMBER}] - ${PROJECT_NAME}
Content Type: Plain Text (text/plain)
Trigger for matrix projects: Trigger for each configuration
Choose "Advanced", "Add a Trigger" and choose the following triggers:
Fixed, Failure, Unstable, Still Failing, Still Unstable
Ensure that "Send To Recipient List" is checked for all of these at the very least.
Fixed is the only trigger you will need to expand to change the Content.
@cechu66
cechu66 / dump.sh
Created June 21, 2019 04:09 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@cechu66
cechu66 / ssl-check.py
Created June 10, 2019 03:16 — forked from gdamjan/ssl-check.py
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket