Skip to content

Instantly share code, notes, and snippets.

View siteslave's full-sized avatar

Satit Rianpit siteslave

View GitHub Profile

Dockerfile:

FROM nginx:alpine

COPY nginx.training.conf /etc/nginx/nginx.conf

COPY web /usr/share/nginx/html

EXPOSE 8888
const { Queue } = require('bullmq')
// Add your own configuration here
const redisConfiguration = {
connection: {
host: "localhost",
port: 6379,
enableOfflineQueue: false,
// username: "default",
// password: "redispw"
@siteslave
siteslave / airflow_moph.md
Last active November 2, 2022 04:40
Airflow Tutorial@MOPH

Ceate directories:

mkdir -p ./dags ./logs ./plugins

Create .env

echo -e "AIRFLOW_UID=$(id -u)" > .env
@siteslave
siteslave / Installing Python 3.7 from source on Ubuntu 18.04.md
Created October 25, 2022 13:33
Installing Python 3.7 from source on Ubuntu 18.04

Installing Python 3.7 from source on Ubuntu 18.04

# update system
sudo apt update && sudo apt upgrade -y

# install build tools and python prerequisites
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev

# download and extract python

ElevatedButton

ElevatedButton(
  style: ElevatedButton.styleFrom(
      padding: EdgeInsets.all(20),
      shape:
          RoundedRectangleBorder(
              borderRadius:
                  BorderRadius
                      .circular(
@siteslave
siteslave / airflow-quick-start.sh
Created August 28, 2022 13:55 — forked from mmziyad/airflow-quick-start.sh
A really quick on-boarding for Apache airflow.
# install
mkdir ~/airflow
cd ~/airflow
pip install airflow
# Have a look here if you need additional packages: https://airflow.incubator.apache.org/installation.html
# setup mysql backend as given here. The default SQLite is not adequate for some workloads.
# http://site.clairvoyantsoft.com/installing-and-configuring-apache-airflow/
# start services
java=java
lib.dir=./lib
conf.dir=./conf
graceful.shutdown.seconds=20
nifi.minifi.config=./conf/config.yml
nifi.minifi.notifier.ingestors=org.apache.nifi.minifi.bootstrap.configuration.ingestors.RestChangeIngestor
nifi.minifi.notifier.ingestors.receive.http.host=0.0.0.0
@siteslave
siteslave / PHP_AIR4THAI.php
Created June 23, 2022 14:08
ดึงข้อมูล Air4Thai ด้วย PHP
<?php
$json = file_get_contents('http://air4thai.pcd.go.th/services/getNewAQI_JSON.php');
$location_json = json_decode($json, true);
echo '<table><tr><td>สถานี</td><td>ค่า PM2.5 (µg/m³)</td><td>อัปเดท</td></tr>';
foreach ($location_json['stations'] as $wizard) {
$stationName = $wizard['nameTH'];
$lastUpdate = $wizard['LastUpdate'];
$pm25 = $lastUpdate['PM25']['value'];
@siteslave
siteslave / install.md
Created June 14, 2022 02:25
MySQL Cluster with NDB
hostnamectl set-hostname mysql-xxxx

install mysql tools

wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
sudo apt-get update
sudo apt-get install mysql-router
@siteslave
siteslave / cli.md
Created May 24, 2022 02:04
Change git:// to https://
git config --global url.https://github.com/.insteadOf git://github.com/