Skip to content

Instantly share code, notes, and snippets.

@lgaa
lgaa / config.yaml
Created May 17, 2018 10:46
puphet centos php5.6 dev machine template
vagrantfile:
target: local
vm:
provider:
local:
box: puphpet/centos7-x64
box_url: 'false'
box_version: '0'
chosen_virtualizer: vmware_workstation
virtualizers:
@lgaa
lgaa / mysql-innodb-bulk-inserts.sql
Created August 23, 2017 15:09 — forked from kbsali/mysql-innodb-bulk-inserts.sql
Mysql InnoDB + MyIsam bulk insert statements
LOCK TABLES `table_name` WRITE;
SET autocommit=0;
SET foreign_key_checks=0;
SET unique_checks=0;
/*....
INSERT ... ON DUPLICATE KEY UPDATE
INSERT IGNORE INTO
....*/
@lgaa
lgaa / ExportSheetsToCSV.vba
Created May 18, 2017 11:11
Excel VBA export worksheets to csv individual files
Sub ExportSheetsToCSV()
Dim xWs As Worksheet
Dim xcsvFile As String
For Each xWs In Application.ActiveWorkbook.Worksheets
xWs.Copy
xcsvFile = CurDir & "\" & xWs.Name & ".csv"
Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _
FileFormat: = xlCSV, CreateBackup: = False
Application.ActiveWorkbook.Saved = True
Application.ActiveWorkbook.Close
@lgaa
lgaa / README.markdown
Last active July 6, 2016 15:08 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch

Example Nginx Configurations for Elasticsearch

This repository contains couple of example configurations for using Nginx as a proxy for Elasticsearch.

These examples can be run standalone from this repository -- the general pattern is:

$ nginx -p $PWD/nginx/ -c $PWD/<CONFIG FILE>

When you change the configuration, simply reload the Nginx process to pick up the changes:

@lgaa
lgaa / check_vpn_status.py
Created June 15, 2016 10:41 — forked from mjbommar/check_vpn_status.py
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
@author Bommarito Consulting, LLC; http://bommaritollc.com/
@date 20131029
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
# Imports
import boto
import boto.ec2
import boto.vpc
@lgaa
lgaa / FlowLogs-to-S3-Lambda.py
Created March 15, 2016 09:28 — forked from mlapida/FlowLogs-to-S3-Lambda.py
A Lambda Function for streaming and translating flow logs on the fly. This example was used for HP ArcSight. A full writeup can be found on my site http://mlapida.com/thoughts/exporting-cloudwatch-logs-to-s3-lambda
import boto3
import logging
import json
import gzip
import urllib
import time
from StringIO import StringIO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@lgaa
lgaa / Permissions for a SQL Server source system
Last active October 9, 2017 14:35
Permissions for a SQL Server source system
-- Permissions for a SQL Server source system:
ROLE [db_datareader]
GRANT VIEW DEFINITION
GRANT SELECT ON OBJECT::sys.sql_expression_dependencies
.SESSIONS 2 1
.LOGON $TDPID/$USER,$PASS;
DATABASE $DATABASE;
DELETE FROM $TABLENAME ALL;
DROP TABLE $TABLENAME_ET;
DROP TABLE $TABLENAME_UV;
BEGIN LOADING $TABLENAME
ERRORFILES $TABLENAME_ET