Skip to content

Instantly share code, notes, and snippets.

@timmc
timmc / pwned-passwords-sqlite-build.py
Last active March 29, 2023 15:51
Building a sqlite DB for the Pwned Passwords data
#!/usr/bin/env python3
# Build a SQLite3 DB for looking up SHA-1 hashes of leaked passwords.
#
# This can be fed the txt file from one of Have I Been Pwned's hash
# lists available from https://haveibeenpwned.com/Passwords -- but any
# text file with line format ``hash-hex:count`` will work.
#
# When run on the v5 hash-ordered SHA-1 file, expect the build to take
# about 35 minutes and produce a 15.7 GiB file (~30.5 bytes per record).
#
@miguelmota
miguelmota / send.sh
Created January 16, 2019 06:19
Golang UDP server example
echo 'hello world' > /dev/udp/0.0.0.0/3000
@TheYarin
TheYarin / clear-folder-on-creation.sh
Created January 13, 2019 17:27
Clear a folder when it is "created". For example, when a flash drive is connected and mounted to /path/to/containing/folder, clear the folder inside of it named FOLDER_NAME
inotifywait -mq --format '%w%f/FOLDER_NAME/' --event=CREATE /path/to/containing/folder | while read DIR_TO_CLEAR
do
echo "$DIR_TO_CLEAR"
sleep 1
find "$DIR_TO_CLEAR" -delete
mkdir -p "$DIR_TO_CLEAR"
done
@TheYarin
TheYarin / check-internet.sh
Last active June 10, 2019 06:16
Log internet connection failures
#!/bin/bash
# Hit Ctrl+C a lot of times to stop
# Ping google's 8.8.8.8 DNS server
while true; do
timeout 1 ping -q -c 1 8.8.8.8 > /dev/null && echo $(date +%Y/%m/%d_%H:%M:%S) GOOD && sleep 1 || echo $(date +%Y/%m/%d_%H:%M:%S) NO INTERNET;
done
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@gpchelkin
gpchelkin / dante_setup.sh
Last active August 22, 2023 06:45
How to Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04 / 20.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build5_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@matthewzring
matthewzring / markdown-text-101.md
Last active May 4, 2024 12:26
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@karllhughes
karllhughes / 1-side-project-marketing-checklist.md
Last active April 6, 2023 23:52
Side Project Checklist Marketing

Setup Work

  • Make a list of competitive/alternative services: See competitors.md file
  • Set up Google News alerts for "side project marketing" and "startup marketing".
  • Make list of blogs, subscribe to RSS feeds in Feedbin:
    • Startup marketing blogs
    • Side project blogs
    • Small business marketing blogs
    • Chicago small business/startup bloggers
  • Come up with a name and domain name