Encrypt:
openssl enc -e -aes256 -salt -in file-to-encrypt -out file-encrypted.encrypted
Use this one instead, if base64 is needed (send encrypted file as text on email, or messaging).
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 | |
file=$2 |
# On the fly resizing of images inside /images/*/ | |
# based on query string "width" and "height" parameters | |
location ~ /images/(.+)/ { | |
set $width -; | |
set $height -; | |
set $entity $1; | |
if ($arg_width) { | |
set $width $arg_width; |
file-icons | |
tool-bar | |
tool-bar-main | |
atom-material-ui | |
atom-material-syntax | |
markdown-writer |
#!/bin/sh | |
# PROVIDE: forever | |
# REQUIRE: NETWORKING SERVERS DAEMON | |
# BEFORE: LOGIN | |
# KEYWORD: shutdown | |
# Taken from http://habrahabr.ru/post/137857/ | |
. /etc/rc.subr |
-- Word and Character Count service for Mac OS X | |
-- Adds a Word and Character Count option to the text selection context menu | |
-- Use Automator to create a new service, then select the Run AppleScript action. Make | |
-- sure the service is set to receive "text", at the top of the window. Paste in this code | |
-- and save as "Word and Character Count". Now switch to a new app, select some text, | |
-- right-click, go to Services, and find the new option. | |
-- Copyright 2015, Noah Slater <[email protected]> |
Navigate with arrow keys, mustly to be used on a static content generator, like Jekyll or Hugo:
<script>
$(document).keydown(function(e){
if (e.keyCode == 37 && $(".prev").length == 1) {
e.preventDefault();
window.location.href = $(".prev").attr("href");
} else if (e.keyCode == 39 && $(".next").length == 1) {
e.preventDefault();
This will allow tilde style user directory on nginx:
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/www$2;
autoindex on;
}
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |