Skip to content

Instantly share code, notes, and snippets.

@glimpsed
glimpsed / Selective VPN traffic routes.txt
Last active December 22, 2024 01:42
How to route network traffic through a VPN (OpenVPN/TunnelBlick) ONLY for specific websites/IPs only on macOS / OS X (static routing)
Add the following line at the top of your .ovpnfile to prevent it from routing all network traffic on your Mac through
the VPN:
route-nopull
Next add the following line to allow the VPN to reroute traffic ONLY for a given IP address / domain (if you need to enable it
for a domain you can use its IP address):
route 1.2.3.4
@cemerson
cemerson / archive.org-scanned-book-downloader-bookmarklet.md
Last active December 22, 2024 01:41
Archive.org Scanned Book Downloader Bookmarklet

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?

@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active December 22, 2024 01:38
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@stong
stong / cups-browsed.md
Last active December 22, 2024 01:34
CUPS disclosure leaked online. Not my report. The original author is @evilsocket

Original report

  • Affected Vendor: OpenPrinting
  • Affected Product: Several components of the CUPS printing system: cups-browsed, libppd, libcupsfilters and cups-filters.
  • Affected Version: All versions <= 2.0.1 (latest release) and master.
  • Significant ICS/OT impact? no
  • Reporter: Simone Margaritelli [evilsocket@gmail.com]
  • Vendor contacted? yes The vendor has been notified trough Github Advisories and all bugs have been confirmed:
@asheroto
asheroto / Get-AdobeAcrobatReaderDCUrls.ps1
Last active December 22, 2024 01:33
Retrieve direct download URLs for Adobe Reader DC by parsing the release notes page.
[CmdletBinding()]
param ()
# Function to get the latest version and download URL of Adobe Acrobat Reader DC
function Get-AdobeAcrobatReaderDCUrls {
[CmdletBinding()]
param ()
# URL of the Adobe Acrobat Reader DC release notes page
$apiUrl = 'https://helpx.adobe.com/acrobat/release-note/release-notes-acrobat-reader.html'
@maxim
maxim / Excellent Karaoke Setup Guide.md
Last active December 22, 2024 01:23
An excellent high quality karaoke setup for under $1000

Excellent high quality karaoke setup for under $1000

For my Vietnamese wife a good karaoke setup is serious business. Problem is, I noticed that some people spend thousands of dollars on unnecessary stuff like gigantic receivers and speakers, only to end up with hiss, clipping, and clunky operation. Smart/consistent home setup should definitely fit under $1000, and that's with speakers and expensive Nvidia Shield box. You could definitely cut it to under $500 and still have a great setup. I did some research and put together a convenient setup for amazing quality at-home karaoke that isn't worth thousands, isn't a chore to operate, and passes Asian quality standards with flying colors.

How to use this setup once it's ready:

  1. You find any song on your phone's Youtube and cast it to your TV
  2. You pick up the microphone, start singing, and it all just sounds surprisingly beautiful

This guide assumes that you already have a TV with HDMI ARC or Optical/Coaxial audio output, and that you have WiFi at home.

@SaeedDev94
SaeedDev94 / #tunnel-xray
Last active December 22, 2024 01:20
Asuswrt-Merlin: Tunnel clients with XTLS/Xray-core
#!/bin/sh
REMOTE_SERVER="x.x.x.x"
INBOUND_ADDR="127.0.0.1"
INBOUND_PORT="10888"
TPROXY_CHAIN="XRAY_TPROXY"
GATEWAY_CHAIN="XRAY_GATEWAY"
EXCLUDE_MARK="5"
@grisha765
grisha765 / 6in4.rsc
Created December 22, 2024 01:14
6in4 update Dyn IP with api for mikrotik
# MikroTik Script: 6in4.rsc
# Purpose: Update PPPoe IP dynamically
:local apiKey "api_key"
:local tunnelId "tunnel_id"
:local fileName "last_pppoe_ip2.txt"
:local lastIP
:local currentIP
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active December 22, 2024 01:20
Xcode KeyBindings as VSCode
@leandronsp
leandronsp / 001-server.bash
Last active December 22, 2024 01:17
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}