Skip to content

Instantly share code, notes, and snippets.

View centralhardware's full-sized avatar

Alexey Fedechkin centralhardware

View GitHub Profile
import json
import logging
import os
from json.decoder import JSONDecodeError
from aiohttp import web
from telethon.sync import TelegramClient
def str2bool(boolean_string):
public class InlineKeyboardBuilder {
private final List<List<InlineKeyboardButton>> keyboard = new ArrayList<>();
private String text;
private List<InlineKeyboardButton> row = null;
private InlineKeyboardBuilder() { }
public static InlineKeyboardBuilder create() {
return new InlineKeyboardBuilder();
private <T extends Handler> boolean processHandler(Update update, List<T> handlers){
for (var handler : handlers) {
if (handler.isAcceptable(update)) {
handler.handle(update);
return true;
}
}
return false;
}
package me.centralhardware.znatoki.telegram.statistic.telegram;
import org.telegram.telegrambots.meta.api.objects.Update;
public interface Handler {
void handle(Update update);
boolean isAcceptable(String data);
[1042792.846146] sd 0:0:0:0: [sda] tag#9 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[1042792.846161] sd 0:0:0:0: [sda] tag#9 Sense Key : Aborted Command [current]
[1042792.846163] sd 0:0:0:0: [sda] tag#9 Add. Sense: I/O process terminated
[1042792.846166] sd 0:0:0:0: [sda] tag#9 CDB: Write(10) 2a 00 05 20 18 08 00 00 08 00
[1042792.846168] I/O error, dev sda, sector 85989384 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[1042792.846437] Buffer I/O error on dev dm-0, logical block 10485761, lost async page write
[1042792.846604] sd 0:0:0:0: [sda] tag#26 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[1042792.846606] sd 0:0:0:0: [sda] tag#26 Sense Key : Aborted Command [current]
[1042792.846607] sd 0:0:0:0: [sda] tag#26 Add. Sense: I/O process terminated
[1042792.846609] sd 0:0:0:0: [sda] tag#26 CDB: Write(10) 2a 00 07 a0 18 08 00 00 08 00
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>редактирование ученика</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
</head>
<body>
<h2>Редактирование ученика</h2>
@centralhardware
centralhardware / LuceneConfiguration.java
Last active July 29, 2023 16:48
scheduled fixed rate
@Component
@RequiredArgsConstructor
@Slf4j
public class Scheduler {
@Scheduled(fixedRate = 10, timeUnit = TimeUnit.MINUTES)
public void getAnalyzer() throws IOException {
log.info("Start update lucene index");
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.centralhardware.znatoki.telegram.statistic</groupId>
<artifactId>znatokiStatistic</artifactId>
<version>1.0-SNAPSHOT</version>
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:293)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:118)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:238)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.Simple
alex@photoprism ~/photoprisme> sudo docker-compose exec photoprism photoprism purge
DEBU[2022-07-22T14:57:19Z] config: successfully initialized [2.629138ms]
DEBU[2022-07-22T14:57:20Z] migrate: found 19 previous migrations
DEBU[2022-07-22T14:57:20Z] migrate: 20211121-094727 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20211124-120008 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20220329-030000 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20220329-040000 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20220329-050000 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20220329-060000 skipped
DEBU[2022-07-22T14:57:20Z] migrate: 20220329-061000 skipped