Skip to content

Instantly share code, notes, and snippets.

@maxweisspoker
maxweisspoker / dockerfile-command
Last active November 2, 2025 11:42
Bash alias to print "Dockerfile" for image by using sed with "docker history"
alias dockerfile='script.sh'
script.sh:
#!/bin/bash
echo "FROM scratch"
docker history --no-trunc $@ | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && , \\\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*\s*[kMG]*B\s*$,,g' | head -n -1
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 5, 2026 15:36
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@maxfischer2781
maxfischer2781 / async_read.py
Last active October 24, 2025 06:10
example implementation for an async event loop
import time
import select
import socket
class AsyncSleep:
"""Event and action to sleep ``until`` a point in time"""
def __init__(self, until):
self.until = until
@RayOnFire
RayOnFire / cookie_string_to_dict.py
Last active September 13, 2023 12:07
[Python Cookie To Dict]Convert cookie string to dict #Python #http
@coady
coady / requests.ipynb
Created September 28, 2015 04:09
Parallel http requests.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barryvdh
barryvdh / _ide_helper.json
Created August 19, 2014 07:49
Laravel 4 IDE Helper in JSON format for https://shiftedit.net/ (created using https://github.com/barryvdh/laravel-ide-helper with `--format=json` option)
{
"php": {
"classes": {
"App": {
"functions": {
"__construct": "($request = null)",
"bindInstallPaths": "($paths)",
"getBootstrapFile": "()",
"startExceptionHandling": "()",
"environment": "()",
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 6, 2026 09:46
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@zhangyoufu
zhangyoufu / gist:5814814
Created June 19, 2013 14:36
JNIEnv functions table, helpful when reverse engineering JNI
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
typedef int jint;
typedef int jclass;
typedef int jobject;
typedef int jmethodID;
typedef int jfieldID;
typedef int JNIEnv;
@fxsjy
fxsjy / SimpleAuthServer.py
Created April 26, 2013 06:23
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@smoser
smoser / gist:4756561
Last active November 8, 2023 15:20
boot a cloud image in kvm
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
$ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## download the image
$ wget $img_url -O disk.img.dist
## Create a file with some user-data in it