Skip to content

Instantly share code, notes, and snippets.

David Pennington Xeoncross

Block or report user

Report or block Xeoncross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Xeoncross /
Created Nov 20, 2019 — forked from kwilczynski/
Something put together quickly to automatically associate Elastic IP address with the current EC2 instance.
aws dynamodb create-table --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --attribute-definitions "AttributeName=key,AttributeType=S" --key-schema "AttributeName=key,KeyType=HASH" --billing-mode "PAY_PER_REQUEST"
aws dynamodb create-table --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --attribute-definitions "AttributeName=key,AttributeType=S" --key-schema "AttributeName=key,KeyType=HASH" --billing-mode "PROVISIONED" --provisioned-throughput "ReadCapacityUnits=1,WriteCapacityUnits=1"
aws dynamodb update-time-to-live --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --time-to-live-specification "Enabled=true,AttributeName=ttl"
aws dynamodb scan --region <REGION> --profile <PROFILE> --table-name "<TABLE>"
Xeoncross / traveling-salesman.php
Created Sep 18, 2012 — forked from tlhunter/traveling-salesman.php
PHP Traveling Salesman Genetic Algorithm
View traveling-salesman.php
ini_set("error_reporting", E_ALL & ~E_NOTICE);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Genetic Algorithm : TSP : PHP Implementation by Thomas Hunter</title>
body {
Xeoncross / index.php
Created Mar 8, 2012
Tiny, SMTP client in PHP
View index.php
This is a very tiny proof-of-concept SMTP client. Currently it's over 320 characters (if the var names are compressed). Think you can build one smaller?
ini_set('default_socket_timeout', 3);
$user = '';
$pass = '';
$host = 'ssl://';
Xeoncross / traverse_node.go
Created Jan 5, 2017
Simple DOM node traversal in golang using a very useful collector/matcher function
View traverse_node.go
package main
import (
Xeoncross / mariadb_generator.sql
Created Nov 11, 2019
Example of writing a MariaDB query to generate 100k records
View mariadb_generator.sql
-- See more at
INSERT INTO T1 (id, created_on, domain, seen_on)
SELECT one.X, two.X, three.X, two.X
FROM (select seq, seq X from seq_1_to_100000) one
LEFT JOIN (select seq, NOW() - INTERVAL seq MINUTE X from seq_1_to_100000) two ON one.seq = two.seq
LEFT JOIN (select seq, CONCAT(seq,'.',seq) X from seq_1_to_100000) three ON one.seq = three.seq;
Xeoncross / smoothing.go
Created Feb 9, 2017
Peak detection "Smoothed z-score algo" (in Golang) from
View smoothing.go
Settings (the ones below are examples: choose what is best for your data)
set lag to 5; # lag 5 for the smoothing functions
set threshold to 3.5; # 3.5 standard deviations for signal
set influence to 0.5; # between 0 and 1, where 1 is normal influence, 0.5 is half
// ZScore on 16bit WAV samples
func ZScore(samples []int16, lag int, threshold float64, influence float64) (signals []int16) {
//lag := 20
Xeoncross / hash_character_sizes.go
Last active Nov 2, 2019
Testing hash digest lengths with different ascii encodings like base64 and base58
View hash_character_sizes.go
package main
import (
Xeoncross / int_to_byteslice.go
Last active Nov 2, 2019
Writing a large number of ints to a byte slice is slower when using
View int_to_byteslice.go
package bytewriter
import (
func BenchmarkBinary(b *testing.B) {
Xeoncross / verify.cert.php
Created Nov 17, 2012
Verify that an SSL certificate belongs to the server we are connecting too
View verify.cert.php
// You need a CA cert bundle!
// Good
$host = '';
//$host = '';
// Bad
Xeoncross /
Created Jan 4, 2012
Simple SendEmail wrapper for Amazon SES API (does not support SendRawEmail)
class SES
public $accessKey = NULL;
public $accessKeyID = NULL;
public $host = '';
public $userAgent = 'Test SES Class / v1.0';
public $data = array();
You can’t perform that action at this time.