Skip to content

Instantly share code, notes, and snippets.

View Cosmicoppai's full-sized avatar
👾

Cosmic Oppai Cosmicoppai

👾
View GitHub Profile
@derlin
derlin / DockerCassandra-InitDb.md
Last active August 19, 2024 10:16
Dockerfile and entrypoint example in order to easily initialize a Cassandra container using *.sh/*.cql scripts in `/docker-entrypoint-initdb.d`

Initializing a Cassandra Docker container with keyspace and data

This gist shows you how to easily create a cassandra image with initial keyspace and values populated.

It is very generic: the entrypoint.sh is able to execute any cql file located in /docker-entrypoint-initdb.d/, a bit like what you do to initialize a MySQL container.

You can add any *.sh or *.cql scripts inside /docker-entrypoint-initdb.d, but note that:

  • *.sh files will be executed BEFORE launching cassandra
@michalmonday
michalmonday / union_find.py
Last active March 18, 2022 12:39
Detect cycle in an undirected graph (python)
#python3
# It's simpler version of the example posted at:
# https://www.geeksforgeeks.org/union-find/
class Graph:
edges = set()
def add_edge(self, src, dst):
'''Each edge has 2 vertices: source and destination.'''

How to intercept all SSL connections from an Android x86 VM

This guide shows how to setup an Android VM in order to intercept all HTTPS requests. This was originally intended to reverse PlayServices but should work with any app that does not use certificate pinning (i.e. every app that relies on the system certificate authorities).

Inspired by this guide how to install Android x86 in VirtualBox, this guide how to install a system certificate on Android and this guide how to use mitmproxy with VirtualBox.

  1. Download a recent Android x86 ISO from here.

  2. Download a recent Kali Linux VirtualBox Image from here. (You can also use an

@wcarhart
wcarhart / bash_tidbits.md
Last active July 13, 2024 22:54
Helpful Bash design patterns

Helpful Bash tidbits

@qpwo
qpwo / dijkstra.py
Last active September 22, 2022 21:01 — forked from potpath/dijkstra.py
Dijkstra's Algorithm in python using PriorityQueue. Quits early upon goal discovery. More like uniform cost search actually. Fast.
from queue import PriorityQueue # essentially a binary heap
def dijkstra(G, start, goal):
""" Uniform-cost search / dijkstra """
visited = set()
cost = {start: 0}
parent = {start: None}
todo = PriorityQueue()
todo.put((0, start))
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active September 17, 2024 17:00
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@Nikhil2919
Nikhil2919 / Assignment-3.py
Created February 5, 2017 18:54
Introduction to Data Science in Python Assignment-3
# coding: utf-8
# ---
#
# _You are currently looking at **version 1.5** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._
#
# ---
# # Assignment 3 - More Pandas
@machikoyasuda
machikoyasuda / vocabulary.md
Created September 20, 2016 17:13
Japanese/English programming/tech vocabulary

----- Tech -----

拡張現実【かくちょうげんじつ】 augmented reality, AR

投資家【とうしか】 investor

静的【せいてき】 static

def delete_first(self):
deleted = self.head
if self.head:
self.head = self.head.next
deleted.next = None
return deleted
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active August 21, 2024 03:30
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.