Skip to content

Instantly share code, notes, and snippets.

@chrisjacob
chrisjacob / README.md
Created February 14, 2011 14:31
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).

@amanelis
amanelis / nmap.md
Created February 4, 2013 07:02
A thorough guide to NMAP.

#NMAP Guide

  1. Basic scan to see what ports have a valid service running on them:

    nmap {host} nmap -v {host}

Pass the -v flag to print a little more information.

@wrburgess
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 14, 2024 14:27
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@ziadoz
ziadoz / download.sh
Last active April 17, 2021 19:37
Download Websites with WGet
# WGet Manual: http://www.gnu.org/software/wget/manual/wget.html
# Link Checker: http://wummel.github.io/linkchecker/
# Archiving URLs: http://www.gwern.net/Archiving%20URLs
# Download Webpage: http://superuser.com/questions/55040/save-a-single-web-page-with-background-images-with-wget
# Output Directory: http://stackoverflow.com/questions/8986139/wget-output-directory-prefix
# WARC Files: http://www.archiveteam.org/index.php?title=Wget_with_WARC_output
# Add -r or --recursive to get the whole website.
wget -T 10 -e robots=off -E -H -k -K -p -nH -nd -P /path/to/dir [URL]
wget --timeout 10 --execute robots=off --adjust-extension --span-hosts --convert-links --backup-converted --page-requisites --random-wait --no-host-directories --no-directories --directory-prefix --mirror --html-extension /path/to/dir [URL]
@JamieMason
JamieMason / unfollow.js.md
Last active April 6, 2024 19:01
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 19, 2024 18:25
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@thebouv
thebouv / ducks.sh
Last active April 1, 2024 18:11
ducks: linux command for the 10 largest files in current directory
du -cks * | sort -rn | head -11
# Usually set this up in my bash profile as an alias:
# alias ducks='du -cks * | sort -rn | head -11'
# Because it is fun to type ducks on the command line. :)
@sighmin
sighmin / Loops and Functions Go Tour Exercise
Last active August 21, 2019 18:39
Go tour sqrt VS newton's method: http://tour.golang.org
package main
import (
"fmt"
"math"
)
func Newt(x float64) float64 {
if x == 0 { return 0 }
z := 1.0
import
asyncdispatch, asyncnet, htmlparser, xmltree, httpclient, strutils,
strtabs, streams, uri, sets
var visited = initSet[string]()
proc crawl(url: string, client: PAsyncHttpClient = newAsyncHttpClient()) {.async.} =
if url in visited: return # Already visited this URL.
echo("Crawling ", url)
visited.incl(url)