Skip to content

Instantly share code, notes, and snippets.

! $Xorg: rgb.txt,v 1.3 2000/08/17 19:54:00 cpqbld Exp $
255 250 250 snow
248 248 255 ghost white
248 248 255 GhostWhite
245 245 245 white smoke
245 245 245 WhiteSmoke
220 220 220 gainsboro
255 250 240 floral white
255 250 240 FloralWhite
253 245 230 old lace
@zacgx
zacgx / golang_on_rpi.md
Created March 7, 2025 06:21 — forked from simoncos/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

@zacgx
zacgx / tzname.py
Created January 26, 2025 18:58 — forked from RhetTbull/tzname.py
Get the named timezone for a given location in python using native macOS CoreLocation APIs
"""Get named timezone for a location on macOS using CoreLocation
To use this script, you need to have pyobjc-core and pyobjc-framework-CoreLocation installed:
pip install pyobjc-core pyobjc-framework-CoreLocation
This script uses CoreLocation to get the timezone for a given latitude and longitude
as well as the timezone offset for a given date.
It effectively does the same thing as python packages like [tzfpy](https://pypi.org/project/tzfpy/)
@zacgx
zacgx / agent.py
Created February 23, 2023 08:55 — forked from wiseman/agent.py
Langchain example: self-debugging
from io import StringIO
import sys
from typing import Dict, Optional
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents.tools import Tool
from langchain.llms import OpenAI
@zacgx
zacgx / task-dag-creation.py
Created December 5, 2017 00:34 — forked from tmarthal/task-dag-creation.py
DAG Creation from within a PythonOperator task DOES NOT WORK
# -*- coding: utf-8 -*-
from airflow.operators.http_operator import SimpleHttpOperator
from airflow.operators.postgres_operator import PostgresOperator
from airflow.operators.subdag_operator import SubDagOperator
from airflow.operators.sensors import SqlSensor
from airflow.hooks.postgres_hook import PostgresHook
from airflow.operators.python_operator import PythonOperator
from airflow.models import Variable, DAG
@zacgx
zacgx / task-dag-creation.py
Created December 5, 2017 00:34 — forked from tmarthal/task-dag-creation.py
DAG Creation from within a PythonOperator task DOES NOT WORK
# -*- coding: utf-8 -*-
from airflow.operators.http_operator import SimpleHttpOperator
from airflow.operators.postgres_operator import PostgresOperator
from airflow.operators.subdag_operator import SubDagOperator
from airflow.operators.sensors import SqlSensor
from airflow.hooks.postgres_hook import PostgresHook
from airflow.operators.python_operator import PythonOperator
from airflow.models import Variable, DAG
@zacgx
zacgx / to_redshift.py
Created April 5, 2017 18:12 — forked from josepablog/to_redshift.py
to_redshift.py
import gzip
from functools import wraps
import boto3
from sqlalchemy import MetaData
from pandas import DataFrame
from pandas.io.sql import SQLTable, pandasSQL_builder
import psycopg2
import codecs
import cStringIO
from io import BytesIO
@zacgx
zacgx / airflow-python3.sh
Last active July 19, 2022 15:15
Installing Airflow with CeleryExcuter, using PostgreSQL as metadata database and Redis for Celery message broker
# this script has been tested and worked in a freshly installed Ubuntu 16.04 and 16.10
# it assumes that you are running airflow in a private netowrk and no need to be worry about outside access
# if that's not the case, the lines for PostgreSQL and Redis in this script need to be updated accordingly
# run as root
sudo su
# initial system updates and installs
apt-get update && apt-get upgrade -y && apt-get autoremove && apt-get autoclean
apt-get -y install build-essential binutils gcc make git htop nethogs tmux