Skip to content

Instantly share code, notes, and snippets.

@erikhansen
erikhansen / load_all_sitemap_urls.sh
Last active May 20, 2024 03:21
Load all urls from a sitemap.xml file
#!/bin/bash
# This script crawls all urls in a /sitemap.xml file and loads them, effectively priming the cache
# Usage: ./warm_cache.sh www.example.com
time wget --quiet https://$1/sitemap.xml --output-document - | \
egrep -o "https?://[^<]+" | \
grep $1 | \
grep -v "jpg" | \
xargs -i -d '\n' curl --output /dev/null --silent --write-out '%{http_code} %{time_total}ms %{url_effective} \n' {}
@DragoshDX
DragoshDX / app.css
Created April 30, 2024 07:24
pedro spinner
body {
background: #161616;
margin: 0;
height: 100dvh;
display: grid;
place-content: center center;
}
.spinner {
@sharunkumar
sharunkumar / adb-dns.bat
Created February 7, 2020 07:08
Enabling / Disabling private DNS in android via ADB
rem to disable private dns
adb shell settings put global private_dns_mode off
rem to enable private dns with hostname (example with dns.adguard.com)
adb shell settings put global private_dns_mode hostname
adb shell settings put global private_dns_specifier dns.adguard.com
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 20, 2024 03:07
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@PaulCreusy
PaulCreusy / SelfSignWindowsExecutable.md
Last active May 20, 2024 03:05
How to self-sign a Windows executable created with Pyinstaller

How to self-sign a Windows package created with Pyinstaller

This document aims to explain all the necessary steps to self-sign a Windows executable.

⚠️ Warning
Some of the commands provided need to be completed. The fields to complete are indicated by the characters < and >.

Prerequisites

Please make sure to match all the prerequisite before starting the process of signing the package.

theory
Consensus_Demo
imports
Network
begin
datatype 'val msg
= Propose 'val
| Accept 'val
@gavinmcfarland
gavinmcfarland / .profile
Last active May 20, 2024 03:01
My Local Development Setup
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#Asteroids by @TokyoEdTech / Written in Python 3.5
#Part 0: Finished Demo
import os
import random
import time
import math
#Import the Turtle module
import turtle
@mrueg
mrueg / kernel-config-check.py
Last active May 20, 2024 02:59
Kernel config checker
#!/usr/bin/env python
# Checking installed packages using linux-info.eclass
# for necessary kernel options
import portage
vartree = portage.db[portage.root]['vartree']
all_cpvs = vartree.dbapi.cpv_all()
settings = portage.config()
@renatolfc
renatolfc / android-client.ovpn
Created December 28, 2014 18:59
A sample OpenVPN client configuration file in the unified format
client
dev tun
remote example.com
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
key [inline]