国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
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 |
# 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). |
Install Wayland in Ubuntu: https://askubuntu.com/questions/832509/how-to-install-wayland-on-ubuntu-16-04-lts
Start X applications in a container: https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/
Wayland in container: https://unix.stackexchange.com/questions/330366/how-can-i-run-a-graphical-application-in-a-container-under-wayland/359244#359244
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 |
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.
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:
-- Access limitation based on predefined IP groups | |
-- TODO: 添加黑名单支持(通过 $deny_ip_groups 来指定禁止的IP分组) | |
-- | |
-- FIXME: 去掉默认允许 staff 的特性, 改为默认允许所有(allow all), 根据需要明确指定. | |
-- 这样就可以把该机制全局应用, 目前只能应用在那些能确定允许IP范围的地址(比如 /admin/). | |
-- | |
-- TODO: | |
-- 1. 扫描顺序问题? | |
-- 2. 不满足任何禁止和允许规则(如果先扫描允许规则且默认允许所有, 则没有这种情况), 如何处理? | |
-- 3. 允许和禁止的分组定义默认值如何设置? |