Skip to content

Instantly share code, notes, and snippets.

Serghei Iakovlev sergeyklay

Block or report user

Report or block sergeyklay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sergeyklay
sergeyklay / minikube-vokuro.md
Last active Sep 13, 2019
Running Vökuró on Minikube (Kubernetes)
View minikube-vokuro.md

Running Vökuró on Minikube (Kubernetes)

Getting Started

Prepare project

git clone git@github.com:phalcon/vokuro.git
git checkout 4.0.x
composer install
View bash.generate.random.alphanumeric.string.sh
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@sergeyklay
sergeyklay / template.service
Created Jul 14, 2019 — forked from chrj/template.service
Sample service unit file for systemd
View template.service
[Unit]
Description=My service
[Service]
ExecStart=/usr/local/bin/my-service \
-argument value \
-otherargument othervalue
# Setuid/Setgid
User=nobody
@sergeyklay
sergeyklay / journalctl-cheatsheet.md
Last active Aug 19, 2019
Journalctl Cheat Sheet
View journalctl-cheatsheet.md

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@sergeyklay
sergeyklay / version-compare.clj
Created Jun 22, 2019
Simple version compare using clojure
View version-compare.clj
(defn- normalize-verison
[version]
(let [[x y z] (map read-string (clojure.string/split version #"\."))
z (or z 0)]
(+ (* x 10000) (* y 100) z)))
(defn version-compare
[a b]
(let [left (normalize-verison a)
right (normalize-verison b)]
@sergeyklay
sergeyklay / telnet-imap
Last active May 30, 2019
Playing with Gmail via Telnet
View telnet-imap
$ telnet-ssl -z ssl imap.gmail.com 993
Trying 173.194.222.109...
Connected to gmail-imap.l.google.com.
Escape character is '^]'.
* OK Gimap ready for requests from 193.201.216.169 z8mb75199760ljk
a1 LOGIN xxxxxxxx@gmail.com my-password-here
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
a1 OK xxxxxxxx@gmail.com authenticated (Success)
a2 LIST "" "*"
* LIST (\HasNoChildren) "/" "INBOX"
View discord-badge.md
[![Discord Server](https://img.shields.io/badge/Discord-blue.svg?logo=discord)](https://phalcon.link/discord)

Discord Server

View keybase.md

Keybase proof

I hereby claim:

  • I am sergeyklay on github.
  • I am klay (https://keybase.io/klay) on keybase.
  • I have a public key whose fingerprint is EDAC 8D91 F82C 0BBD 261C 1329 1E0B 5331 219B EA88

To claim this, I am signing this object:

View http-client-example.go
package main
import (
"fmt"
"golang.org/x/net/context"
cc "golang.org/x/oauth2/clientcredentials"
"io/ioutil"
"net/http"
"os"
)
@sergeyklay
sergeyklay / get-the-weather-data-for-my-city.el
Last active Apr 2, 2019
get the weather data for my city
View get-the-weather-data-for-my-city.el
(require 'json)
(defvar owm/base-api-url "api.openweathermap.org")
(defvar owm/base-api-ver 2.5)
(defvar owm/api-key "PUT_API_KEY_HERE")
(defvar owm/default-scheme "https")
(defun owm/build-url (appid lat lon lang units)
(let* ((local (format "data/%s/weather" owm/base-api-ver))
You can’t perform that action at this time.