Skip to content

Instantly share code, notes, and snippets.

View paulcalabro's full-sized avatar

Paul Calabro paulcalabro

View GitHub Profile
@paulcalabro
paulcalabro / Dockerfile.cloudflared
Created March 7, 2024 00:30 — forked from j0sh/Dockerfile.cloudflared
Passing tunnel tokens into cloudflared via Docker Compose secrets
FROM busybox:1.36.1-uclibc as busybox
FROM cloudflare/cloudflared:2023.8.2
COPY --from=busybox /bin/sh /bin/sh
COPY --from=busybox /bin/cat /bin/cat
ENTRYPOINT [ "/bin/sh", "-c", "export TUNNEL_TOKEN=$(cat /run/secrets/tunnel_prod_token) ; cloudflared --no-autoupdate tunnel run" ]
@paulcalabro
paulcalabro / Self-Signed SSL with SAN.md
Created March 5, 2024 06:47 — forked from KeithYeh/Self-Signed SSL with SAN.md
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

@paulcalabro
paulcalabro / mmr_tcx_downloader.py
Last active May 8, 2023 18:28
This script downloads Training Center XML (TCX) files from MapMyRun
#!/usr/bin/env python3
from getpass import getpass
from requests import request
###########################################
# Prompt the user for required information.
###########################################
print('\n' + ('*' * 25) + ' Required Information: ' + ('*' * 25))
@paulcalabro
paulcalabro / php-pools.md
Created November 17, 2022 21:12 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@paulcalabro
paulcalabro / pickle_view.py
Created October 26, 2021 01:17 — forked from philipperemy/pickle_view.py
Pickle viewer in command line! Put it here /usr/bin/pickle_view.py
#!/usr/bin/env python
import pickle
import sys
if __name__ == '__main__':
argv = sys.argv
if len(argv) <= 1:
print 'Specify pickle file as parameter.'
@paulcalabro
paulcalabro / make_writable.js
Created October 14, 2021 18:17 — forked from moehlone/make_writable.js
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**
@paulcalabro
paulcalabro / list-manually-installed-packages.sh
Created June 22, 2020 20:31 — forked from UniIsland/list-manually-installed-packages.sh
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.
@paulcalabro
paulcalabro / proxy.md
Created May 25, 2020 16:40 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@paulcalabro
paulcalabro / github-clone-all.py
Created April 16, 2020 19:32 — forked from YuriyGuts/github-clone-all.py
Clone all public and private repositories from a specific GitHub user or organization
#!/usr/bin/env python
"""
Clone all public and private repositories from a GitHub user or organization.
Copyright (c) 2018 Yuriy Guts
usage: github-clone-all.py [-h] [--auth-user AUTH_USER]
[--auth-password AUTH_PASSWORD] [--clone-user USER]
[--clone-org ORG]
@paulcalabro
paulcalabro / Remote API via daemon.json.md
Created May 3, 2019 20:20 — forked from kekru/Remote API via daemon.json.md
Enable Docker Remote API via daemon.json