Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
julienbourdeau / imgoptim
Created September 18, 2014 15:47
Find and compress JPG and PNG images (using optipng and jpegoptim) with command line
find . -name "*.png" -exec optipng '{}' \;
find . -name "*.jpg" -exec jpegoptim '{}' \;
@Belphemur
Belphemur / transmission-ssl
Last active April 16, 2025 05:05
Configuration to use nginx as reverse proxy for Transmission BT with SSL/HTTP2 protected with auth
upstream transmission {
server 127.0.0.1:9091; #Transmission
}
server {
listen 443 ssl http2;
server_name example.com;
auth_basic "Server Restricted";
auth_basic_user_file /var/www/myWebSite/web/.htpasswd;
# Path to the root of your installation
@beardedinbinary
beardedinbinary / wp-install.sh
Last active August 30, 2025 22:24
Automated Wordpress Install Script
#!/bin/bash
# Install script for Latest WordPress on local dev
# Setup
# Hardcoded variables that shouldn't change much
# Path to MySQL
MYSQL='/usr/bin/mysql'
# Simple PowerShell script to load-test / test REST api with headers and cookies.
# Harald S. Fianbakken
$headers = @{
"Accept"= "application/zip";
"Accept-Encoding"= "gzip,deflate,sdch";
"My-Token-ID" = "This_is_a_test";
};
function Create-Cookie($name, $value, $domain, $path="/"){
@madeagency
madeagency / gist:79dc86e8aa09aa512af5
Created April 23, 2015 08:16
OSX Terminal Fix - perl: warning: Setting locale failed.
When running certain commands like ssh or git within Terminal on OSX you may get notices like the one below, which can be annoying.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
@glen-cheney
glen-cheney / encoding-video.md
Last active October 25, 2025 03:24
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@u1735067
u1735067 / gist:d2b28966009d70a70928
Created September 18, 2015 21:29
TASK ERROR: clone failed: lvcreate 'vms/pve-vm-119' error: Failed to activate new LV.
root@camille:/etc/pve# lvcreate -L 16M -n vm-119-disk-1 vms
device-mapper: create ioctl on vms-vm--119--disk--1 failed: Device or resource busy
Failed to activate new LV.
root@camille:/etc/pve#
==> http://setaoffice.com/2015/03/25/device-mapper-create-ioctl-failed-device-or-resource-busy/
root@camille:/etc/pve#
root@camille:/etc/pve# dmsetup
Usage:
@kdhollow
kdhollow / web.config_with_error_passthrough
Last active February 2, 2022 10:03
web.config addition to allow error passthrough
<system.webServer>
...
<httpErrors errorMode="Detailed" existingResponse="PassThrough">
</httpErrors>
...
</system.webServer>
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@cyrusboadway
cyrusboadway / google-domains-dynamic-dns-update.sh
Created February 20, 2016 17:21
Script to update a Google Domains DNS record
#!/bin/bash
### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083
### Synthetic Records: https://support.google.com/domains/answer/6069273
USERNAME=""