GPG Cheat Sheet
Written for GPG versions 2.x only.
List keys
List public keys
gpg --list-keys
#!/bin/bash | |
# | |
# Create list.txt with each repo name on a new line | |
# | |
# You can copy all the names from your GitHub repo page with the following command in the browser | |
# copy([ ...document.querySelectorAll("a[itemprop]")].map(a=>a.href.match(/.*\/(.*)$/)[1]).join("\n") + "\n") | |
# | |
# Or open settings, repositories, and copy the names from the list, this method below includes repos which you collaborate with, so you may need to just manually remove them | |
# copy([...document.querySelectorAll(".js-collaborated-repos a.mr-1")].map(n=>n.innerText.replace(/^.*\//,'')).join("\n")) | |
# Then run: |
@echo off | |
rem Create list.txt with each repo name on a new line | |
rem | |
rem You can copy all the names from your GitHub repo page with the following command in the browser | |
rem copy([ ...document.querySelectorAll("a[itemprop]")].map(a=>a.href.match(/.*\/(.*)$/)[1]).join("\n") + "\n") | |
rem | |
rem Or open settings, repositories, and copy the names from the list, this method below includes repos which you collaborate with, so you may need to just manually remove them | |
rem copy([...document.querySelectorAll(".js-collaborated-repos a.mr-1")].map(n=>n.innerText.replace(/^.*\//,'')).join("\n")) | |
rem | |
rem Then run: |
Written for GPG versions 2.x only.
List public keys
gpg --list-keys
const copy = str => { | |
const el = document.createElement("textarea"); | |
el.value = str; | |
document.body.appendChild(el); | |
el.select(); | |
document.execCommand("copy"); | |
document.body.removeChild(el); | |
}; |
#!/bin/bash | |
# | |
# renew-letsencrypt-certificates.sh DOMAIN [EMAIL] | |
# | |
# Copy Let's Encrypt SSL certs from a remote public facing web server to local filesystem | |
# Look for changes, if any change, restarts the web service | |
# Useful for using Let's Encrypt with local internal servers, with custom DNS. | |
# Working "mail" command needed for email alerts | |
# |
#!/bin/sh | |
# Flush tables | |
iptables -F | |
# Allow established connections | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow SSH, VNC, Web etc | |
iptables -A INPUT -p tcp --dport ssh -j ACCEPT |
#!/bin/bash | |
# | |
# basic iptables starter script that only allow incoming SSH and ping | |
# | |
# default actions | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT ACCEPT |
#!/bin/bash | |
# | |
# Usage: | |
# ./pi.sh backup /dev/sdb | |
# ./pi.sh restore /dev/sdb | |
# | |
# Files created and used during backup and restore: | |
# mbr.img sfdisk.dump partition[12].parted | |
# | |
# For raspbian images, use minimum 8GB microsd card |
// drag and drop multiple files | |
Cypress.Commands.add("upload_files", (selector, fileUrlArray, type = "") => { | |
const files = []; | |
fileUrlArray.forEach((fileUrl) => { | |
cy.fixture(fileUrl, "base64") | |
.then(Cypress.Blob.base64StringToBlob) | |
.then((blob) => { | |
const nameSegments = fileUrl.split("/"); | |
const name = nameSegments[nameSegments.length - 1]; | |
files.push(new File([blob], name, { type })); |
{ | |
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$1');", |