Skip to content

Instantly share code, notes, and snippets.

@jakzal
jakzal / 1 Readme.md
Last active December 13, 2023 21:18
Nextcloud behind Cloudflare on a Raspberry PI
@Omerr
Omerr / git lol.md
Last active March 11, 2024 06:09
git lol - an alias to Git that shows the commit graph in a pretty format

log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To configure as an alias git lol:

git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit"

@pawl
pawl / copy_table.py
Last active January 17, 2023 20:48
Copy Schema Of A Remote Database Table To A New Local Table With SQLalchemy
from sqlalchemy import create_engine, Table, Column, Integer, Unicode, MetaData, String, Text, update, and_, select, func, types
# create engine, reflect existing columns, and create table object for oldTable
srcEngine = create_engine('mysql+mysqldb://username:password@111.111.111.111/database') # change this for your source database
srcEngine._metadata = MetaData(bind=srcEngine)
srcEngine._metadata.reflect(srcEngine) # get columns from existing table
srcTable = Table('oldTable', srcEngine._metadata)
# create engine and table object for newTable
destEngine = create_engine('mysql+mysqldb://username:password@localhost/database') # change this for your destination database