Skip to content

Instantly share code, notes, and snippets.

@cgrothaus
cgrothaus / check-compromised-npm-packages-pnpm-lock.zsh
Last active September 22, 2025 06:07
Script to check for compromised npm packages in pnpm-lock.yaml (npm supply chain attack of September 2025)
#!/usr/bin/env zsh
# Script to check for compromised npm packages in monorepos using pnpm, grepping through pnpm-lock.yaml.
# Usage: zsh check-compromised-npm-packages-pnpm-lock.zsh [path-to-pnpm-lock.yaml]
#
# Background: news on supply chain attacks in npm packages of September 2025
# 1.
# - https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised
# - https://news.ycombinator.com/item?id=45169794
# 2.
@tomerof
tomerof / vue3-pwa.md
Last active June 10, 2025 16:28
To turn a Vue 3 app into a PWA

To turn a Vue 3 app into a PWA, you can follow these steps:

  1. Create a manifest.json file in the public folder of your Vue 3 app. This file contains metadata about your PWA, such as the app name, icon, and theme color. Here's an example:
{
  "name": "My Vue 3 App",
  "short_name": "My App",
  "icons": [
    {
 "src": "img/icons/android-chrome-192x192.png",
@Artyem-Y
Artyem-Y / .block
Created October 2, 2020 10:56
D3.js zoomable sunburst with breadcrumb navigation and labels, alasql/JSON, end-node hyperlinks
license: mit
@Graf-Zahl
Graf-Zahl / .env
Created April 3, 2020 07:57
jitsi meet for nginx-proxy and letsencrypt-proxy
# Directory where all configuration will be stored.
CONFIG=./jitsi-meet-cfg
# System time zone.
TZ=Europe/Amsterdam
# Public URL for the web service.
PUBLIC_URL=https://mydomain.org
# Virtual host for nginx proxy
@normal-carrot
normal-carrot / Readme.md
Last active April 29, 2025 21:46
Docker + nginx-proxy + let's encrypt + watchtower + fail2ban

Complete solution for websites hosting

This gist contains example of how you can configure nginx reverse-proxy with autmatic container discovery, SSL certificates generation (using Let's Encrypt) and auto updates.

Features:

  • Automatically detect new containers and reconfigure nginx reverse-proxy
  • Automatically generate/update SSL certificates for all specified containers.
  • Watch for new docker images and update them.
  • Ban bots and hackers who are trying to bruteforce your website or do anything suspicious.
@Pulimet
Pulimet / AdbCommands
Last active October 22, 2025 08:20
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@alexellis
alexellis / arm.md
Last active July 12, 2025 08:12
Test swarm connectivity

Regular PC / cloud architecture (64-bit)

See the snippets "guide.md" and "redis.md" below.

Swarm on a Raspberry Pi

If you're wanting to run Docker Swarm on your Raspberry Pi checkout these instructions:

@BretFisher
BretFisher / docker-swarm-ports.md
Last active August 12, 2024 16:10
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

// Moment.js is a great library because of its shortcut methods for setting various properties on
// date-like Objects. These methods are used heavily in the function used to set the "sleep time"
// boundaries that bookend the calendar events correctly based on the time zone of the client.
const moment = require('moment');
// This function is the code entry point. Start following the code from here.
function main() {
// These calendar events should look similar to the ones that come back from the API. Their start
// and end dates are ISO Strings. These String values will have to be converted into Date Objects
// in order to be compared. They will also be converted into moment Objects in order to be
@jcataluna
jcataluna / gist:1dc2f31694a1c301ab34dac9ccb385ea
Created July 8, 2016 17:23
Script to save all images from a docker-compose.yml file
#!/bin/bash
mkdir -p out
for img in `grep image $1| sed -e 's/^.*image\: //g'`;
do
cleanname=${img/\//-}
tag=`docker images | grep $img | awk '{print $2}'`
echo "Exporting image: $img, tag:$tag ($cleanname)..."
docker save $img -o out/$cleanname.tar