Skip to content

Instantly share code, notes, and snippets.

View nickmccally's full-sized avatar
👽

Nick McCally nickmccally

👽
View GitHub Profile
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active July 7, 2024 01:28
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
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@mihow
mihow / load_dotenv.sh
Last active July 16, 2024 13:19
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@jpalmieri
jpalmieri / git_autocomplete
Last active May 26, 2023 08:16
Autocomplete for git commands and branch names
Taken from this page: http://code-worrier.com/blog/autocomplete-git/
Step 1: download this bash script (make sure to name it ".git-completion.bash"):
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash.
You can run this curl from your home directory to download it directly:
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
Step 2: Place the file in your home directory
@aurman
aurman / exampleOauth.php
Last active July 4, 2022 13:00
SmartThings .php example authenticating and controlling SmartThings API endpoints
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@mudpile45
mudpile45 / howto.md
Created October 18, 2012 08:59 — forked from bsodmike/howto.md
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS

Domain to domain mail forwarding

This guide combined with the info here allows you do the following:

  • Forward all mails from one domain to another (via catch-all addresses)
  • Set up a catch-all email address (just enter a @ with no user in front of it in the virtuserstable)
  • set up distribution lists etc. (use commas)

Why would you want this? Well, for me I own some domain names and I like to use gmail to read my mail. One use case is that we have a small organization that I've already set up a google for domains account with, but the organization has multiple domains that all redirect to our website. I wanted our mail to also all redirect to the same mail, so I created MX records for all the domains that are supposed to redirect and pointed them at my VPS and on my VPS I set up mail relaying to my original google for domains account, with entries for each user. This way, if I had my google domains running at myemail@mygoogledomain.com, but som