Skip to content

Instantly share code, notes, and snippets.

View gist:c6f2b3509b65aed0371dd7d894039444
Received: by 2002:a5d:488d:0:0:0:0:0 with SMTP id g13csp4151818wrq;
Mon, 27 Jan 2020 09:16:22 -0800 (PST)
X-Google-Smtp-Source: APXvYqxAIuuMNWRi8bdVIKq81O0ZWPCWj21zuE9mBvvy8izndkifgeLExOGjic9x0XoYxzajyxJx
X-Received: by 2002:a17:906:1903:: with SMTP id a3mr14586374eje.102.1580145382718;
Mon, 27 Jan 2020 09:16:22 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1580145382; cv=none;; s=arc-20160816;
temoto /
Created Aug 2, 2019
Atom + Go with modules config for 2019-08

How to setup Atom for Go development with 1.11+ modules support

For projects outside GOPATH.

  • go get why: Run which bingo and have full path in clipboard.
  • (Atom) install package go-plus for format/build/test-on-save It's great, but go-plus autocomplete doesn't work with modules. Settings, packages, go-plus, Autocomplete, set Scope blacklist *
  • (Atom) install package ide-go
temoto /
Last active Oct 22, 2018
Automate lights color temperature via MQTT enabled dimmer (like Sonoff). Temporary location, will be moved to full repository.
#!/usr/bin/env python2
import os, sys, time
import astral, datetime
import paho.mqtt.client
# EDIT HERE TO CONFIGURE + run with env `mqtt_broker=addr:port mqtt_topic=cmnd/house/ct`
config = 'midnight scale_down sunrise 0% noon scale_up sunset 100%'
lat, lng = (58.0, 56.316) # Perm
temoto / parse.y.patch
Last active Dec 6, 2017
sqlite fail build with ENABLE_UPDATE_DELETE_LIMIT flag when sqlite3.c was configured without it, e.g. amalgamation from sqlite website
View parse.y.patch
--- a/src/parse.y 2017-12-06 05:26:36.000000000 +0300
+++ b/src/parse.y 2017-12-06 05:22:53.000000000 +0300
@@ -758,6 +758,13 @@
+%include {
+ #error To build SQLite with -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT you have to run ./configure with --enable-update-limit flag. \
+Most likely you are building amalgamation from which is not compatible with this feature. \

Keybase proof

I hereby claim:

  • I am temoto on github.
  • I am temoto ( on keybase.
  • I have a public key whose fingerprint is 1A40 5559 7839 D277 88D0 0647 F6C3 E55C 75EA CF08

To claim this, I am signing this object:

#!/usr/bin/env python3
import argparse
import bisect
import itertools
import sys
# % cat wordlist
# a b c
# pig bird
# rig sig
temoto / mysql-loop
Last active Jul 31, 2016
Tool for DBA / Operations. Repeats command against chunks of large MySQL table, delay between runs adapts to minimise load (judged by mean execution time of N last runs).
View mysql-loop
#!/usr/bin/env python3
import argparse
import itertools
import subprocess
import sys
import time
pk_alphabet_level1 = '0123456789abcdefghijklmnopqrstuvwxyz'.replace('.', '')
pk_alphabet_level2 = '0.......8.......g.......o.....u.....'.replace('.', '')
temoto /
Last active Mar 30, 2016
Sync (overwrite) IAM public SSH keys to my servers at regular intervals. Update keys immediately on change is possible but make it yourself. CloudTrail-CloudWatch-{write this poll service}.
#!/usr/bin/env python3
import botocore.session
import distutils.spawn
import codecs
import grp, pwd
import os
import shutil
import subprocess
import sys
from datetime import datetime
temoto /
Last active Mar 15, 2016
MySQL administration: convert MyISAM tables to InnoDB
sql_list="select table_schema, table_name from information_schema.tables where lower(engine) = 'myisam' and table_schema not in ('mysql', 'information_schema', 'performance_schema') order by data_length;"
mysql --batch --silent -e "$sql_list" |while read -r d t; do
printf "\n---\n$d.$t "
mysql --batch --silent -e "select (data_length+index_length)/1e6 from information_schema.tables where table_schema='$d' and table_name='$t';"
time mysql --batch --silent -e "alter table $d.$t engine='innodb';"
temoto / megafon-account.bash
Last active Mar 3, 2016
Экспорт балансов Мегафона. Работает с TLSv1 уральского региона (информация актуальна 2016-03-03).
View megafon-account.bash
set -e
umask 0077