Skip to content

Instantly share code, notes, and snippets.

View andorfermichael's full-sized avatar

Michael Andorfer andorfermichael

  • Salzburg, Austria, Europe
  • 18:21 (UTC +02:00)
View GitHub Profile
@lxneng
lxneng / gist:741932
Created December 15, 2010 13:21
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@mkhatib
mkhatib / geo.js
Created May 24, 2013 02:55
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@jsanders
jsanders / aes_ctr_cbc.rb
Last active October 8, 2021 10:45
Implementation of AES with counter (CTR) and cipher-block-chaining (CBC) modes. Based on spec at http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf. ** Disclaimer: For educational purposes only. Obviously, nobody should ever use a hacky un-vetted non-standard (not to mention, non-optimized) implementation of crypto like this **
require File.expand_path('../../utilities', __FILE__)
require 'openssl'
# Set to true to see debug output
DEBUG = false
def debug_puts(s=nil); puts(s) if DEBUG; end
def debug_print(s=nil); print(s) if DEBUG; end
# Encrypt data using given `mode`, `key_b`, `iv_b` and `data_b`, all as byte arrays
# Only uses padding in CBC mode
@cerebrl
cerebrl / 1-securing-express.md
Last active August 2, 2023 22:48
Securing ExpressJS

tl;dr

  1. Don't run as root.
  2. For sessions, set httpOnly (and secure to true if running over SSL) when setting cookies.
  3. Use the Helmet for secure headers: https://github.com/evilpacket/helmet
  4. Enable csrf for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf
  5. Don't use the deprecated bodyParser() and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use the defer property and pipe() the multipart upload stream to the intended destination.
@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@marchawkins
marchawkins / voice-command-time-test.html
Created March 3, 2014 18:58
Using annyang javascript library (https://www.talater.com/annyang/) to capture a command, process it and speak the result with the html 5 speech synthesis api. This demo works on the desktop and Android versions of Chrome. The 'time' is based on the user's system clock For this test, click **Listen** and ask "What time is it?" (after clicking "a…
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-2">
<p><button class="btn btn-primary btn-sm" id="speak-btn"><span>Listen</span></button></p>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">Response Status</div>
<div class="panel-body">
<textarea id="status" class="form-control" placeholder="Spoken text will appear here"></textarea>
</div>
@StefanWallin
StefanWallin / README.md
Last active January 15, 2022 06:22 — forked from konklone/ssl.rules
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).