Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import sqlite3
import json
import datetime
from pathlib import Path
import sys
def get_chat_data_from_db(db_path) -> list[dict]:
"""Extract chat data from the SQLite database"""
@jamiephan
jamiephan / README.md
Last active May 4, 2025 18:21
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@gmorse81
gmorse81 / values.yaml
Created January 22, 2024 05:14
ESPHome Helm Chart Config
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
#
image:
# -- image repository
repository: ghcr.io/esphome/esphome
@ersingencturk
ersingencturk / setup python.md
Last active May 26, 2024 15:09
Installing Python 3.11 & Rust on Raspberry Pi

Installing Python 3.11 & Rust on Raspberry Pi

Python 3.11 is not available as apt package on debian raspbian bullseye so installing from source needed

updatepython2v11.sh can be used to compile python 3.11 on raspberry pi

installing packages like bcrypt and cryptography needs rust compiling so rust compiler needed if you don't do that you will get error liek this:

Building wheels for collected packages: bcrypt
@whiskerz007
whiskerz007 / gist:9d146fcb99e6db1cfb9d21bd7287f5ed
Created August 7, 2019 10:12
Create a Windows Scheduled Task to synchronize the clock when the internet is established
C:\WINDOWS\System32\schtasks.exe /CREATE /RU "NT AUTHORITY\LOCAL SERVICE" /SC ONEVENT /EC "Microsoft-Windows-NetworkProfile/Operational" /MO "*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]" /TN "Update Time When Connected to Internet" /TR "C:\WINDOWS\System32\w32tm.exe /resync /force"
@nijave
nijave / metered.ps1
Created June 23, 2019 14:56
Powershell check if on metered network
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost()
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted")
@nax3t
nax3t / paperscript-sublimetext3-syntax.md
Last active December 28, 2020 16:04
Paperscript JS Syntax Highlighting - Sublime Text 3
  • Download and Install Sublime Text 3.1.1 Build 3176
  • Install Package Control (don't forget to restart Sublime after)
  • Install PackageResourceViewer (restart Sublime)
  • Open the Command Palette (Tools > Command Palette from Sublime task menu)
  • Enter open resource and select PackageResourceViewer: Open Resource
  • Enter html and select HTML
  • Enter sub and select HTML.sublime-syntax
  • Click Find > Find... from the Sublime task menu (or use cmd+f or ctrl +f) and search for (?:java|ecma)
  • Replace (?:java|ecma) on line 38 with (?:java|ecma|paper)
  • Save and close the file
@kauffmanes
kauffmanes / install_anaconda.md
Last active May 14, 2025 20:34
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active October 23, 2024 13:02
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@4ley
4ley / apache.conf
Created March 28, 2017 12:10
WordPress / Apache / Reverse Proxy
<VirtualHost ...>
...
# Reverse Proxy
ProxyRequests Off
#ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
ProxyPass /blog http://blog.example.org/blog
ProxyPassReverse /blog http://blog.example.org/blog
...
</VirtualHost>