Skip to content

Instantly share code, notes, and snippets.

# encrypt
openssl enc -aes-256-cbc -in myfile.tar -out myfile.tar.enc
# decrypt
openssl enc -aes-256-cbc -d -in myfile.tar.enc -out myfile.tar
@fdelbos
fdelbos / s3_image_upload.go
Last active August 29, 2015 14:20
Resize an image, create a thumbnail, compress and uploads to S3
package main
import (
"bytes"
"compress/gzip"
"fmt"
"github.com/awslabs/aws-sdk-go/aws"
"github.com/awslabs/aws-sdk-go/aws/awsutil"
"github.com/awslabs/aws-sdk-go/service/s3"
"github.com/hyperboloide/pipe"
@fdelbos
fdelbos / .emacs
Last active September 27, 2015 06:08
Minimalist Emacs configuration
(setq visible-bell t)
(line-number-mode 1)
(column-number-mode 1)
(global-font-lock-mode t)
(setq font-lock-maximum-size nil)
(setq-default transient-mark-mode t)
(menu-bar-mode -1)
(setq backup-inhibited t)
(setq auto-save-default nil)
(setq inhibit-startup-message t)
@fdelbos
fdelbos / gist:1225129
Last active September 27, 2015 06:18
basic shell conf
export PS1="[\e[0;47m\w\e[0m]\e[0;32m\\$\e[0m "
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
BLOCKSIZE=m; export BLOCKSIZE
EDITOR=emacs; export EDITOR
PAGER=less; export PAGER
PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-current
export PACKAGESITE
@fdelbos
fdelbos / nginx.conf
Created February 15, 2012 15:12
Freebsd Nginx config for Django
user www;
worker_processes 1;
error_log /var/log/nginx-error.log;
events {
worker_connections 256;
use kqueue;
}
http {
@fdelbos
fdelbos / uwsgi.xml
Created February 15, 2012 16:12
uWsgi xml config file
<uwsgi>
<socket>127.0.0.1:3031</socket>
<pythonpath>..</pythonpath>
<chdir>/usr/home/fred/www/lecomptoir/</chdir>
<module>django_wsgi</module>
</uwsgi>
@fdelbos
fdelbos / gist:1852875
Created February 17, 2012 11:39
Mount freebsd disk from linux
mount -r -t ufs -o ufstype=ufs2 /dev/sda1 1/
@fdelbos
fdelbos / pkg_display.py
Created March 23, 2012 21:21
display information on each package on freebsd
#!/usr/local/bin/python
import os, sys, commands
def print_package(name):
rows, columns = os.popen('stty size', 'r').read().split()
for i in range (int(columns)):
sys.stdout.write('_')
print '\n'
;;; header2.el --- Support for creation and update of file headers.
;;
;; Filename: header2.el
;; Description: Support for creation and update of file headers.
;; Author: Lynn Slater
;; Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 1996-2013, Drew Adams, all rights reserved.
;; Copyright (C) 1989 Free Software Foundation, Inc.
;; Copyright (C) 1988 Lynn Randolph Slater, Jr.
@fdelbos
fdelbos / gist:1836947
Created February 15, 2012 16:09
FreeBSD startup script for uWsgi
#!/bin/sh
#
# PROVIDE: myuwsgi
#
. /etc/rc.subr
name=myuwsgi
rcvar=myuwsgi_enable
start_cmd="myuwsgi_start"