Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
@Teino1978-Corp
Teino1978-Corp / p4merge-git-tool.md
Created December 21, 2016 02:10 — forked from dgoguerra/p4merge-git-tool.md
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@Teino1978-Corp
Teino1978-Corp / README.md
Created January 22, 2016 07:48 — forked from cjolly/README.md
How to securely set rails secret key when you deploy to Heroku.

Stop Versioning Rails Secret Tokens

After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.

Use dotenv in development and test environments:

# Gemfile
gem 'dotenv-rails', groups: [:development, :test]

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.

Cyber Fast Track: Redundant Array of Independent Clouds

DARPA-RA-11-52 Cyber Fast Track
  • Principal Investigators:
########################
# sails
########################
.sails
.waterline
.rigging
.tmp
########################
@Teino1978-Corp
Teino1978-Corp / createEntitlements.py
Created November 6, 2015 01:39 — forked from ashish-belokar/createEntitlements.py
Python scripts to index & update records into ES
import simplejson as json
import collections
import sys
import random
import string
import copy
def getRandEntitlements(region):
entitlements = collections.OrderedDict()
entitlements['enabled'] = '1'
@Teino1978-Corp
Teino1978-Corp / currency-api.go
Created November 6, 2015 01:05 — forked from nicolai86/currency-api.go
a tiny currency exchange rates api written in go
package main
import (
"encoding/json"
"encoding/xml"
"fmt"
"io"
"log"
"net/http"
"os"
@Teino1978-Corp
Teino1978-Corp / bench_node.sh
Created November 5, 2015 23:43 — forked from yorickpeterse/bench_node.sh
Accurate proof that Ruby is closer to the bear metal than Node.js
#!/usr/bin/env bash
siege -c 10 -b -t 30s http://localhost:9393
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"LocalPage" ofType:@"html" inDirectory:nil];
NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
//Append javascript
NSString *script = @"<script>alert(\"This is an alert!!\");</script>";
htmlString = [htmlString stringByAppendingString:script];
[self.webView loadHTMLString:htmlString baseURL:nil];
@Teino1978-Corp
Teino1978-Corp / index.js
Created November 5, 2015 23:17 — forked from simonprickett/index.js
Cordova 5 / iOS 9 Security Blog - index.js
var app = {
initialize: function() {
document.addEventListener('deviceready', this.updateEuroValue, false);
},
updateEuroValue: function() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
var euroPrice,