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
[Unit] | |
Description=Checkin attendance in OfficeCentral | |
Wants=attendance-checkin.timer | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/python3 /path/to/attendance.py -a /path/to/login_file -i | |
[Install] | |
WantedBy=multi-user.target |
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
# Convert network->gateway mapping into DHCP 121 option | |
# | |
# conf.txt: | |
# | |
# 10.210.15.0/24 10.210.14.99 | |
# 10.213.0.0/24 10.210.14.98 | |
# 10.214.0.0/24 10.210.14.98 | |
# 192.168.0.0/24 10.210.14.98 | |
# 172.24.0.0/16 10.210.14.98 | |
# |
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> " |
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 |
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 |
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 | |
HOSTSUFFIX=home.kagesenshi.org | |
usage() { | |
echo "Usage: $0 -n [NAME] -i [IP]" |
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() | |
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. |
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 |
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) |
NewerOlder