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 / 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 Jul 18, 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))
@sergeyklay
sergeyklay / .dir-local.el
Last active Apr 28, 2019
.dir-local.el for PHP-extension
View .dir-local.el
;;; Directory Local Variables
;; For more information see (info "(emacs) Directory Variables")
((nil . ((intent-tabs-mode . t)
(fill-column . 80)))
(c-mode . ((c-file-style . "k&r")
(tab-width . 4)
(c-basic-offset . 4)
(flycheck-checker . c/c++-gcc)
(flycheck-disabled-checkers c/c++-clang)
@sergeyklay
sergeyklay / beanstalkd.sh
Created Aug 21, 2018
/etc/sysconfig/beanstalkd
View beanstalkd.sh
# System configuration for the beanstalkd daemon
# Available options correspond to the options to the
# beanstalkd commandline.
BEANSTALKD_ADDR=0.0.0.0
BEANSTALKD_PORT=11300
BEANSTALKD_USER=beanstalkd
# Job size is left to the default. Uncomment and set it
You can’t perform that action at this time.