Skip to content

Instantly share code, notes, and snippets.

View mckelvin's full-sized avatar

GitHubLeakedPAN, GitHubLeakedMyautsai mckelvin

View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@kevinzhow
kevinzhow / vpnserver.sh
Last active March 19, 2019 12:59
OnClickVPNServer
#!/usr/bin/env bash
echo 'deb http://shadowsocks.org/debian wheezy main' >> /etc/apt/sources.list
# Pre-requisites
sudo apt-get -y update
sudo apt-get -y install pptpd
sudo apt-get -y install fail2ban
sudo apt-get -y install shadowsocks-libev
@stackia
stackia / anti-dns-spoofing-iptables.sh
Created December 11, 2014 07:17
anti-dns-spoofing-iptables
#!/bin/bash
BADIP="74.125.127.102 74.125.155.102 74.125.39.102 74.125.39.113 209.85.229.138 128.121.126.139 159.106.121.75 169.132.13.103 192.67.198.6 202.106.1.2 202.181.7.85 203.161.230.171 203.98.7.65 207.12.88.98 208.56.31.43 209.145.54.50 209.220.30.174 209.36.73.33 211.94.66.147 213.169.251.35 216.221.188.182 216.234.179.13 243.185.187.39 37.61.54.158 4.36.66.178 46.82.174.68 59.24.3.173 64.33.88.161 64.33.99.47 64.66.163.251 65.104.202.252 65.160.219.113 66.45.252.237 72.14.205.104 72.14.205.99 78.16.49.15 8.7.198.45 93.46.8.89"
for IP in $BADIP
do
hexip=$(printf '%02X ' ${IP//./ }; echo)
#echo $hexip
iptables -I INPUT -p udp --sport 53 -m string --algo bm --hex-string "|$hexip|" --from 60 --to 180 -j DROP
iptables -I FORWARD -p udp --sport 53 -m string --algo bm --hex-string "|$hexip|" --from 60 --to 180 -j DROP
done
@davidpots
davidpots / 500 days of summer (timeline)
Created May 20, 2014 19:13
"500 Days of Summer" breakdown of the movie timeline
500 DAYS OF SUMMER -- breakdown of the movie timeline
by David Potsiadlo (@davidpots)
------------------------------------------------------------------------
============================================================================================================
THE ORDER SEEN IN THE MOVIE
============================================================================================================
488 0:00:51 on a bench, she has the ring
1 0:01:10 tom his his board meeting. jan 8th. when he first sees summer in his office.
@thewellington
thewellington / flushdns
Last active January 18, 2023 02:10
Flush DNS in OS X
#!/bin/bash
#
# flushdns
# This script will flush your DNS cache on Mac OS X 10.1 - 13.x
# The method for doing this chages it seems in every version of OS X,
# and I can never remember the correct command, so I wrote this script
# and gave it a name I could remeber.
#
# v.2022-11-03 by bill@wellingtonnet.net
# https://gist.github.com/thewellington/6736175
@millermedeiros
millermedeiros / osx_setup.md
Last active April 12, 2024 12:40
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@deltamobile
deltamobile / finalizer_example.go
Last active January 8, 2024 18:19
An example of the use of a finalizer (the runtime.SetFinalizer function) for a Go (golang) data structure. The documentation describes the expected signature for the function passed to SetFinalizer, but it is nice to see a running example. Tested with Go 1.1.2.
package main
import (
"fmt"
"runtime"
"time"
)
type Foo struct {
name string
@lotem
lotem / rime_deployer
Created April 26, 2013 03:22
使用 Squirrel 自帶的命令行工具 rime_dict_manager 和 rime_deployer
#!/bin/bash
#
# put this script in ~/Library/Rime, then deploy Rime for Squirrel:
# ./rime_deployer --build . "/Library/Input Methods/Squirrel.app/SharedSupport/"
# see other supported options:
# ./rime_deployer
DYLD_LIBRARY_PATH="/Library/Input Methods/Squirrel.app/Contents/Frameworks" "/Library/Input Methods/Squirrel.app/Contents/MacOS/rime_deployer" $@
@jasonberanek
jasonberanek / README.md
Last active January 29, 2018 18:59
Enabling VNC support in the VMware ESXi 5.x Firewall

VMware ESXi includes a built in VNC server that can be used to access a VMs console for manipulation via automated tools (e.g., veewee) or by users on platforms where the vSphere Client is not supported. In ESXi 5.x, the built-in firewall does not allow VNC traffic to be received by the VNC server, even when an individual VM is configured to support this configuration. To complete this activity, the firewall has to be modified to allow the appropriate ports.

The below script can be run via the ESXi command line to setup the firewall rules necessary to run VNC. A few items to note:

  • Scripts assumes the firewall rules file is the default provided as by 5.0.0 update 2 build 914586 and/or 5.1.0 build 799733 (may work in other versions)
  • In order to persist settings after a reboot, it is necessary to copy the firewall settings to either a specific datastore mapped to the host, or the local persistent storage linked under the /store directory. Further, the either the /etc/rc.local (ESXi 5.0) or `/etc/rc.local