Skip to content

Instantly share code, notes, and snippets.

@chranderson
chranderson / nvmCommands.js
Last active April 18, 2024 12:46
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@imthenachoman
imthenachoman / Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace.md
Last active April 18, 2024 12:45
Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace
@OrionReed
OrionReed / dom3d.js
Last active April 18, 2024 12:43
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@pwelch
pwelch / cloud-init_example.yml
Last active April 18, 2024 12:43
Cloud-init Example Configuration
#cloud-config
package_upgrade: true
packages:
- zsh
- tmux
- nmap
- curl
- wget
- git
- htop
@plentz
plentz / nginx.conf
Last active April 18, 2024 12:42
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nakamuraos
nakamuraos / reset-trial-navicat.sh
Last active April 18, 2024 12:40
Reset trial Navicat 15, Navicat 16 on Linux
#!/bin/bash
# Author: NakamuraOS
# https://github.com/nakamuraos
# Latest update: 30/03/2022
# Tested on Navicat 15.x, 16.x on Linux
RED="\e[1;31m"
ENDCOLOR="\e[0m"
@csobankesmarki
csobankesmarki / convert private key
Last active April 18, 2024 12:39
Convert OpenSSH ED25519 to OpenSSL ED25519
(printf \\x30\\x2e\\x02\\x01\\x00\\x30\\x05\\x06\\x03\\x2b\\x65\\x70\\x04\\x22\\x04\\x20;egrep -v "^-" | tr -d '\n' | base64 -d | dd bs=161 skip=1 2>/dev/null | dd bs=32 count=1 2>/dev/null) | openssl pkey -inform der -outform pem
@jclosure
jclosure / osx_hardening
Created May 10, 2016 14:59
The Ultimate OS X Hardening Guide Collection
Apple: http://www.apple.com/support/security/guides/
NSA Guide: http://www.nsa.gov/ia/_files/factsheets/macosx_hardening_tips.pdf
Mac Shadows: http://www.macshadows.com/kb/index.php?title=Hardening_Mac_OS_X
Univ. Texas: https://wikis.utexas.edu/display/ISO/Mac+OS+X+Server+Hardening+Checklist
Center for Internet Security: http://benchmarks.cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.os.unix.osx
@mklepaczewski
mklepaczewski / obsidian.css
Created August 10, 2020 09:54
Note blocks for Obsidian
/**
* I use .app-container to get around CSS selector specificity
*/
.app-container pre[class*="language-note-"] {
border: 1px solid;
}
/* Make the first line of note bold */
*[class*="language-note"]::first-line {
@imartinez
imartinez / fastapi_streaming_local_llama2.py
Created September 26, 2023 17:21
FastAPI streaming local Llama 2 GGUF LLM using LLamaIndex
import uvicorn
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
from typing import AsyncGenerator
from llama_index.llms import LlamaCPP
from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt
llms = {}