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
[core]
excludesfile = ~/.gitignore_global
editor = mvim --nofork
[user]
email = schmch@gmail.com
name = Chris Schmich
[push]
default = current
[alias]
br = branch --list -vv

Keybase proof

I hereby claim:

  • I am schmich on github.
  • I am schmich (https://keybase.io/schmich) on keybase.
  • I have a public key whose fingerprint is 6A81 AFFA A3E3 63E9 E308 5E5E 0C7C 2CE3 2BB3 2877

To claim this, I am signing this object:

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
require 'pp'
require 'set'
winner = [Set.new([4, 8, 19, 27, 34]), 10]
tickets = File.open('numbers.txt').readlines.map { |line|
numbers = line.scan(/\d+/).map { |n| n.to_i }
[Set.new(numbers.take(5)), numbers[numbers.length - 1]]
}.to_a

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 / 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 / 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 you@email.com > secret.key
      • Transfer secret.key to Windows, delete it from origin system
  • On Windows, run gpg --allow-secret-key-import --import secret.key
'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 <jane@email.invalid>
john.smith = John Smith <john@email.invalid>

Clone the svn repo using git svn: