Skip to content

Instantly share code, notes, and snippets.

View alertor's full-sized avatar

Stefan Taranu alertor

  • Bucharest, Romania
View GitHub Profile
[
{
"action": "talk",
"text": "Hey there! Welcome to Ford Mustang Romania conference line",
"voiceName": "Kimberly"
},
{
"action": "conversation",
"name": "ford-mustang-romania"
}
@alertor
alertor / public_key_encrypt_gpg_base64.go
Created October 20, 2017 20:57 — forked from jyap808/public_key_encrypt_gpg_base64.go
Public key encrypting a string into GPG format and outputting it in base64 encoding
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@alertor
alertor / rpm-digital-signature.sh
Created May 6, 2017 08:57 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@alertor
alertor / whois.conf
Created January 9, 2017 13:37 — forked from thde/whois.conf
/etc/whois.conf WHOIS records for nTLDs (https://thde.io/whois-command-line-new-gtld-guru-watch-zone-link/)
##
# WHOIS servers for new TLDs (http://www.iana.org/domains/root/db)
# Current as of 2016-10-07
##
\.aarp$ whois.nic.aarp
\.abarth$ whois.afilias-srs.net
\.abbott$ whois.afilias-srs.net
\.abbvie$ whois.afilias-srs.net
\.abc$ whois.nic.abc
@alertor
alertor / dyndns_route53.py
Created December 5, 2016 12:29 — forked from mariocesar/dyndns_route53.py
Update a Route53 Record if your public IP changes. Like DynDNS
"""
Requeriments:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
import time
import sys
@alertor
alertor / nginx.conf
Created October 13, 2016 13:04 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@alertor
alertor / install-comodo-ssl-cert-for-nginx.rst
Created September 15, 2016 10:58 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@alertor
alertor / functions.js
Created August 18, 2016 08:31 — forked from RedBeard0531/functions.js
Min, Max, Sum, Count, Avg, and Std deviation using MongoDB MapReduce
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
@alertor
alertor / buzzfeed_api.md
Created August 2, 2016 09:49
BuzzFeed API - hackNY hackathon
                                               .--.
                                               `.  \
                                                 \  \
                                                  .  \
                                                  :   .
                                                  |    .
                                                  |    :
                                                  |    |
  ..._  ___                                       |    |
 `."".`''''""--..___ | |