Skip to content

Instantly share code, notes, and snippets.

@tmaiaroto
tmaiaroto / Dockerfile
Last active June 30, 2022 08:48
WordPress on Amazon ECS
FROM alpine:3.3
MAINTAINER Tom Maiaroto <[email protected]>
# Install packages
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
php7 \
@lwakefield
lwakefield / tabcomplete.vim
Last active January 23, 2018 21:12
tabcomplete
inoremap <expr> <tab> pumvisible() ? '<c-n>' : '<tab>'
inoremap <expr> <s-tab> pumvisible() ? '<c-p>' : '<tab>'
augroup autocomplete
autocmd!
autocmd TextChangedI * call TypeComplete()
augroup end
fun! TypeComplete()
if getline('.')[col('.') - 2] =~ '\K' && getline('.')[col('.') - 1] !~ '\K'
call feedkeys("\<c-n>")
end
@mitchellrj
mitchellrj / export_single_slack_channel.py
Last active January 4, 2019 10:44
Export history from a single Slack channel
#!/usr/bin/env python3
import csv
import datetime
import getpass
import os
import re
import sys
import time
@PattaFeuFeu
PattaFeuFeu / HA_Migrate-sqlite-to-mysql.md
Last active March 15, 2025 19:18
Steps necessary to migrate from HomeAssistant’s standard sqlite database to an external MariaDB(10) SQL database

Migrate Home Assistant’s sqlite database to MySQL, specifically MariaDB (10)

After having added a decent amount of entities to my Home Assistant setup, the user interface—especially the history tab, but also the history for each entity—became very sluggish. Having to wait for up to 30 seconds to see the history graph for a single entity became the norm with an sqlite file weighing in at 6GB and millions of entries in the “events” and “states” tables.

I wanted to keep my acquired data, so I had to migrate it from the current sqlite file to a MySQL database instead of starting anew. I’ve done this using Home Assistant version 0.81 and MariaDB 10. Some parts might change in the future.

Dump Home Assistant sqlite database

@Coopeh
Coopeh / kill-session.sh
Last active December 22, 2021 19:41
SSH Idle Session Kicker
#!/usr/bin/env bash
###
#
# SSH Inactive Session Killer
#
###
# Set idle time in hours - default is 12
idle_time="12"