Skip to content

Instantly share code, notes, and snippets.

View 62mkv's full-sized avatar

Kirill M 62mkv

  • Breakwater Technology
  • Tallinn, Estonia
View GitHub Profile
@62mkv
62mkv / gist:43dfeee66991442d674e6b4aa5f5d7ca
Created December 27, 2016 04:00
how to run a debug-mode SSH on a separate port
/usr/sbin/sshd -p 2222 -ddd
@62mkv
62mkv / gist:51398dc2511fcf684ff87d3f044d95b9
Last active September 29, 2017 09:47
How to update Android SDK components (this is necessary to accept licenses)
# cd to ANDROID_SDK folder:
cd /opt/android-sdk-linux
# show which packages are available for install (for example, for Build Tools 25:)
./tools/android list sdk --all | grep Build | grep 25
# 3- Android SDK Build-tools, revision 25.0.2
# 4- Android SDK Build-tools, revision 25.0.1
# 5- Android SDK Build-tools, revision 25
# 25- Android SDK Build-tools, revision 19.0.2 (Obsolete)
@62mkv
62mkv / gist:8f476e3a3477dddda563dbbbda3dc81f
Last active April 14, 2017 06:21
bash: sed: how to print X lines of a file starting with a line N
# show lines 1000-1010 in "filename" file
sed -n '{1000,+100p}' filename
# another option is more simplistic syntax:
sed -n 1000,+10p filename
# also display line numbers:
sed -n '1000,+10{p;=}' filename
# other useful one-liners are available here: http://sed.sourceforge.net/sed1line.txt
@62mkv
62mkv / README.md
Last active August 30, 2017 04:24
NHP KMS recipes for KIOSK

подключение к БД на киоске

запускаем psql

sudo -u postgres psql

показываем доступные СУБД

\l

подключаемся к нужной (с номером нужного паблиша)

\c kms_1478787944

@62mkv
62mkv / Search-and-Replace-Structurally.md
Last active February 21, 2022 16:27
IntelliJ IDEA Receipts

Examples of Structural Search and Replace (IntelliJ IDEA 2017)

Use case 1 (Search)

Find all *DTO classes, that have a (at least one) public field that is neither @ApiModelProperty, nor a @JsonIgnore

  1. Open Edit->Find->Search structurally

  2. Paste this into Search template field:

@62mkv
62mkv / oracle.md
Last active February 4, 2020 11:01
Oracle cheatsheet
  • Show table DDL:
    select dbms_metadata.get_ddl('TABLE', '<your table name>') from dual

  • List all of the (available) tables: select * from user_tables

@62mkv
62mkv / find-class-in-jar
Last active May 13, 2019 07:31
Find class in a set of JAR files
sudo find /path/to/ -name "*.jar" -exec sh -c 'jar -tf {}| grep -H --label {} package' \;

It's very annoying when you write some code at work, say, reproducible cases for OSS issues, but then commit those under work-related credentials and push on GH

To avoid this from happening, I've wrote such a pre-push hook and put it into .git-templates folder (see recipe on global hooks)

#!/bin/bash -e
#
# Git pre-push hook that blocks push if commits are authored or committed using non-personal credentials
#
# Source: https://github.com/git/git/blob/87c86dd14abe8db7d00b0df5661ef8cf147a72a3/templates/hooks--pre-push.sample
@62mkv
62mkv / README.md
Last active October 25, 2021 21:47
How to debug SSL issues with Java-based server application

How to debug an HTTPS connection issue with Spring Boot based Java application

  1. Advanced logging:
  • java -jar -Djavax.net.debug=ssl:handshake:verbose app.jar
  1. make sure you specify correct configuration:
  • java -jar -Djavax.net.debug=ssl:handshake:verbose app.jar --server.port=8443 --server.security.require-ssl=true --server.ssl.key-store=/path/to/keystore --server.ssl.key-store-password=password --server.ssl.protocol=TLS
  1. See what’s in the store:
  • keytool -list -keystore /path/to/keystore -storepass password
@62mkv
62mkv / playground.rs
Created August 4, 2019 21:14 — forked from rust-play/playground.rs
Code shared from the Rust Playground
//! [dependencies]
//! fstrings = "0.1.4"
//! itertools = "0.8.0"
//! lazy_static = "1.3.0"
//! libc = "0.2.60"
//! libloading = "0.5.2"
#[macro_use] extern crate fstrings;
use ::std::{*,