Given that your key has expired.
$ gpg --list-keys
$ gpg --edit-key KEYID
Use the expire command to set a new expire date:
from django.db.models import OuterRef | |
weapons = Weapon.objects.filter(unit__player_id=OuterRef('id')) | |
units = Unit.objects.filter(player_id=OuterRef('id')) | |
qs = Player.objects.annotate(weapon_count=SubqueryCount(weapons), | |
rarity_sum=SubquerySum(units, 'rarity')) |
cd /path/to/files && | |
for file in *.mp3 *.mp4; do | |
if [[ -f "$file" ]]; then | |
if [[ -f "${file}.md5" ]]; then | |
echo "already exists: ${file}.md5" | |
else | |
md5sum -- "$file" > "${file}.md5"; | |
cat "${file}.md5"; | |
fi | |
fi |
# So... I took that as a challenge and displayed all dates that sums 68 from 1900 to 2088 (when I'm going to make 100 years). | |
# Be safe and avoid those dates. =P | |
from datetime import date | |
from datetime import timedelta | |
def sum_date(date): | |
date_str = date.strftime('%d %m %Y') | |
date_str = date_str[:8] + ' ' + date_str[8:] | |
return sum(map(int, date_str.split())) |
As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.
The problems and solutions described in the examples below have led to the development of sciluigi,
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
from myapp.models import BaseModel | |
import pytest | |
@pytest.fixture(scope="session") | |
def engine(): | |
return create_engine("postgresql://localhost/test_database") |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
function count_emails() { | |
var max = 500; | |
var offset = 0; | |
var emails = []; | |
while (true) { | |
var threads = GmailApp.search("in:anywhere", offset, max); | |
emails = searchThreads.concat(threads); | |
if (threads.length < max) { |