This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
OFFSET=0 | |
LIMIT=200000 | |
TOTAL=1000000000000000 | |
MAX_PROCESS=10 | |
echo "" > nohup.log | |
tail -f nohup.log & | |
TAIL_PID=$! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"fmt" | |
"strconv" | |
"time" | |
"sync" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utilities | |
import ( | |
"path/filepath" | |
"os" | |
"sync" | |
"io/ioutil" | |
"time" | |
"github.com/vmihailenco/msgpack" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
"reflect" | |
"github.com/mitchellh/hashstructure" | |
"fmt" | |
) | |
type Hash struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"github.com/astaxie/beego" | |
"github.com/astaxie/beego/context" | |
"github.com/astaxie/beego/logs" | |
"github.com/ulule/limiter" | |
"github.com/ulule/limiter/drivers/store/memory" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT to_char('2018-02-28 18:48:11.196+00'::timestamp, 'YYYY-MM-DD"T"HH24:MI:SSZ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
####Usage | |
# ./vault.sh encrypt | |
# ./vault.sh dencrypt | |
# ./vault.sh encrypt /full/path/to/file.yml | |
###### | |
set -euo pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- set_fact: | |
env: staging | |
postgresql_admin_user: "pgadmin" | |
postgresql_admin_password: "some_pass" | |
postgresql_databases: | |
- owner: some_user | |
name: some_db | |
postgresql_users: | |
- name: some_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Id": "S3PolicyId1", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::example.bucket/*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this file in /etc/systemd/system/ as root | |
# below paths assume solr installed in /opt/solr, SOLR_PID_DIR is /data | |
# and that all configuration exists in /etc/default/solr.in.sh which is the case if previously installed as an init.d service | |
# change port in pid file if differs | |
# note that it is configured to auto restart solr if it fails (Restart=on-faliure) and that's the motivation indeed :) | |
# to switch from systemv (init.d) to systemd, do the following after creating this file: | |
# sudo systemctl daemon-reload | |
# sudo service solr stop # if already running | |
# sudo systemctl enable solr | |
# systemctl start solr |