Skip to content

Instantly share code, notes, and snippets.

Frédéric Delbos fdelbos

Block or report user

Report or block fdelbos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fdelbos
fdelbos / .emacs
Last active Jul 6, 2018
be .emacs
View .emacs
;; melpa
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; theme
(load-theme 'manoj-dark)
(global-linum-mode t)
View .gitconfig
[user]
name = Frédéric DELBOS
email = fred.delbos@gmail.com
[color]
ui = auto
[core]
editor = emacs
@fdelbos
fdelbos / encryption.js
Created Oct 29, 2017
a quick way to aes encrypt with node
View encryption.js
const crypto = require('crypto');
const IV_LENGTH = 16;
class Encryption {
constructor(b64Key) {
this.key = Buffer.from(b64Key, 'base64');
}
@fdelbos
fdelbos / s3_image_upload.go
Last active Aug 29, 2015
Resize an image, create a thumbnail, compress and uploads to S3
View s3_image_upload.go
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"
View gist:230c8829b263fc95430c
# 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 / FreeBSD_node_monit.md
Last active Jun 22, 2019
FreeBSD 10 Nodejs setup with nginx, mongo and monit
View FreeBSD_node_monit.md

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

@fdelbos
fdelbos / Makefile
Last active Dec 29, 2015
Coffeescript Makefile
View Makefile
##
## Makefile
##
## Created by Frederic DELBOS - fred.delbos@gmail.com on Nov 30 2013.
##
NAME = outfile
DIR = .
SRC = file1.coffee file2.coffee
View header2.el
;;; 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 / TJSONProtocol.py
Created Oct 24, 2012
A Python JSON implementation of the Thrift protocol
View TJSONProtocol.py
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@fdelbos
fdelbos / pkg_display.py
Created Mar 23, 2012
display information on each package on freebsd
View pkg_display.py
#!/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'
You can’t perform that action at this time.