Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 6, 2024 13:21
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@sundowndev
sundowndev / GoogleDorking.md
Last active May 6, 2024 13:17
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active May 6, 2024 13:16
CLI script to programmatically replace SSL certs on Synology NAS
#!/bin/bash
#
# *** For DSM v7.x ***
#
# How to use this script:
# 1. Get your 3 PEM files ready to copy over from your local machine/update server (privkey.pem, fullchain.pem, cert.pem)
# and put into a directory (this will be $CERT_DIRECTORY).
# Personally, I use this script (https://gist.github.com/catchdave/3f6f412bbf0f0cec32469fb0c9747295) to automate steps 1 & 4.
# 2. Ensure you have a user setup on synology that has ssh access (and ssh access is setup).
# This user will need to be able to sudo as root (i.e. add this line to sudoers, <USER> is the user you create):
@bmaupin
bmaupin / free-database-hosting.md
Last active May 6, 2024 13:15
Free database hosting
import Accelerate
/// This object provides easy color sampling of the `capturedImage` property of an ARFrame.
///
/// - Warning: This class is NOT thread safe. The `rawRGBBuffer` property is shared between instances
/// and will cause a lot of headaches if 2 instances try to simultaneously access it.
/// If you need multi-threading, make the shared buffer an instance property instead.
/// Just remember to release it when you're done with it.
class CapturedImageSampler {
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC1091
# shellcheck disable=SC2154
# PADD
#
# A more advanced version of the chronometer provided with Pihole
# SETS LOCALE
@xphyr
xphyr / README.md
Last active May 6, 2024 13:12
Running GPU Accelerated Games with OpenShift Virtualization

Running GPU Accelerated Games with OpenShift Virtualization

Introduction

The following document describes at a high level how one can use OpenShift Virtualization, an NVIDIA GPU, and VirtualGL to run hardware accelerated remote games.

Requirements

  • OpenShift 4.8 or Higher
  • OpenShift Virtualization 4.8 or higher
@sthiyaga
sthiyaga / CleanDevOrg
Created June 19, 2016 22:41
Apex script to delete all default data from a SFDC dev org.
// Execute Anonymous script to reset data from a Developer Edition
// NOTE -- this will delete ALL data, so run this only if you know what you are doing!
if ([SELECT OrganizationType FROM Organization][0].OrganizationType == 'Developer Edition') {
DELETE [Select ID from Campaign];
DELETE [Select ID from Lead];
DELETE [Select ID from Opportunity];
DELETE [Select ID from Solution];
DELETE [Select ID from Product2];
DELETE [Select ID from PriceBook2 where Name = 'Standard'];
DELETE [Select ID from Case];
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 13:11
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active May 6, 2024 13:07
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick