Skip to content

Instantly share code, notes, and snippets.

@it-one-mm
it-one-mm / settrade.py
Created September 29, 2020 09:52 — forked from windows98SE/settrade.py
THAILAND SETTRADE for scrollphathd
import requests
import time
import scrollphathd
from scrollphathd.fonts import font3x5
class SETTRADE:
def __init__(self):
@it-one-mm
it-one-mm / Public_Time_Servers.md
Created October 1, 2020 14:10 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@it-one-mm
it-one-mm / how-to-copy-aws-rds-to-local.md
Created December 24, 2020 09:47 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@it-one-mm
it-one-mm / clock.js
Created June 10, 2021 00:53 — forked from gbuszmicz/clock.js
Heroku clock.js process
const CronJob = require('cron').CronJob
const amqp = require('amqp-connection-manager')
const AMQP_URL = process.env.CLOUDAMQP_URL || 'amqp://localhost';
if (!AMQP_URL) process.exit(1)
const WORKER_QUEUE = 'worker-queue' // To consume from worker process
const CLOCK_QUEUE = 'clock-queue' // To consume from clock process
const JOBS = [{ // You could store these jobs in a database
name: "Cron process 1",
@it-one-mm
it-one-mm / worker.js
Created June 10, 2021 00:53 — forked from gbuszmicz/worker.js
Heroku worker process
const amqp = require('amqp-connection-manager')
const AMQP_URL = process.env.CLOUDAMQP_URL || 'amqp://localhost';
if (!AMQP_URL) process.exit(1)
const WORKER_QUEUE = 'worker-queue'
// Create a new connection manager from AMQP
var connection = amqp.connect([AMQP_URL])