Skip to content

Instantly share code, notes, and snippets.

View shakkhar's full-sized avatar

Mashiat Shakkhar shakkhar

View GitHub Profile
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@vasanthk
vasanthk / System Design.md
Last active June 17, 2024 10:07
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@joecampo
joecampo / fail2ban.md
Last active May 25, 2024 14:17
fail2ban – stop HTTP(S) route abuse/brute forcing

If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.

Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,

@torgeir
torgeir / resize-home-folder-partition-on-ubuntu-snappy-core-on-the-raspberry-pi-2.md
Last active January 27, 2023 14:36
Resize home folder partition on ubuntu snappy core on the raspberry pi 2

Note where home is

(RaspberryPi2)root@localhost:~# df -h /home/
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p4   1.6G 1.3G   160M  89% /oem
(RaspberryPi2)root@localhost:~# df -h
@buhman
buhman / 00 wpa_cli passphrase network
Last active March 8, 2023 21:51
all wpa_cli ommands can be tab-completed
localhost ~ # cat <<EOF> /etc/wpa_supplicant.conf
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel
update_config=1
EOF
localhost ~ # wpa_supplicant -iwlp1s0 -Dnl80211 -c/etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
localhost ~ # wpa_cli
wpa_cli v2.0
Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi> and contributors
@atenni
atenni / README.md
Last active June 17, 2024 02:30
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@dwbuiten
dwbuiten / gist:5490255
Last active December 16, 2015 20:09
Hacky script for compiling dynamic MediaInfo
#!/bin/sh -e
# Replace with whatever versions you need
ZEN_VERSION=0.4.29
LIB_VERSION=0.7.63
MED_VERSION=0.7.63
PREFIX=/usr/local
wget http://mediaarea.net/download/source/libzen/${ZEN_VERSION}/libzen_${ZEN_VERSION}.tar.bz2
wget http://mediaarea.net/download/source/libmediainfo/${LIB_VERSION}/libmediainfo_${LIB_VERSION}.tar.bz2
anonymous
anonymous / gist:5423293
Created April 19, 2013 21:16
class Dp:
my_attr = 'foo'
funs = []
for attr in ('my_attr', 'doesnt_exist', 'my_attr'):
funs.append(lambda obj: getattr(dp, attr))
dp = Dp()
for fun in funs:
print fun(dp)
@lbolla
lbolla / futures_test.py
Last active April 24, 2023 17:59
Tornado and concurrent.futures
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble