Skip to content

Instantly share code, notes, and snippets.

View jamesmcm's full-sized avatar

James McMurray jamesmcm

View GitHub Profile
@1player
1player / bazarr.docker-compose.yml
Last active February 17, 2024 20:41
Poor man's media centre
# Bazarr downloads subtitles
version: "3.4"
services:
bazarr:
image: linuxserver/bazarr:1.0.5-development
container_name: bazarr
restart: unless-stopped
environment:
- TZ=Europe/London
@reneklacan
reneklacan / aoe4-mp-fix.sh
Last active March 26, 2024 08:48
Script to fix AOE4 desync issues
#!/bin/bash
set -ex
STEAM_DIR=/home/$USER/.steam/steam/steamapps
AOE4_DIR=$STEAM_DIR/compatdata/1466860
AOE4_WIN_DIR=$AOE4_DIR/pfx/drive_c/windows
AOE4_WIN_SYS32_DIR=$AOE4_WIN_DIR/system32
AOE4_WIN_SYS64_DIR=$AOE4_WIN_DIR/syswow64
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 2, 2024 04:41
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active April 25, 2024 12:45
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@belst
belst / rocketguide.md
Last active March 13, 2024 22:09
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@AravindaM
AravindaM / SHA256HMAC.scala
Last active March 2, 2022 20:51
Generate HMAC using SHA256 in Scala
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
Object HMACgen {
def generateHMAC(sharedSecret: String, preHashString: String): String = {
val secret = new SecretKeySpec(sharedSecret.getBytes, "SHA256") //Crypto Funs : 'SHA256' , 'HmacSHA1'
val mac = Mac.getInstance("SHA256")
mac.init(secret)
val hashString: Array[Byte] = mac.doFinal(preHashString.getBytes)
@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@aslotnick
aslotnick / point_in_polygon.sql
Last active February 6, 2018 17:28
Simple point-in-polygon UDF for Amazon Redshift based on http://geospatialpython.com/2011/08/point-in-polygon-2-on-line.html
CREATE FUNCTION point_in_polygon(point_x float, point_y float, polygon_wkt varchar(max))
RETURNS boolean IMMUTABLE AS
$$
### begin section copied from http://geospatialpython.com/2011/08/point-in-polygon-2-on-line.html (I modifed to return boolean)
# Improved point in polygon test which includes edge
# and vertex points
def point_in_poly(x,y,poly):
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active April 25, 2024 03:06
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7