Skip to content

Instantly share code, notes, and snippets.

@jasonbronson
jasonbronson / gist:18fdc29e8ae5a03af0e5
Created January 30, 2016 22:11
CrawlMonster Code
try{
$amazon = new AmazonEc2();
$result = $amazon->createEc2();
if($result){
$crawlerSpawned = true;
}
}catch(\Aws\Ec2\Exception\Ec2Exception $e){
echo "Exception Thrown. \n";
package worker;
import java.io.IOException;
import org.gearman.Gearman;
import org.gearman.GearmanFunction;
import org.gearman.GearmanServer;
import org.gearman.GearmanWorker;
import org.gearman.impl.GearmanImpl;
package crawler_worker;
import java.io.IOException;
import org.gearman.*;
import org.gearman.impl.*;
import crawler_worker.WorkerClient;
<?php namespace App\Models;
class GeneralModel{
public function getGUID(){
mt_srand((double)microtime()*15000);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$uuid = substr($charid, 0, 8)
.substr($charid, 8, 4)
$data['email'] = $email;
$this->setConfirmationLink( $this->general->getGUID() );
$data['email_confirmation_code'] = $this->getConfirmationLink();
if( DB::insert('insert into leads (email, email_confirmation_code, created_date)
values (?, ?, now())', [$data['email'], $data['email_confirmation_code']]) ){
return true;
}else{
return false;
}
@jasonbronson
jasonbronson / uconomyvehicleshop.sql
Last active October 22, 2019 20:28
uconomyvehicleshop mysql dump
CREATE TABLE `uconomyvehicleshop` (
`id` int(11) NOT NULL,
`vehiclename` varchar(255) DEFAULT NULL,
`cost` decimal(10,0) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `uconomyvehicleshop` (`id`, `vehiclename`, `cost`)
VALUES
@jasonbronson
jasonbronson / uconomyitemshop.sql
Last active October 22, 2019 20:28
uconomyitemshop mysql dump
CREATE TABLE `uconomyitemshop` (
`id` int(11) NOT NULL,
`itemname` varchar(255) DEFAULT NULL,
`cost` decimal(10,0) DEFAULT NULL,
`buyback` decimal(10,0) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `uconomyitemshop` (`id`, `itemname`, `cost`, `buyback`)
@jasonbronson
jasonbronson / gist:315b38d9316c781ed15adff7cfd4f559
Created November 8, 2017 20:24
Amazon ec2 laravel launch image instance
<?php
namespace App\Libraries;
use Aws;
use Ec2Client;
use App\Models\ProjectsModel;
class AmazonEc2{
protected $client;
protected $imageId;
@jasonbronson
jasonbronson / Router.js
Created November 25, 2017 16:45
Router Vue Example
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'homescreen',
@jasonbronson
jasonbronson / build-apache-conf-web-directory.sh
Last active January 21, 2018 19:38
build the apache2 conf files from list of web directory
#!/bin/bash
#find /web/ -maxdepth 1 -type d > domainlist.csv
find /web/ -maxdepth 1 -type d | sed 's/\/web\///g' > domainlist.csv
apachelogdir=/var/log/apache2/
if [ "$(whoami)" != 'root' ]; then
echo "You have to execute this script as root user"
exit 1;
fi