Skip to content

Instantly share code, notes, and snippets.

View sageworksstudio's full-sized avatar

Chris Brown sageworksstudio

View GitHub Profile
@sageworksstudio
sageworksstudio / certbot-cheatsheet.md
Last active October 3, 2021 00:09
certbot cheatsheet

Certbot cheatsheet

Deb/Ubuntu Install

$sudo apt install certbot python3-certbot-apache

First Run

$sudo certbot run

Create a cron job to auto-renew

$sudo crontab -e

@sageworksstudio
sageworksstudio / format-usb-fat32.md
Last active May 25, 2020 19:25
Format USB FAT32

Format USB Fat32

List your block devices to find the location of the device:

$ lsblk

Unmount the drive. Replace dev/sdb1 with your drive location.

$ sudo umount /dev/sdb1

@sageworksstudio
sageworksstudio / rsync.md
Last active July 17, 2020 19:56
rsync cheatsheet

rsync

TFM https://linux.die.net/man/1/rsync

Copy a directory and it's contents

$rsync -av --progress /folder/to/backup/* /destination/of/backup/

Log results

To log results add the log flag

@sageworksstudio
sageworksstudio / map.html
Created February 11, 2020 19:06
Interactive map
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.map {
@sageworksstudio
sageworksstudio / FFMPEG.md
Created January 23, 2020 23:00
FFMPEG cheatsheet

ffmpeg

Convert with 2 pass

ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 1 -an -f webm /dev/null

ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 2 output.webm

@sageworksstudio
sageworksstudio / AndroidSDK.md
Last active August 17, 2019 16:56
Common Android APK commands

Common Android APK Commands

Pushing a file from desktop to device.

adb push ~/Downloads/somefile.zip /sdcard/somefile.zip

@sageworksstudio
sageworksstudio / Generating-RSA-Keys.md
Last active July 9, 2020 20:37
Generating a public/private RSA key pair.

Generating RSA keys

On a Mac or other Unix-like system, locate your ~/.ssh directory and from that directory run this in the command line:

ssh-keygen -t rsa -b 4096 -C "your_comment"

-t = type (The possible values are 'dsa', 'ecdsa', 'ed25519', or 'rsa')

-b = bits

@sageworksstudio
sageworksstudio / SSL_Creating-csr-keys-certs.md
Last active June 1, 2020 05:18
SSL - Creating CSR, keys and storing certificates for Apache2

SSL (HTTPS) - Creating CSR, keys and storing certificates

More info

Apache


Create a new folder to store certs and keys:

@sageworksstudio
sageworksstudio / Custom-TinyMCE.md
Last active December 23, 2022 03:05
Customizing TinyMCE in SilverStripe 4.x
@sageworksstudio
sageworksstudio / creating-tar-backups.md
Last active June 1, 2020 04:47
Tar backups --exclude <dir>

Creating TAR backups

Bash example

  • First create a timestamp that looks something like (YearMonthDay-Hour:Minute:Second) or (20200512-02:30:00). This will give you a unique identifier.
  • Then cd into the directory you want to back up.
  • Create a tar.bz2 (bzip2 compression) file.
  • Optionally, delet the original files.

Example: