Skip to content

Instantly share code, notes, and snippets.

View schmich's full-sized avatar
:octocat:
May all beings be at ease

Chris Schmich schmich

:octocat:
May all beings be at ease
View GitHub Profile
@schmich
schmich / npm-prerelease.md
Last active January 3, 2024 18:19
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
@schmich
schmich / raspberry-pi-setup.md
Last active March 28, 2017 10:30
Raspberry Pi setup
  • Download Raspbian image
  • Unzip image: unzip 2017-03-02-raspbian-jessie-lite.zip
  • Insert SD card
  • Use diskutil list to find device (e.g. /dev/disk3)
  • sudo umount /dev/disk3s1
  • Flash image onto SD card: pv -tpreb 2017-03-02-raspbian-jessie-lite.img | sudo dd of=/dev/disk3 bs=1m
@schmich
schmich / instructions.md
Last active November 20, 2020 07:33
High quality .gif screen recording on macOS
  • Spotlight > QuickTime Player
  • File > New Screen Recording
  • Click Record, select screen area, click Start Recording
  • Record video, click Stop in macOS toolbar
  • File > Save... > video.mov
  • Run mkgif.sh video.mov 15 400 (15 FPS, 400px width)
  • Output is video.gif
@schmich
schmich / termbin-encrypted-data.md
Last active April 19, 2024 04:47
Sharing encrypted data via termbin.com with only netcat and OpenSSL

Single file

Source

  • cat /foo/bar/file.txt | openssl enc -aes-256-cbc -base64 | nc termbin.com 9999
  • Enter password twice (quickly), note termbin.com URL

Destination

  • curl -s http://termbin.com/{id} | openssl enc -aes-256-cbc -base64 -d &gt; file.txt
@schmich
schmich / config.bat
Last active July 5, 2023 03:36
Forward external connections to Docker on Windows
REM In admin prompt
REM Ensure web server/application is listening on all interfaces (0.0.0.0)
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=10.0.75.2 connectport=80
netsh advfirewall firewall add rule name="App" dir=in action=allow protocol=TCP localport=80 remoteport=80
netsh interface portproxy show v4tov4
netsh advfirewall firewall show rule "App"
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=80
netsh advfirewall firewall del rule name="App"
@schmich
schmich / setup.md
Created October 1, 2016 23:28
Docker on Windows

Docker on Windows

  • Requires Windows 10 Professional or better
  • Enable Hyper-V: (as admin) bcdedit /set hypervisorlaunchtype Auto
  • Enable DEP: (as admin) bcdedit /set {current} nx OptOut
  • Download and install Docker for Windows Beta
  • Start Docker
  • To allow sharing volumes: System Tray -> Docker -> Settings -> Shared Drives -> C -> Enter Password

Create authors.txt with a mapping from svn users to git users:

jane.doe = Jane Doe <jane@email.invalid>
john.smith = John Smith <john@email.invalid>

Clone the svn repo using git svn:

'atom-workspace':
'ctrl-shift-f': 'project-find:show'
'ctrl-t': 'fuzzy-finder:toggle-file-finder'
'.platform-win32 atom-text-editor':
'ctrl-=': 'editor:auto-indent'
'ctrl-w': 'core:close'
'ctrl-a': 'core:select-all'
'ctrl-s': 'core:save'
'ctrl-left': 'editor:move-to-beginning-of-word'
@schmich
schmich / multi-account-gmail.md
Last active May 9, 2016 21:31
Multi-account Gmail

Multi-account Gmail

Google Apps note

  • If your secondary account is hosted on Google Apps, you might need to allow less secure apps to enable sending and forwarding
  • See details here

Primary account

  • Settings > Accounts and Import > Send mail as > Add another email address you own
@schmich
schmich / vim-bootcamp.md
Last active March 21, 2024 12:46
Vim Bootcamp

Vim Bootcamp

Concepts

  • Vim is a modal editor with four primary modes
    • Normal: default mode used for movement and commands
    • Insert: typical text editing mode
    • Visual: selection mode for selecting characters, lines, and blocks of text
    • Command-line: for entering editor commands (e.g. :q or :help)
  • Vim strives to be purely keyboard-driven