Skip to content

Instantly share code, notes, and snippets.

View cppshane's full-sized avatar
👺
high tension

Shane Duffy cppshane

👺
high tension
View GitHub Profile
@cppshane
cppshane / launch.json
Last active February 18, 2022 01:16
VS Code .NET API Launch Configuration
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Launch",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net5.0/example-api.dll",
"args": [],
@cppshane
cppshane / tasks.json
Last active February 18, 2022 01:18
VS Code .NET API Tasks Configuration
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/example-api.csproj",
@cppshane
cppshane / launch.json
Created February 18, 2022 01:19
VS Code Angular Launch Configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Node Launch",
"command": "npm run start",
"request": "launch",
"type": "node-terminal",
"serverReadyAction":{
"action": "startDebugging",
@cppshane
cppshane / example.code-workspace
Created February 18, 2022 01:20
VS Code Angular .NET Workspace Configuration
{
"folders": [
{
"path": "."
},
{
"path": "../example-api"
}
],
"settings": {},
// ==UserScript==
// @name Vimium Standard
// @namespace https://shaneduffy.io
// @version 0.1
// @description Standard Notes changed their UI, and now it doesn't work with Vimium. This makes things work with Vimium again.
// @author Shane Duffy
// @match https://app.standardnotes.com
// @icon https://shaneduffy.io/assets/img/logo-circle-64.png
// @grant none
// ==/UserScript==
@cppshane
cppshane / snippet.sh
Created May 10, 2022 22:08
Import/Export GPG Keys
# Get GPG keys
#
# Sample Output:
# sec rsa3072 2021-11-12 [SC] [expires: 2023-11-12]
# 12345ABCDE
# uid [ultimate] Shane Duffy <shane@shaneduffy.io>
# ssb rsa3072 2021-11-12 [E] [expires: 2023-11-12]
gpg --list-secret-keys shane@shaneduffy.io
# Export GPG key to file
@cppshane
cppshane / snippet.sh
Created May 10, 2022 23:12
Git GPG Setup
# Generate key and list them
# Sample Output:
# /home/shane/.gnupg/pubring.kbx
# ------------------------------
# sec rsa3072/12345ABCDE 2021-11-12 [SC] [expires: 2023-11-12]
# 123456789
# uid [ultimate] Shane Duffy <shane@shaneduffy.io>
# ssb rsa3072/12345ZZZZZ 2021-11-12 [E] [expires: 2023-11-12]
gpg --gen-key
gpg --list-secret-keys --keyid-format LONG
@cppshane
cppshane / snippet.sh
Created May 15, 2022 20:02
Mongo Initial Permissions
# Why does initial setup of Mongo always give me permission issues?
mongosh
use admin
db.createUser(
{
user: "adminUser",
pwd: passwordPrompt(),
roles: [
{ role: "userAdminAnyDatabase", db: "admin" },
@cppshane
cppshane / example.com
Created May 15, 2022 20:07
.NET/Angular NGINX with SSL via Certbot
upstream example_site {
server 127.0.0.1:4000;
}
upstream example_api {
server 127.0.0.1:5000;
}
server {
root /var/www/example.com/dist/example/browser;
@cppshane
cppshane / snippet.sql
Created May 15, 2022 20:11
SQL Initial Permissions
CREATE USER 'shane'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'shane'@'localhost' WITH GRANT OPTION;
CREATE USER 'shane'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'shane'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;