View sqlacmd.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
import cmd | |
import argparse | |
from sqlalchemy import create_engine, text | |
from sqlalchemy.exc import ProgrammingError | |
from tabulate import tabulate | |
class SQLShell(cmd.Cmd): | |
intro = ("Welcome to SQLAlchemy REPL Shell. Type 'exit' to quit. \n" | |
"This shell does not execute queries immediately. Press CTRL+D or type 'EOF' to execute. \n") | |
_default_prompt = "SQL> " |
View Containerfile
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 centos:stream8 | |
RUN dnf install epel-release -y && \ | |
dnf groupinstall "Development Tools" -y --enablerepo powertools && \ | |
dnf install --enablerepo powertools \ | |
R-core-devel pandoc \ | |
python3-devel git \ | |
openblas \ | |
java-1.8.0-openjdk-devel gcc gcc-c++ -y && \ | |
dnf clean all -y |
View datahub-install.yaml
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
mysqlSetupJob: | |
enabled: false | |
postgresqlSetupJob: | |
enabled: true | |
elasticsearchSetupJob: | |
extraEnvs: | |
- name: USE_AWS_ELASTICSEARCH |
View setup-node.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
#!/bin/bash | |
PARSED=$(getopt -a -n setup-node -o :n:i: --long name:,ip: -- "$@") | |
VALID_ARGS=$? | |
GATEWAY=10.210.14.1 | |
DNS=10.210.14.2 | |
usage() { | |
echo "Usage: $0 -n [NAME] -i [IP]" | |
exit 1 |
View auto-ballooning.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
#!/usr/bin/python3 | |
from subprocess import Popen, PIPE | |
def start_monitor(domain, interval: int = 10): | |
proc = Popen(['virsh','dommemstat', domain, '--period', str(interval)], | |
stdout=PIPE) | |
proc.wait() | |
View sentimentanalyzer.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
import openai | |
class SentimentAnalyzer(object): | |
def __init__(self, language): | |
self._language = language | |
def _prompt(self): | |
prompt = """ | |
The following sentence is in %s language. |
View sysinfo-satsuki.txt
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
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Desktop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: GenuineIntel | |
CPU Brand: Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz | |
CPU Family: 0x6 |
View hubcap.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
# Data cleansing helper functions | |
from pyspark.sql import functions as F | |
from pyspark.sql import Window, DataFrame | |
from IPython.display import HTML, Markdown | |
from pyspark.ml.feature import VectorAssembler | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
def transform(self, function, *args, **kwargs): | |
return function(self, *args, **kwargs) |
View krbspawner.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
# to use this, set REALM to your KRB realm, and create keytabs for each user in | |
# /etc/security/keystabs/<username>.jupyter.keytab | |
# | |
# Save this file in your site-packages directory as krbspawner.py | |
# | |
# then in /etc/jupyterhub_config.py, set: | |
# | |
# c.JupyterHub.spawner_class = 'krbspawner.KerberosSpawner' | |
View multiprocess_python_udf.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 __future__ import print_function | |
import sys | |
from multiprocessing import Process, Pool, cpu_count | |
def transform(*args): | |
# -- do something here -- | |
return [] | |
def process_line(line): | |
line = line.strip().split('\t') |
NewerOlder