Skip to content

Instantly share code, notes, and snippets.

View huanle0610's full-sized avatar
๐ŸŽฏ
Focusing

huanle0610 huanle0610

๐ŸŽฏ
Focusing
  • Shenzhen, China
View GitHub Profile
@0xjac
0xjac / private_fork.md
Last active May 17, 2025 14:48
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@yegorg
yegorg / sysctl.conf
Created September 20, 2016 09:28
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@malexer
malexer / sqlalchemy_upsert.py
Last active January 26, 2024 14:09
Modelling UPSERT in SQLAlchemy (well actually it is not upsert but speed improvement is significant in comparison with simple session.merge)
# Note: it is a copy of great answer by "mgoldwasser" from Stackoverflow
# Check the original answer here: http://stackoverflow.com/a/26018934/1032439
# Imagine that post1, post5, and post1000 are posts objects with ids 1, 5 and 1000 respectively
# The goal is to "upsert" these posts.
# we initialize a dict which maps id to the post object
my_new_posts = {1: post1, 5: post5, 1000: post1000}
for each in posts.query.filter(posts.id.in_(my_new_posts.keys())).all():
@52cik
52cik / npm.taobao.sh
Last active May 6, 2025 07:01
npm ๆท˜ๅฎ้•œๅƒ้…็ฝฎ
npm set registry https://r.npm.taobao.org # ๆณจๅ†Œๆจกๅ—้•œๅƒ
npm set disturl https://npm.taobao.org/dist # node-gyp ็ผ–่ฏ‘ไพ่ต–็š„ node ๆบ็ ้•œๅƒ
## ไปฅไธ‹้€‰ๆ‹ฉๆทปๅŠ 
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 6, 2025 06:33
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@protrolium
protrolium / ffmpeg.md
Last active April 27, 2025 21:52
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@kathawala
kathawala / bigpkg.sh
Created January 17, 2015 20:41
Prints out a list of all pacman packages sorted by size from largest to smallest
#!/bin/bash
( echo "PACKAGE SIZE(K)";
for A in /var/lib/pacman/local/*/desc; do
egrep -A1 '%(NAME|SIZE)' $A \
| gawk '/^[a-z]/ { printf "%s ", $1 }; /^[0-9]/ { printf "%.0f\n", $1/1024 }'
done | sort -nrk2 ) | column -t
@uupaa
uupaa / Audio.WebAudio.Browser.Compat.md
Last active December 7, 2022 08:40
Audio, WebAudio, Blob, ArrayBuffer
  1. Audio(url)
  2. Audio(arraybuffer)
  3. Audio(blob)
  4. WebAudio(arraybuffer)
  5. WebAudio(blob)

Audio file access with streaming

http://uupaa.net/issues/3/ ใฎ็ตๆžœ

@cinsk
cinsk / check-nfs.sh
Last active August 29, 2024 16:00
Check if NFS mounted directory is stale
#!/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
check-nfs () {
local TMPFILE=/tmp/checknfs.$$ RET=0 ORPHAN SUBSHELLPID
if [ "$#" -eq 0 ]; then
cat<<EOF
usage: check-nfs NFS-DIRECTORY...