Skip to content

Instantly share code, notes, and snippets.

View Fazel94's full-sized avatar
💭
In search of answers for fundamental questions of software engineering :-D

Mohamad Fazeli Fazel94

💭
In search of answers for fundamental questions of software engineering :-D
  • Maktabkhooneh.org
  • Tehran, Iran
View GitHub Profile
@fonsecas72
fonsecas72 / gist:0ef04265a3d0c5822e5d441b8d2de1f8
Created January 11, 2021 16:39
Installing polipo on ubuntu 20.04 20.10
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/polipo/polipo_1.1.1-8_amd64.deb
sudo dpkg -i polipo_1.1.1-8_amd64.deb

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@llandeilocymro
llandeilocymro / camera.py
Created February 11, 2019 12:49
MOBOTIX - Default username PoC
#!/usr/bin/python
import requests, signal, sys, argparse
from requests.auth import HTTPBasicAuth
p = argparse.ArgumentParser("./camera.py -h <ip> -p <port>", version="0.1")
p.add_argument("-ip", "--ipaddress", dest="ipaddress", help="Enter an ipaddress")
p.add_argument("-p", "--port", dest="port", default="8081", help="Enter a port")
args = p.parse_args()
@roycewilliams
roycewilliams / mdxfind-is-awesome.txt
Last active October 17, 2022 21:43
mdxfind-is-awesome.txt
#
# The word 'password', hashed with many unsalted hash types, up to 5 iterations deep
# Courtesy MDXfind - https://hashes.org/mdxfind.php
# (Mirror: https://www.techsolvency.com/pub/bin/mdxfind/)
# Source: https://gist.github.com/roycewilliams/5e8d676ac4fe54fb7b6cb233b0721f57
#
# See also:
# https://github.com/roycewilliams/kens-salty-rainbow # Common default descrypt hashes
# https://gist.github.com/roycewilliams/794e4d7a81e7840deae29fdc7c03fa10 # 10k rounds MD5
# https://gist.github.com/roycewilliams/1c8044e40ed0716f99a773036a8891ac # 10k rounds SHA1
@lgallen
lgallen / doc2vec_hyperparameters.txt
Last active September 18, 2019 16:18
Helpful hyper-parameters for training doc2vec
#doc2vec parameters
vector_size = 300
window_size = 15
min_count = 1
sampling_threshold = 1e-5
negative_size = 5
train_epoch = 100
dm = 0 #0 = dbow; 1 = dmpv
worker_count = 1 #number of parallel processes
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active July 9, 2024 15:59
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mdonkers
mdonkers / server.py
Last active July 22, 2024 13:51
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@Ara4Sh
Ara4Sh / gist:863e4796801f0453460faddb78e0ea62
Created March 26, 2017 07:51
Nginx Redirect if useragent is android or iphone
# 1
location / {
set $mobile 0;
if ($http_user_agent ~* "iphone|android") {
set $mobile 1;
}
if ($mobile = 1) {
# return or rewrite to somewhere
}
}
@bynil
bynil / config-git-proxy.txt
Last active January 23, 2024 12:37
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@mahmoud
mahmoud / scheme_port_map.json
Last active December 12, 2022 17:42
A big mapping url schemes to their protocols' default ports. See comments below for notes. Painstakingly assembled by crossreferencing https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml and https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
{
"acap": 674,
"afp": 548,
"dict": 2628,
"dns": 53,
"file": null,
"ftp": 21,
"git": 9418,
"gopher": 70,
"http": 80,