Skip to content

Instantly share code, notes, and snippets.

@nick-jiang
nick-jiang / captcha.py
Last active May 1, 2024 19:03
Create simple captcha image using PIL.
#!/usr/bin/env python
# _*_ encoding: utf-8 _*_
import random
import string
from PIL import Image, ImageDraw, ImageFont, ImageFilter
CHARS = string.digits + string.letters
def create_captcha(loc='media/fonts', size=(120, 30), chars=CHARS, amount=6, img_type='GIF', mode='RGB',

Linux 命令行编辑快捷键

初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。

  • 命令行快捷键:
    • 常用:
      • Ctrl L :清屏
  • Ctrl M :等效于回车
@utlandr
utlandr / biqu_microprobe.cfg
Last active May 1, 2024 19:02
Klipper probe config for the BIQU Microprobe (V1/V2)
## --- BIQU Microprobe Klipper configuration ---
# Not much different from a standard probe config. The
# main difference compared to most probes is to disable
# deactivating the probe (PROBE_UP) after each sample
#
# You can either copy pasta this directly or import
# into your config.yml using [include microprobe.cfg]
#
# Note: if you are changing from a bltouch or one of its
# clones, remove/comment out the [bltouch] config!
@Hakky54
Hakky54 / openssl_commands.md
Last active May 1, 2024 19:01 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@JBlond
JBlond / bash-colors.md
Last active May 1, 2024 18:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 1, 2024 18:55
set -e, -u, -o, -x pipefail explanation
@0xblackbird
0xblackbird / open-redirect.md
Created April 1, 2021 19:04
Open redirect bypasses
@arshednabeel
arshednabeel / vicsek.py
Last active May 1, 2024 18:53
A minimal implementation of the Vicsek model in ~50 lines of code
import numpy as np
from tqdm import trange
def get_neighbour_matrix(x, L, R):
dx = np.subtract.outer(x[:, 0], x[:, 0])
dy = np.subtract.outer(x[:, 1], x[:, 1])
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2
pair_dist = dx ** 2 + dy ** 2
@TrevorJTClarke
TrevorJTClarke / BrowserDeviceInfo.js
Created September 1, 2015 17:52
A quick list of browsers and devices for use in testing. Chrome is used for all devices that need simulation.
var devices = [
{ name: 'Desktop - Huge', width: 2880, height: 1800, ratio: 2, type: 'desktop' },
{ name: 'Desktop - Extra Large', width: 1920, height: 1080, ratio: 1, type: 'desktop' },
{ name: 'Desktop - Large', width: 1440, height: 900, ratio: 1, type: 'desktop' },
{ name: 'Desktop - HiDPI', width: 1366, height: 768, ratio: 1, type: 'desktop' },
{ name: 'Desktop - MDPI', width: 1280, height: 800, ratio: 1, type: 'desktop' },
{ name: 'Laptop with HiDPI screen', width: 1440, height: 900, ratio: 2, type: 'desktop' },
{ name: 'Laptop with MDPI screen', width: 1280, height: 800, ratio: 1, type: 'desktop' },
{ name: 'Laptop with touch', width: 1280, height: 950, ratio: 1, type: 'desktop' },
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1, type: 'tablet' },