Here are some helpful commands for managing ZFS and ZPool on Ubuntu
Useful for populating /etc/zfs/vdev_id.conf
:
printDisks() {
for i in /dev/sd[b-i]; do
fdisk -l $i
def df_to_sql_fast(df, table_name, numeric_columns, date_columns, append_or_replace, conn): | |
""" | |
Appends or overwrites a SQL Server table | |
using data from a Pandas DataFrame. | |
Submits df records at once for faster performance | |
compared to df_to_sql. | |
Parameters: | |
df (DataFrame): df used to create/append table | |
table_name (str): Name of existing SQL Server table |
[cmdletbinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string[]]$servers, | |
[ValidateScript({ | |
if(-Not ($_ | Test-Path )) { | |
throw "Folder does not exist" | |
} | |
return $true |
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
# Alternative to_sql() *method* for mssql+pyodbc or mssql+pymssql | |
# | |
# adapted from https://pandas.pydata.org/docs/user_guide/io.html#io-sql-method | |
import json | |
import pandas as pd | |
import sqlalchemy as sa | |
def mssql_insert_json(table, conn, keys, data_iter): |
# version 1.2 - 2022-11-01 | |
import pandas as pd | |
import sqlalchemy as sa | |
def df_upsert(data_frame, table_name, engine, schema=None, match_columns=None): | |
""" | |
Perform an "upsert" on a SQL Server table from a DataFrame. | |
Constructs a T-SQL MERGE statement, uploads the DataFrame to a |
Create a file: | |
$ vim /Users/Shared/logoutHook.sh | |
File content: | |
#!/bin/bash | |
say 'Hasta la vista baby!' | |
Set execution permission: | |
$ sudo chmod +x /Users/Shared/logoutHook.sh |
# ========= PROMPT ========= | |
# Version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats ' %b ' | |
# Render the prompt | |
setopt PROMPT_SUBST |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
/* | |
ClickHouse client version 1.1.53996. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.53996. | |
*/ | |
:) CREATE TABLE IF NOT EXISTS `employee` ( | |
:-] `empid` Int32, | |
:-] `deptid` Int32, | |
:-] `salary` Int64 |