Skip to content

Instantly share code, notes, and snippets.

View CMGS's full-sized avatar
🎯
Focusing

CMGS CMGS

🎯
Focusing
View GitHub Profile
@jeffery
jeffery / GitRepoUpdateTimestamp.sh
Created July 30, 2011 13:04
Update Timestamp of files in Checked-out Git Repository
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@zheplusplus
zheplusplus / tukasans.py
Last active August 29, 2015 13:59
つかさンス ASCII Art Font
import sys
import json
FIXED_WIDTH = len('_________')
FIXED_HEIGHT = 6
def map_characters(string, typo_group):
return {
string[col]: [typo_group[row][col * (1 + FIXED_WIDTH):
@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@AgentOak
AgentOak / youtube_formats.md
Last active May 5, 2024 18:03
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
@torch2424
torch2424 / systemDAsUser.service
Last active October 27, 2023 07:53
Run a systemd service as a user
# How to create systemd services: http://neilwebber.com/notes/2016/02/10/making-a-simple-systemd-file-for-raspberry-pi-jessie/
# Digital ocean on a mongodb service: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
[Unit]
Description=Run SystemD as users
After=network.target
[Service]
Type=simple
User=[USER HERE]
WorkingDirectory=[USER HOME]
@rambolee
rambolee / xiaomi-tv-3-root-youtube-note.md
Last active November 22, 2021 02:48
[小米盒子3 增强版 : Root + Youtube 配置笔记]小米盒子3 增强版 : Root + Youtube 配置笔记 #小米盒子3增强版 #小米盒子3 #root #youtube #kingroot #Google

小米盒子3 增强版 : Root + Youtube 配置笔记

前提

  • 路由器已经「移民」,参考 这篇 Gist

  • 别人家的效果图(新的 MIUI -- 应用部分展示略有不同)

  • 当前成功(有效)方案实现日期:2017年10月08日

@cowboy
cowboy / Dockerfile
Created February 1, 2018 15:00 — forked from tasuten/Dockerfile
Building container for https://github.com/be5invis/Iosevka
FROM ubuntu
RUN apt-get update
RUN apt-get install -y build-essential curl
# NodeJS >= 6.0
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
# ttfautohint
@insdavm
insdavm / wireguard-over-tcp.md
Last active April 29, 2024 20:09
WireGuard over TCP with udptunnel

WireGuard over TCP with udptunnel

udptunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection. Its primary purpose (and original motivation) is to allow multi-media conferences to traverse a firewall which allows only outgoing TCP connections.

Server

# udptunnel -s 443 127.0.0.1/51820

Client