Skip to content

Instantly share code, notes, and snippets.

Konstantin Shapkin kestel

View GitHub Profile
@kestel
kestel / prepare_datadisk.yml
Created May 25, 2020
Prepare DataDisk in Azure Linux VM with ansible
View prepare_datadisk.yml
---
vars:
data_device: /dev/disk/azure/scsi1/lun0
data_disk_mount: /data
tasks:
- name: Setup data disk
become: true
block:
- name: Create partition on data disk
View gist:ba534253adbe215b7cdbb3dc3bb1959e
$ ls /opt/sonatype/sonatype-work/nexus3/db/
OSystem accesslog analytics audit component config model.properties security
$ docker-compose exec nexus java -jar ./lib/support/nexus-orient-console.jar
CONNECT PLOCAL:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
@kestel
kestel / renamer.py
Last active Aug 20, 2019
Rename files from format Safari Books Online Video Downloader to more human friendly
View renamer.py
#!/usr/bin/env python3
"""Rename files from format Safari Books Online Video Downloader
to more friendly"""
import os
import re
time_re = re.compile('(\d+m \d+s|\d+s).mp4')
number_re = re.compile('((\d{3})\s-\s).+.mp4')
chapter_re = re.compile('\d{3}-(\d+\s\d+).+.mp4')
@kestel
kestel / esp8266_i2c_lcd.ino
Last active Feb 12, 2017
Simple example for esp8266 with LCD 2004 screen by i2c
View esp8266_i2c_lcd.ino
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Original from https://gist.github.com/bavensky/8cc772149df9e349014b
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);
uint8_t heart[8] = {0x0,0xa,0x1f,0x1f,0xe,0x4,0x0};
View _01.temp_sensor_01.ino
// Code based on
// https://github.com/adafruit/DHT-sensor-library/blob/master/examples/DHTtester/DHTtester.ino
// https://gist.github.com/igrr/7f7e7973366fc01d6393
// https://github.com/iot-playground/Arduino/blob/master/ESP8266ArduinoIDE/DS18B20_temperature_sensor/DS18B20_temperature_sensor.ino
// esp8266 + dht22 + mqtt
#include "DHT.h"
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
View dht22_deepsleep.ino
// CPU 80MHZ, FLASH 4M/1M
/*
*** Sample using esp-01, D16 is connected to RST
*** If DHT22 is powered by a gpio( VCC of DHT22 is connected to a gpio) and OUTPUT of DHT22 is connected to D2, boot will fail.
*** Power off ----> D2 is in LOW( == DHT22 is in LOW) ==> SDIO boot mode.
Temperature and humidity values are each read out the results of the last measurement.
For real-time data that need continuous read twice, we recommend repeatedly to read sensors,
and each read sensor interval is greater than 2 seconds to obtain accuratethe data.
@kestel
kestel / influxdb.conf
Created Dec 29, 2016 — forked from acherunilam/influxdb.conf
Nginx config for InfluxDB HA
View influxdb.conf
http {
client_max_body_size 20M;
upstream influxdb {
server server1:8086;
server server2:8086;
}
upstream relay {
server server1:9096;
server server2:9096;
@kestel
kestel / tumblr-photo-ripper.rb
Created May 19, 2016 — forked from jamiew/tumblr-photo-ripper.rb
Download all the images from a Tumblr blog
View tumblr-photo-ripper.rb
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "doctorwho"
@kestel
kestel / RPi_I2C_driver.py
Created Sep 30, 2015 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
View RPi_I2C_driver.py
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
You can’t perform that action at this time.