Skip to content

Instantly share code, notes, and snippets.

@K4zuki
K4zuki / INSTALL.md
Last active May 22, 2024 08:54
Alpine linux pandoc setup

Should work on Linux/Mac host!

  • use docker
  • add env lines in .bashrc
    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST="tcp://192.168.99.100:2376"
    export DOCKER_CERT_PATH="$HOME\.docker\machine\machines\default"
    export DOCKER_MACHINE_NAME="default"
  • $ docker run alpine:edge /bin/sh
@K4zuki
K4zuki / change_table_style.py
Last active October 23, 2017 05:53
python-docx to change table style
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
opens a docx file, replace ALL table style(*) and save on same file
mainly for pandoc exported docx file
(*) the applying style must be pre-defined in given file
Applies MIT License - 2017 K4ZUKI([email protected])
"""
@K4zuki
K4zuki / YetAnotherRelayBoard.md
Last active September 21, 2017 18:04
yet another relay board

idea

  • isolate leaky instruments by relay and external control

  • 4mm Banana plug/juck, distance 19.05mm

  • 2 x 1c or 1 x 2c terminal relay 5~10ADC rating

  • 50x50mm PCB, 35x35xM3 hole, 4x4R corner

  • Akizuki plastic panel

@K4zuki
K4zuki / rotatesvg.py
Created August 28, 2017 06:02
python3 script to rotate svg by degree
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# simple SVG rotate script
# great hint from
# https://stackoverflow.com/questions/43199869/rotate-and-scale-a-complete-svg-document-using-python
# MIT license (c) K4ZUKI([email protected])
"""
import svgutils
import math
@K4zuki
K4zuki / mbed-cli-os2.md
Last active July 28, 2017 05:48
mbed cli import from mbed.org

Install

follow instruction in https://github.com/ARMmbed/mbed-cli

  • requires Python 2.7.11+, mercurial(from pip), git
  • pip install mercurial
  • pip install mbed-cli

Import existing project from mbed.org

$ mbed import https://developer.mbed.org/users/k4zuki/code/DA7212hello_dev/
@K4zuki
K4zuki / gpp-cross-compile.md
Last active July 21, 2017 04:55
cross compilation for gpp

Environment

  • Ubuntu16.04

Commands

  • get gpp-2.25tar.bz archive from https://github.com/logological/gpp/releases
  • $ tar jxf gpp-2.25.tar.bz2 extracts gpp-2.25 directory
  • $ sudo apt-get install mingw-w64 git-core wget quilt
  • $ cd gpp-2.25
  • $ ./configure --host=x86_64-w64-mingw32
  • $ make
@K4zuki
K4zuki / atom-on-right-clock-menu.md
Created July 19, 2017 06:18
"Open with Atom" on Ubuntu

cp /usr/share/applications/atom.desktop ~/.local/share/applications/atom.desktop

@K4zuki
K4zuki / plantuml.md
Last active July 21, 2017 11:39
PlantUML installation
@K4zuki
K4zuki / UseRictyDiminishedOnPowerShell.reg
Created July 12, 2017 10:19
add Ricty Diminished as Japanese font on Powershell
Windows Registry Editor Version 5.00
; add Ricty Diminished in powershell font list
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont]
"932." = "Ricty Diminished"