Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🎨
Being creative!

Daniel Andersson danielandersson

👨‍🎨
Being creative!
View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active Feb 25, 2021
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@jdarpinian
jdarpinian / executable.c
Last active Feb 27, 2021
Add one line to your C/C++ source to make it executable.
View executable.c
///bin/true;COMPILER_OPTIONS="-g -Wall -Wextra --std=c99 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
@worawit
worawit / eternalblue8_exploit.py
Last active Jun 4, 2020
Eternalblue exploit for Windows 8/2012
View eternalblue8_exploit.py
#!/usr/bin/python
# This file has no update anymore. Please see https://github.com/worawit/MS17-010
from impacket import smb, ntlm
from struct import pack
import sys
import socket
'''
EternalBlue exploit for Windows 8 and 2012 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
@worawit
worawit / eternalblue7_exploit.py
Last active Sep 22, 2020
Eternalblue exploit for Windows 7/2008
View eternalblue7_exploit.py
#!/usr/bin/python
# This file has no update anymore. Please see https://github.com/worawit/MS17-010
from impacket import smb
from struct import pack
import sys
import socket
'''
EternalBlue exploit for Windows 7/2008 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
View gist:e22e50cd52b7dffcf5a4db2b8ea4cce0

To the members of the MIT community:

We are writing to inform you of plans to upgrade the MIT campus network, and in particular to upgrade MIT to the next generation of Internet addressing. (Please note that no action is required on your part.)

Machines on the Internet are identified by addresses. The current addressing scheme, called IPv4, was specified around 1980, and allowed for about 4 billion addresses. That seemed enough at the time, which was before local area networks, personal computers and the like, but the Internet research community recognized around 1990 that this supply of addresses was inadequate, and put in place a plan to replace the IPv4 addresses with a new address format, called IPv6. IPv6 uses a 128-bit address scheme and is capable of 340 undecillion addresses (340 times 10^36, or 340 trillion trillion trillion possible IP addresses). This stock of addresses allows great flexibility in how addresses are assigned to hosts, for example allowing every host to use a range of addresses to

View 0-rate-limiters.md

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@Gronis
Gronis / zipcodes.json
Last active Mar 2, 2017
Use Swedish zipcodes to get access to municipality, county, city and gps-coordinates
View zipcodes.json
[{"zipcode":10005,"municipality":["Norrtälje"],"city":"Stockholm","county":"Stockholms Län","lat":59.300064,"lng":19.084435},
{"zipcode":10012,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10026,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10028,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10029,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10031,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10040,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10041,"municipality":["Stockholm"],"city":"Stockholm","county":"Stockholms Län","lat":59.333895,"lng":18.06487},
{"zipcode":10044,"municipality
@Arinerron
Arinerron / root.sh
Last active Jan 21, 2021
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
View root.sh
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
View FixFbxModelPostprocessor.cs
/**
* Author: David Asmuth
* Contact: piranha771@gmail.com
* License: Public domain
*
* Converts the .fbx model
* from Blender orientation system (Z is up, Y is forward)
* to the Unity3D orientation system (Y is up, Z is forward)
*/
using System.IO;