Skip to content

Instantly share code, notes, and snippets.

View mcantelon's full-sized avatar

Mike Cantelon mcantelon

View GitHub Profile
#!/bin/bash
touch /root/part1
./symfony csv:import /root/cva_pr_final_0.csv --rows-until-update=5 --error-log=/root/errors_0.log --source-name=cva
touch /root/part2
./symfony csv:import /root/cva_pr_final_1.csv --rows-until-update=5 --error-log=/root/errors_1.log --source-name=cva
touch /root/part3
./symfony csv:import /root/cva_pr_final_2.csv --rows-until-update=5 --error-log=/root/errors_2.log --source-name=cva
touch /root/part4
./symfony csv:import /root/cva_pr_final_3.csv --rows-until-update=5 --error-log=/root/errors_3.log --source-name=cva
touch /root/part5
@mcantelon
mcantelon / gist:1618064
Created January 15, 2012 23:49
SOPA JS-only blackout
<html>
<head>
<script>
function sopaRedirect() {
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth() + 1; //months are zero based
var curr_year = d.getFullYear();
var date = curr_year + "-" + curr_month + "-" + curr_date;
@mcantelon
mcantelon / node_setup.sh
Created September 25, 2011 06:49
Node setup
sudo npm install -g deja
sudo npm install -g jshint-runner
sudo npm install -g nmd
@mcantelon
mcantelon / Mongoose example
Created April 1, 2011 05:15
Mongoose example
// from Horofox in #node.js
var mongoose = require('mongoose');
var db = mongoose.connect('mongodb://localhost/mydb');
function allowPosts(mongoose) {
var Schema = mongoose.Schema;
var Posts = new Schema({
name : String,
subject: String,
comment : String,
@mcantelon
mcantelon / connect-form example
Created March 26, 2011 07:05
connect-form example
var connect = require('connect'),
form = require('connect-form');
var server = connect.createServer(
form({ keepExtensions: true }),
function(req, res, next){
// Form was submitted
if (req.form) {
// Do something when parsing is finished
// and respond, or respond immediately
@mcantelon
mcantelon / Node monit
Created March 22, 2011 00:18
roughed out monit conf for node
check process node with pidfile /var/run/node.pid
start program = "start/node/app"
stop program = "stop/noe/app"
if failed host www.myappcom port 80 protocol http
with timeout 25 seconds
then restart
group server
@mcantelon
mcantelon / yaml_test.js
Created March 11, 2011 16:47
Test logic for YAML literal
var yaml = require('yaml')
, fs = require('fs')
, should = require('should')
var ideal = {
jim: 'Hey there.',
bob: 'I am the law!\nYou will kneel!',
rick: 'Sure'
}
@mcantelon
mcantelon / test.yml
Created March 11, 2011 16:46
Test case for YAML literal
jim: Hey there.
bob: |
I am the law!
You will kneel!
rick: Sure
/**
* Module dependencies.
*/
var mongoose = require('mongoose')
, Schema = mongoose.Schema
mongoose.connect('mongodb://localhost/BB')
/**
# Rate limiting for SSH requests -A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 22 -m recent --set -A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 22 -m recent --update --seconds 60 --hitcount 4 -j DROP