This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
# Get this from the DB after creating the sensor/helper | |
METADATA_ID = 500 # input_number.heart_rate | |
connection_gadget = sqlite3.connect("samba/public/Gadgetbridge") | |
cursor_gadget = connection_gadget.cursor() | |
connection_hass = sqlite3.connect("homeassistant/config/home-assistant_v2.db") | |
cursor_hass = connection_hass.cursor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build objects to create Notification for | |
# | |
# | |
# In [10]: Build.objects.filter(date__year__in=[2023, 2024]).exclude(error="").count() | |
# Out[10]: 1231365 | |
# Different types of Notification messages we need | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
▶ colordiff -u /home/humitos/rtfd/code/sphinx_rtd_theme/.tox/py310-sphinx72/tmp/html/demo/demo.html /home/humitos/rtfd/code/sphinx_rtd_theme/.tox/py310-sphinx72-qa/tmp/html/demo/demo.html | |
--- /home/humitos/rtfd/code/sphinx_rtd_theme/.tox/py310-sphinx72/tmp/html/demo/demo.html 2023-08-25 19:29:48.401670197 +0200 | |
+++ /home/humitos/rtfd/code/sphinx_rtd_theme/.tox/py310-sphinx72-qa/tmp/html/demo/demo.html 2023-08-25 19:28:19.342350784 +0200 | |
@@ -1,7 +1,7 @@ | |
<!DOCTYPE html> | |
<html class="writer-html5" lang="en" > | |
<head> | |
- <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> | |
+ <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta content="reStructuredText, demonstration, demo, parser" name="keywords" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to email owners of organizations | |
that have domains already on Cloudflare. | |
We are asking more about their setup. | |
Email at https://pad.riseup.net..... | |
""" | |
from pprint import pprint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Download file from https://www.sports-tracker.com/ | |
// Example: https://www.sports-tracker.com/workout/jaumenarbona/61b508ae59ba772af9278c87 | |
// | |
// Based on: | |
// - https://ivanderevianko.com/2016/04/export-all-workouts-from-sports-tracker | |
// - https://gist.github.com/KonstantinosSykas/dfe4c5e392e299ab9341d6e16299454f | |
// | |
// | |
// Instructions: | |
// 1. Open the URL of the workaround you want to export |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- running queries | |
SELECT pid, age(clock_timestamp(), query_start), usename, state, query | |
FROM pg_stat_activity | |
WHERE state != 'idle' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from django.utils import timezone | |
from readthedocs.analytics.models import PageView | |
from readthedocsext.spamfighting.utils import spam_score | |
def is_active_project( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nov 11 20:21:10 julia kernel: Bluetooth: hci0 link tx timeout | |
nov 11 20:21:10 julia kernel: Bluetooth: hci0 killing stalled connection fc:a8:9a:b9:45:14 | |
nov 11 20:21:10 julia kernel: Bluetooth: hci0 link tx timeout | |
nov 11 20:21:10 julia kernel: Bluetooth: hci0 killing stalled connection fc:a8:9a:b9:45:14 | |
nov 11 20:21:12 julia bluetoothd[3336]: Disconnecting failed: already disconnected | |
nov 11 20:21:16 julia bluetoothd[3336]: Close: Connection timed out (110) | |
nov 11 20:21:16 julia kernel: Bluetooth: hci0 link tx timeout | |
nov 11 20:21:16 julia kernel: Bluetooth: hci0 killing stalled connection fc:a8:9a:b9:45:14 | |
nov 11 20:21:18 julia bluetoothd[3336]: Abort: Connection timed out (110) | |
nov 11 20:21:18 julia kernel: Bluetooth: hci0 link tx timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Reproduction of | |
;; https://stackoverflow.com/questions/45907854/browse-url-generic-program-as-a-safe-local-variable-values | |
(custom-set-variables | |
'(safe-local-variable-values | |
(quote | |
( | |
(browse-url-generic-program "firefox") | |
(browse-url-generic-program "google-chrome") | |
)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[21:07] humitos: ~> python | |
Python 2.7.12 (default, Jul 18 2016, 15:02:52) | |
[GCC 4.8.4] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from __future__ import unicode_literals | |
>>> 'a' | |
u'a' | |
>>> # :) | |
... | |
>>> import md5 |
NewerOlder