Skip to content

Instantly share code, notes, and snippets.

View 7x7x7eq51's full-sized avatar
🎯
Focusing

7x7 7x7x7eq51

🎯
Focusing
  • 7xxss
  • from localhost
View GitHub Profile
@7x7x7eq51
7x7x7eq51 / poller.go
Last active October 3, 2019 10:15 — forked from nhocki/poller.go
Simple task scheduling with Redis & Go. Similar to Sidekiq's `perform_in` and `perform_at`.
// poller.go
package main
import (
"fmt"
"os"
"os/signal"
"time"
@7x7x7eq51
7x7x7eq51 / app.yaml
Created October 3, 2019 08:04
Deploy application php (CI) to App engine
application: ci-gae-app
version: 2
runtime: php
api_version: 1
threadsafe: false
handlers:
- url: /user_guide/
static_files: user_guide/index.html
upload: user_guide/index.html
@7x7x7eq51
7x7x7eq51 / Guide
Last active October 2, 2019 15:34
Guide runing elasticsearch and mongodb in nodejs
- Install docker
https://docs.docker.com/docker-for-windows/install/
- Run Elastic, Mongodb
https://hub.docker.com/
Finding :
+ Elasticsearch: https://hub.docker.com/_/elasticsearch
+ Mongodb: https://hub.docker.com/_/mongo
Command run:
Elastic:
@7x7x7eq51
7x7x7eq51 / pre-install-pgpartman.sh
Created September 24, 2019 07:27
Install deps for pg partman in postgres
## Install git
apt install git -y
## Install build essential
apt-get install build-essential
## server dev
apt-get install postgresql-server-dev-all -y
## Install common
apt-get install postgresql-common -y
@7x7x7eq51
7x7x7eq51 / mgo.backup.js
Created September 20, 2019 08:07
Mongodb backup
const BATCH_SIZE = 2000;
let srcConnection = "Tgroup";
let srcDb = "order";
let dstConnection = "Staging Truck";
let dstDb = "order";
use(dstDb);
//idPolicy: overwrite_with_same_id|always_insert_with_new_id|insert_with_new_id_if_id_exists|skip_documents_with_existing_id|abort_if_id_already_exists
@7x7x7eq51
7x7x7eq51 / partition_postgres.sql
Created September 13, 2019 11:00
Partition in postgres
CREATE OR REPLACE FUNCTION public.create_partition_and_insert()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
DECLARE
partition_surfix TEXT;
partition_surfix_int integer;
partition TEXT;
begin_partition integer;
end_partition integer;
@7x7x7eq51
7x7x7eq51 / jenkinsfile
Created August 30, 2019 08:14
buildos ci
pipeline {
agent any
stages {
stage('Example Agent'){
agent {
docker {
image 'golang'
}
}
steps{
@7x7x7eq51
7x7x7eq51 / record.sh
Created August 21, 2019 02:54
Save Record
curl --max-time 30 --output ~/Downloads/Radio/CostaDelMar_$(date '+%F_%T').mp3 http://sc-costadelmar.1.fm:10156
@7x7x7eq51
7x7x7eq51 / record.sh
Created August 21, 2019 02:54
Save Record
curl --max-time 30 --output ~/Downloads/Radio/CostaDelMar_$(date '+%F_%T').mp3 http://sc-costadelmar.1.fm:10156
@7x7x7eq51
7x7x7eq51 / Dockerfile
Last active August 16, 2019 06:54
Go base docker file
# Dockerfile for gRPC Go
FROM golang:1.12
# install protobuf from source
RUN apt-get update && \
apt-get -y install git unzip build-essential autoconf libtool vim
RUN git clone https://github.com/google/protobuf.git && \
cd protobuf && \
./autogen.sh && \
./configure && \