Skip to content

Instantly share code, notes, and snippets.

@damonp
damonp / coinex.rb
Created February 21, 2014 17:28
Coinex.pw API Ruby Authentication
require 'curb'
require 'openssl'
require 'base64'
def coinex_call(url, data)
coinex_key = ''
coinex_secret = ''
if data != ''
/**
* Magento EAV Entity Inspection
* Inspect Category
*/
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
@damonp
damonp / passgen.sh
Created May 25, 2014 22:13
Random password generator. Takes optional length parameter.
#!/bin/bash
# random password generator by typedeaF
# This program has no "real" value other than introducing some bash concepts and putting them to use.
# to strip the comments: cat this.file | grep -v '^# '
# Sets the maximum size of the password the script will generate
#MAXSIZE=16
MAXSIZE="${1:-16}"
@damonp
damonp / colorps1.sh
Last active August 29, 2015 14:02
Red Root Prompt
Create /etc/profiles.d/colorps1.sh
#!/bin/bash
if [ $(id -u) -eq 0 >/dev/null 2>&1 ]; then
export PS1="\[\033[01;31m\]\u\[\033[00;37m\]@\h:\w\$ "
fi
@damonp
damonp / nginx.conf
Last active August 29, 2015 14:02
Nginx Conf For Wordpress
# http://codex.wordpress.org/Nginx
# nginx.conf
# Generic startup file.
user {user} {group};
#ususally equal to number of CPU's you have. run command "grep processor /proc/cpuinfo | wc -l" to find it
worker_processes 2;
error_log /var/log/nginx/error.log;
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@damonp
damonp / deploy_git.yml
Created September 16, 2014 16:04
Simiple skeleton to checkout/update git app project on remote webserver, run composer if necessary and set webserver file permissions.
---
# file: deploy_git.yml
-
hosts: "{{ hosts }}"
user: root
vars:
- project: "{{ project }}"
- repo: "{{ repo }}"
- releasedir: "{{ releasedir }}"
- run_composer: "{{ composer | default(false) }}"
@damonp
damonp / html5-invoice.php
Last active September 14, 2023 08:45
HTML5 Editable Invoice Example
<!--
Credit: http://www.jonathantneal.com/blog/the-html5-invoice/
Rolled into single file for transportability.
-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Invoice: #</title>
<style>
@damonp
damonp / tunnel_bitcoind.sh
Created October 13, 2014 21:07
Shell script to create ssh port forwarded tunnel to remote server for bitcoind rpc access.
#!/bin/bash
# $Id: tunnel_bitcoind.sh 13-Oct-14 16:02:39 $
#
# Shell script to create ssh port forwarded tunnel to remote server for
# localhost bitcoind rpc access.
#
# This script is not supported in any way. Use at your own risk.
#
@damonp
damonp / gp.sh
Created November 4, 2014 14:45
Git script to rebase local branch to remote master
#!/bin/bash
if [ "$1" = "" ]; then
echo Current branch name required
exit;
fi
if [ "$2" = "stash" ]; then
echo "Stashing current state..."
git stash