Skip to content

Instantly share code, notes, and snippets.

Avatar
🏃‍♂️
💨💨💨💨

ian doitian

🏃‍♂️
💨💨💨💨
View GitHub Profile
View git-tmp
#!/bin/bash
set -e
ACTION="${1:-init}"
TMPDIR="$(cd "${TMPDIR:-/tmp}" && pwd)"
escape() {
sed 's;[\\/];%;g'
}
@doitian
doitian / ob-bookmarks.py
Last active Aug 28, 2021
A script to export Vivaldi bookmarks into markdown files.
View ob-bookmarks.py
#!/usr/bin/env python3
from pathlib import Path
import tempfile
import json
import textwrap
import hashlib
import os
import shutil
import filecmp
@doitian
doitian / endwise-compe-mappings.vim
Created Jul 26, 2021
tpope/vim-endwise + hrsh7th/nvim-compe
View endwise-compe-mappings.vim
let g:endwise_no_mappings = 1
inoremap <silent><expr> <CR> compe#confirm('<CR>')
inoremap <silent><expr> <A-/> compe#complete()
inoremap <silent><expr> <C-e> compe#close('<C-e>')
imap <silent><expr> <CR>
\ (pumvisible() ?
\ (complete_info()["selected"] == -1 ? "\<C-g>u\<CR>\<Plug>DiscretionaryEnd" : "\<C-y>")
\ : "\<CR>\<Plug>DiscretionaryEnd" )
View CKB toml parser test.md

┌ 在 [pow] 后面再加 [params]

启动失败

$ ./target/release/ckb run
2021-03-31 11:11:14.591 +08:00 main INFO sentry  sentry is disabled
redefinition of table `params` for key `params` at line 99 column 1
View doitian-2020.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doitian
doitian / transmission-docker-compose.yaml
Last active Dec 7, 2020
[Transmission Docker Compose] #docker #qnap #nas
View transmission-docker-compose.yaml
---
version: "2.1"
services:
transmission:
image: linuxserver/transmission
container_name: transmission
environment:
- PUID=1000
- PGID=0
- TZ=Asia/Shanghai
@doitian
doitian / doc-todos.md
Last active Oct 29, 2020
CKB doc in comment assignments
View doc-todos.md

Mark missing docs then finish all the missing docs todos.

Total progress:

  • 2020-10-13: 2 / 2062
  • 2020-10-20: 320 / 2062

About Assignments:

@doitian
doitian / registries.conf
Created Jun 16, 2020
[Configure Docker Hub mirror in /etc/containers/registries.conf] #docker #podman #proxy
View registries.conf
unqualified-search-registries = ['docker.io']
[[registry]]
prefix = "docker.io"
location = "docker.io"
[[registry.mirror]]
prefix = "docker.io"
location = "docker.mirrors.ustc.edu.cn"
@doitian
doitian / Install-WSL.ps1
Last active Jun 15, 2020
A script to simplify WSL installation via lxrunoffline https://github.com/DDoSolitary/LxRunOffline/wiki
View Install-WSL.ps1
param (
[Parameter(Mandatory=$true, Position=0)]
[ValidateScript({
if(-Not (Test-Path $_)) {
throw "File does not exist"
}
return $true
})]
[System.IO.FileInfo]
$RootFsTar,
@doitian
doitian / setup.sh
Last active Jun 14, 2020
Share ssh and gpg keys with WSL
View setup.sh
ln -snf "$(which plink.exe)" "$HOME/bin/ssh"
ln -snf "$(which pscp.exe)" "$HOME/bin/scp"
# Or use Win32 OpenSSH. Since it does not support gpg-agent, I use putty instead
# ln -snf "$(which ssh.exe)" "$HOME/bin/ssh"
# ln -snf "$(which scp.exe)" "$HOME/bin/scp"
ln -snf "$(which gpg.exe)" "$HOME/bin/gpg"
ln -snf "$(which gopass.exe)" "$HOME/bin/gopass"
# Prepend $HOME/bin to PATH somewhere in the shell rc file.
# export PATH="$HOME/bin:$PATH"