l | tail +2
— Skip first line of stdoutl | head -n-1
— Skip last line of stdout (GNU version only)echo "test" | head -c-1
— Remove last newlinecomm -12 <(echo 1; echo 2) <(echo 1; echo 2; echo 3)
— Shows intersection (here1 2
).cat template.txt | envsubst
— substitutes environment variables in fileecho 123abc | od -c -t d1
— Show decimal dumpecho 123abc | xxd
— Show a hexdump (or do the reverse)
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Railscasts 2</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
sw_vers
— Print Mac OS X operating system version informationsystem_profiler
— Reports system hardware and software configuration.system_profiler SPHardwareDataType
— Hardware overview.hostinfo
— Host information.nvram -p
— Print all of the firmware variables.getconf DARWIN_USER_CACHE_DIR
— Retrieve standard configuration variables/usr/libexec/path_helper
— Helper for constructing PATH environment variable
// ==UserScript== | |
// @name GitBox extra features | |
// @namespace https://www.facebook.com/sergii.tk | |
// @version 0.1 | |
// @description Copies code blocks to clipboard | |
// @match https://app.gistboxapp.com/* | |
// @copyright 2013+, Sergii Tkachenko | |
// @require https://raw.github.com/rafjaf/ClipCopy-for-TM/master/lib/installGM_setClipboard.js | |
// ==/UserScript== |
// Do not follow links in gist content, just copy its href to the clipboard. | |
$(document).on('click', '.gist-file-code a', function() { | |
var link = $(this).attr('href'); | |
gitbox_extra_save_to_clipboard(link, 'Copied.<br /><small>' + link + '</small>'); | |
return false; | |
}) |
- Remove all files from working directory —
_ rm -rf ^.git(D)
- Open Drupal Releases page
- Copy link to the last release compressed to tar.gz
- Download and extract last Drupal —
tar xvf =(curl $(pbpaste)) --strip 1
- Restore deleted files in sites and profiles folder —
g ls-files -z --deleted -- {sites,profiles} | xargs -0 git checkout --
- Show status for these folders —
gst -- {sites,profiles}
- In most cases all changes to profiles folder are necessary —
ga profiles/
- It's ok to update default.settings.php —
ga sites/default/default.settings.php
name = VoxPelli OAuth Test | |
core = 7.x | |
dependencies[] = oauth_common | |
dependencies[] = http_client |
#!/usr/bin/env zsh | |
# ------------------------------------------------------------------------------ | |
# Prompt for the Zsh shell: | |
# * One line. | |
# * VCS info on the right prompt. | |
# * Only shows the path on the left prompt by default. | |
# * Crops the path to a defined length and only shows the path relative to | |
# the current VCS repository root. | |
# * Wears a different color wether the last command succeeded/failed. | |
# * Shows user@hostname if connected through SSH. |
Trying 142.4.4.224... | |
Connected to figgis.agency. | |
Escape character is '^]'. | |
[2J[0;1H | |
ALGERSOFT FILM | |
presents |
After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.
This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.
The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security
command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us