Skip to content

Instantly share code, notes, and snippets.

View lukespragg's full-sized avatar

Luke Spragg lukespragg

View GitHub Profile
@vadimstasiev
vadimstasiev / archlinux-steamlink_install.sh
Last active July 26, 2023 21:43 — forked from PlatinumMaster/archlinux-steamlink_install.sh
Arch Linux chroot installation on the Steam Link.
@MarkTiedemann
MarkTiedemann / download-latest-release.ps1
Last active June 22, 2024 16:34
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
@IlyaFinkelshteyn
IlyaFinkelshteyn / StartBuildPassEnvVar.ps1
Created October 4, 2016 17:34
Start appveyor build with API and pass value for Environment Variable
Param([string]$myVar )
$token = '<API_Token>'
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$body = @{
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active May 31, 2024 15:10
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 10, 2024 18:51
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@lukespragg
lukespragg / block.conf
Created October 8, 2013 18:27
NGINX configuration, block, and maintenance files
## Block by user agent
if ($http_user_agent ~ (Purebot|Lipperhey|MaMa CaSpEr|libwww-perl|Mail.Ru|gold crawler)) {
return 403;
}
## Block by referrer keywords
if ($http_referer ~* (viagra|cialis|levitra) ) {
return 403;
}
@plentz
plentz / nginx.conf
Last active July 25, 2024 09:38
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@lukespragg
lukespragg / nginx
Created September 6, 2013 21:53
NGINX start script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@lyoshenka
lyoshenka / ddns.sh
Last active October 11, 2023 04:28 — forked from kevinoconnor7/c-ddns.sh
Quick and dirty DDNS using Bash and Cloudflare (API v4 compatible)
#!/usr/bin/env bash
# Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://dash.cloudflare.com/profile/api-tokens
# Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit
# If you want to set the root domain instead of a subdomain, set SUBDOMAIN to "@"
# Step 2: Create an A record on Cloudflare with the subdomain you chose
# Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created.
# Fill in ZONE_ID and REC_ID below
# This step is optional, but will save you 2 requests every time you run this script
# Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating.