conda env list
conda create --name dagster-3.9.11 python=3.9.11
View cred_install.sh
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
# 1. python file | |
sudo mkdir -p /opt/cred | |
cat <<ETO > /opt/cred/creds.py | |
import argparse | |
import sys | |
import yaml | |
parser = argparse.ArgumentParser(description='find creds or execute credential') | |
parser.add_argument('--mode', help='mode to run') | |
parser.add_argument('--name', help='name to find') |
View worker-pool.go
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 ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
const concurrency = 3 | |
const numTasks = 100 |
View sqla_nodes.py
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
""" | |
simple example showing sqlalchemy Adjacency List Relationships | |
https://docs.sqlalchemy.org/en/13/orm/self_referential.html | |
""" | |
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String | |
from sqlalchemy.orm import sessionmaker, relationship, backref | |
from sqlalchemy.ext.declarative import declarative_base | |
DB_PATH = 'sqlite:///nodes.sql' |
View conda.md
View zip.sh
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
# .zip | |
zip -r -o out.zip folder | |
unzip out.zip | |
# xz | |
gzip -r folder | |
gzip -f file | |
gunzip out.gz | |
# tar.gz |
View vbox.sh
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
# list | |
vboxmanage list vms | |
vboxmanage list runningvms | |
# start | |
VM=cent7_1 | |
vboxmanage startvm $VM --type headless | |
# stop | |
vboxmanage controlvm Ubuntu poweroff soft |
View convert_csv_hdf5.py
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
# -*- coding: utf-8 -*- | |
import h5py | |
import sys | |
import pandas as pd | |
import datetime | |
if len(sys.argv) == 1: | |
print("No provided file") | |
sys.exit(1) |
View rsync
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 | |
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
rsync -arv \ | |
--exclude-from=$CWD/exclude.txt \ | |
$CWD \ | |
vpn:~/ |
View spark_job.py
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
from pyspark.sql import SparkSession | |
# config | |
INPUT = "" | |
OUTPUT = "" | |
def main(): | |
spark = ( SparkSession.builder | |
.appName("Viet PySpark") | |
.config("spark.dynamicAllocation.enabled","true") |
View an-inquiry-into-matplotlib-figures.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder