Skip to content

Instantly share code, notes, and snippets.

View rezen's full-sized avatar

Andres Hermosilla rezen

View GitHub Profile
@rezen
rezen / repset_mongo.sh
Created November 11, 2015 15:33 — forked from massenz/repset_mongo.sh
Creates and initializes a MongoDb replica set: allows the user to choose the number of members and the starting port number; this should also work on a remote host, but I have only tested it so far on localhost
#!/bin/bash
#
# Starts up a MongoDB replica set
#
# There is a lot of documentation about replica sets:
#
# http://docs.mongodb.org/manual/reference/replica-configuration/
# http://docs.mongodb.org/manual/administration/replica-sets/
#
# To read data from a SECONDARY, when in the client, use:
#!/usr/bin/env bash
# yum
sudo yum -y update
sudo rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
sudo rm -f /etc/localtime
sudo ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime
@rezen
rezen / scanner.php
Created January 25, 2013 00:54
Scan files (php) for questionable items ... looking for those exploits!
<?php
// Let's see those errors!
error_reporting(1);
// Give it some time!
set_time_limit(80);
// File ext(types) to check!
$check_files = array(
@rezen
rezen / rm.sql
Created June 19, 2013 06:11
Remove old WordPress post_meta
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL

Keybase proof

I hereby claim:

  • I am rezen on github.
  • I am rezen (https://keybase.io/rezen) on keybase.
  • I have a public key whose fingerprint is C4C1 2B93 6D91 CD53 5DEB D31B C2E6 DEA0 5DA0 698A

To claim this, I am signing this object:

:: Make sure to download and install dotnet45+ before running the script!
:: Install Chocolatey!
:: @todo Add http://babun.github.io/
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
:: Browsers
choco install -y firefox
choco install -y googlechrome
choco install -y ie11
@rezen
rezen / m2crypto-certificates.py
Created April 5, 2017 18:50 — forked from eskil/m2crypto-certificates.py
Example of generating CA certs and CA signed certs using python m2crypto.
"""
Tools for creating a CA cert and signed server certs.
Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py
The mk_temporary_xxx calls return a NamedTemporaryFile with certs.
Usage ;
# Create a temporary CA cert and it's private key
cacert, cakey = mk_temporary_cacert()
'use strict';
/**
* https://github.com/SalesforceEng/secure-filters
*
* @description
* Frequently strings are dirty and need to
* have some HTML removed. Often times you may
* want to control the filtering a bit more, for
* example removing all elements except anchors.
#!/usr/bin/env bash
set -e
format_text=1
if [[ "$@" == *"--nofmt"* ]]; then
format_text=0
fi
image="$1"
@rezen
rezen / template.conf
Last active May 11, 2018 18:17
Example upstart for centos /etc/init/template.conf
# Below are some good links for reference
# https://gist.github.com/c4milo/940909
# https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/
# http://upstart.ubuntu.com/cookbook/
# http://serverfault.com/questions/321375/passing-arguments-to-upstart-job
author "Andres Hermosilla <an2dres5m@gmail.com>"
description "Update Example Config"
# Set variables
env upstart_name=template