>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
Discover gists
This file contains 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
{ | |
"books": [ | |
{ | |
"book": "Genesis", | |
"verses": 1533, | |
"chapters": 50 | |
}, | |
{ | |
"book": "Exodus", | |
"verses": 1213, |
This file contains 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
// To run: | |
// clang core-audio-sine-wave.c -framework AudioUnit && ./a.out | |
#include <AudioUnit/AudioUnit.h> | |
#define SAMPLE_RATE 48000 | |
#define TONE_FREQUENCY 440 | |
#define M_TAU 2.0 * M_PI | |
OSStatus RenderSineWave( | |
void *inRefCon, |
background: 使用 fly.io 的日本机器安装 cloudflare tunnel 利用它代理部署了 edgetunnel 的 cloudflare worker 的域名 实现指定使用日本的IP地址。
同时 也可以通过使用指定中转IP 实现使用全球任意地区的cloudflare IP
菜单点击 Access -> Tunnels
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
# | |
# This is how I used it: | |
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history | |
import sys | |
import time |
This file contains 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
# ----------------------------------------------------------------------------- | |
# From https://en.wikipedia.org/wiki/Minkowski–Bouligand_dimension: | |
# | |
# In fractal geometry, the Minkowski–Bouligand dimension, also known as | |
# Minkowski dimension or box-counting dimension, is a way of determining the | |
# fractal dimension of a set S in a Euclidean space Rn, or more generally in a | |
# metric space (X, d). | |
# ----------------------------------------------------------------------------- | |
import scipy.misc | |
import numpy as np |
This file contains 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
:root { | |
--primary-color: #005fff; | |
--primary-color-alpha: #005fff1a; | |
} | |
html, | |
body { | |
margin: 0; | |
padding: 0; | |
height: 100%; |
This file contains 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
// Useful JavaScript to make a simple table of links from an open page using the browser Inspector console. | |
// https://www.datablist.com/learn/scraping/extract-urls-from-webpage | |
var x = document.querySelectorAll("a"); | |
var myarray = [] | |
for (var i=0; i<x.length; i++){ | |
var nametext = x[i].textContent; | |
var cleantext = nametext.replace(/\s+/g, ' ').trim(); | |
var cleanlink = x[i].href; | |
myarray.push([cleantext,cleanlink]); |
This file contains 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
/* | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
*/ | |
/// <summary> | |
/// <para> | |
/// Sources: | |
/// <para>https://stackoverflow.com/questions/358700/how-to-install-a-windows-service-programmatically-in-c </para> |
NewerOlder