Skip to content

Instantly share code, notes, and snippets.

View 0312birdzhang's full-sized avatar
:accessibility:
Find a job

BirdZhang 0312birdzhang

:accessibility:
Find a job
View GitHub Profile
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 10, 2024 15:48
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@Vince1171
Vince1171 / Halium-7.1.2_UT_steps
Last active April 17, 2020 21:08
Halium-7.1.2_UT_steps
wget https://ci.ubports.com/job/ofono/job/xenial_-_merofono/3/artifact/ofono_1.21+ubports1+0~20190310195225.3~1.gbp9792b9_armhf.deb
apt install -y libglibutil libgrilio libmce-glib libwspcodec
dpkg -i ofono_1.21+ubports1+0~20190310195225.3~1.gbp9792b9_armhf.deb
Magic Bluetooth
hciattach /dev/ttyHS0 qualcomm
#Bluez depedancy
sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev libjson-c-dev libglib2.0-dev
@HauptJ
HauptJ / openresty.service
Created June 21, 2018 18:02
OpenResty Systemd service file
# Stop dance for OpenResty
# A modification of the Nginx systemd script
# Source: https://www.digitalocean.com/community/tutorials/how-to-use-the-openresty-web-framework-for-nginx-on-ubuntu-16-04
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the Nginx process.
# If, after 5s (--retry QUIT/5) OpenResty is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if OpenResty is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
@stueja
stueja / lxd-wayland-gui.md
Last active March 6, 2024 05:39
GUI application via Wayland from Ubuntu LXD container on Arch Linux host
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
#!/usr/bin/env python3
import argparse
import contextlib
import ctypes
import dbus
import errno
import fcntl
import io
import os
import pickle
title date tags
GCMForMojo 的部署与设置
2017-01-21 11:07:03 -0800
GCM
Android

2017年2月6日更新:完善部分内容,更新内容

2017年2月8日更新:发现自己脑抽少写了一步较为关键的步骤,赶紧补上orz,连带解决笔误

@john-science
john-science / gzip_files_in_python.md
Last active May 27, 2021 16:47
Reading & Writing GZIP Files Faster in Python

Reading & Writing GZIP Files in Python

I have been testing various ways to read and write text files with GZIP in Python. There were a lot of uninteresting results, but there were two I thought were worth sharing.

Writing GZIP files

If you have a big list of strings to write to a file, you might be tempted to do:

f = gzip.open(out_path, 'wb')

for line in lines:

@wonderbeyond
wonderbeyond / access_ip_limit.lua
Last active February 6, 2017 09:34
nginx ip access limit with lua
-- Access limitation based on predefined IP groups
-- TODO: 添加黑名单支持(通过 $deny_ip_groups 来指定禁止的IP分组)
--
-- FIXME: 去掉默认允许 staff 的特性, 改为默认允许所有(allow all), 根据需要明确指定.
-- 这样就可以把该机制全局应用, 目前只能应用在那些能确定允许IP范围的地址(比如 /admin/).
--
-- TODO:
-- 1. 扫描顺序问题?
-- 2. 不满足任何禁止和允许规则(如果先扫描允许规则且默认允许所有, 则没有这种情况), 如何处理?
-- 3. 允许和禁止的分组定义默认值如何设置?