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

Cron & Syslog

  • Use /usr/bin/logger to log to syslog (-t to tag messages)
  • Example crontab entry: 0 12 * * * /path/to/myapp 2>&1 | /usr/bin/logger -t myapp
  • View syslog: tail -f /var/log/syslog
  • Logs are rotated and saved as /var/log/syslog.*.gz

Convert .wav to .mp3

  • Crop & convert: ffmpeg -i source.wav -codec:a libmp3lame -qscale:a <quality> -ss <start> -to <end> out.mp3
  • Further cropping: ffmpeg -i out.mp3 -ss <start> -to <end> -acodec copy part1.mp3
  • <quality> is 0-9, 0 being best. This should be 0-3 for highest transparent quality.
  • and are timestamps, e.g. 00:05:30 or 03:45:00.
@schmich
schmich / signing-git-tags-on-windows.md
Last active May 13, 2016 03:00
Signing git tags on Windows

Signing git tags on Windows

  • Download and install Gpg4win Vanilla (command-line only GPG tools)
  • Create or import an existing key in Windows
    • Create a new key
      • ...
    • Import an existing key
      • On origin system, gpg -a --export-secret-keys [email protected] > secret.key
      • Transfer secret.key to Windows, delete it from origin system
  • On Windows, run gpg --allow-secret-key-import --import secret.key
@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
@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
'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'

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

jane.doe = Jane Doe <[email protected]>
john.smith = John Smith <[email protected]>

Clone the svn repo using git svn:

@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
@schmich
schmich / config.bat
Last active June 3, 2025 14:15
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"