- Using a ready-to-use Ubuntu image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env bash | |
| #################################################### | |
| # Required Libraries | |
| # | |
| # library name | commands used | verified version | |
| # ------------------------------------------------ | |
| # ffmpeg | ffmpeg/ffprobe | 3.1.4 3.2 | |
| # gpac | mp4box | 0.6.1 | |
| # mp4v2 | mp4chaps | 2.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Concurrent read-process-write example""" | |
| import concurrent.futures | |
| from itertools import islice | |
| from time import sleep | |
| import rasterio | |
| CHUNK = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| patch: | |
| # 菜单 | |
| menu: | |
| page_size: 8 # 候选词个数 | |
| # alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签 | |
| # alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键 | |
| # ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml | |
| # 中西文切换 | |
| # | |
| # 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Three ways of computing stats of a rasterio dataset.""" | |
| import dask.array | |
| import numpy | |
| import rasterio | |
| from rasterio.windows import Window | |
| # Compute mean of entire dataset read into memory. Easiest, but doesn't | |
| # scale for very large datasets. | |
| with rasterio.open( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source: https://github.com/tindy2013/subconverter/blob/master/base/rules/MSServices.list | |
| # Microsoft Services | |
| # optimized from https://gist.github.com/TTTPOB/ce93fb3b04ba2f21880b09427442d831 | |
| # source: https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges | |
| payload: | |
| - DOMAIN-KEYWORD,1drv | |
| - DOMAIN-KEYWORD,microsoft | |
| - DOMAIN-SUFFIX,aadrm.com | |
| - DOMAIN-SUFFIX,acompli.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install Mikrotik CHR on Digital Ocean Ubuntu 18.04 LTS Droplet. Tested 11/2021 | |
| 1. Turn Off Droplet after creation and go to Recovery and set it to Boot from Recovery ISO. | |
| 2. Trun on Droplet and open Console | |
| 3. Press 6 and go to shell | |
| 4. Paste below code to install CHR on HDD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.clear(); | |
| function saveData(blob, fileName) | |
| { | |
| var a = document.createElement("a"); | |
| document.body.appendChild(a); | |
| a.style = "display: none"; | |
| var url = window.URL.createObjectURL(blob); | |
| a.href = url; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const React = require('react') | |
| const ReactDOMServer = require('react-dom/server') | |
| const { createServer } = require('http') | |
| const App = require('./build/static/js/main.49fed57c').default | |
| createServer((req, res) => { | |
| const el = React.createElement(App) | |
| const html = ReactDOMServer.renderToString(el) | |
| res.write(html) | |
| res.end() |
mkdir -m 700 ~/.ssh; curl https://github.com/aidik.keys >> ~/.ssh/authorized_keys
NewerOlder