Skip to content

Instantly share code, notes, and snippets.

@adtac
adtac / Dockerfile
Last active August 25, 2024 05:52
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@erikig
erikig / common-domain-prefix-suffix-list.tsv
Last active September 16, 2024 13:52
Top 5000 Most Common Domain Prefix/Suffix List - Courtesy LeanDomainSearch - https://leandomainsearch.com/top-domain-name-prefixes-and-suffixes/, Google Sheets version with changes to domain length - https://docs.google.com/spreadsheets/d/1BzZJ7BNek7ssUB2hWc6ChdF-mxN7QOE4U380Qx8uvR8/edit#gid=1626652908
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@spyesx
spyesx / youtube_watch_later.js
Last active June 16, 2024 13:38
Get URLs of your youtube watch later playlist
// Execute this in the console of on your own playlist
var videos = document.querySelectorAll('.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer');
var r = [];
var json = [];
r.forEach.call(videos, function(video) {
var url = 'https://www.youtube.com' + video.getAttribute('href');
url = url.split('&list=WL&index=');
url = url[0];
public static class DisposeDriverService
{
private static readonly List<string> _processesToCheck =
new List<string>
{
"opera",
"chrome",
"firefox",
"ie",
"gecko",
[TestClass]
public class BingTests
{
private static IWebDriver _driver;
[AssemblyInitialize]
public static void AssemblyInitialize(TestContext testContext)
{
DisposeDriverService.TestRunStartTime = DateTime.Now;
_driver = new ChromeDriver();
@natemcmaster
natemcmaster / README.md
Last active August 4, 2024 18:15
ContentRoot, WebRoot, BaseDirectory, and CurrentDirectory

Assuming you use template defaults

public static void Main()
{
  var host = new WebHostBuilder()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .Build();
}

public Startup(IHostingEnvironment env)
@gashupl
gashupl / Program.cs
Created September 30, 2016 11:34
RSA Encrypting & Descrypting in C# sample
using System;
using System.Security.Cryptography;
using System.Text;
namespace RsaEncryptionSample
{
class Program
{
static void Main(string[] args)
{
@davidfowl
davidfowl / dotnetlayout.md
Last active September 17, 2024 18:14
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing