Skip to content

Instantly share code, notes, and snippets.

View Realetive's full-sized avatar

Realetive Realetive

View GitHub Profile
@Realetive
Realetive / oath-qrcode.sh
Created October 11, 2022 23:38 — forked from martint17r/oath-qrcode.sh
Generate TOTP QRcode for Google Authenticator for 2FA on linux debian wheezy
#!/bin/bash
USERNAME=$1
HOSTNAME=$(hostname --fqdn)
qrencode -t ANSI256 -o - $(echo otpauth://totp/$USERNAME@$HOSTNAME?secret=$(oathtool --totp -v $(grep $USERNAME /etc/users.oath | cut -f 4) | grep Base32 | cut -d " " -f 3))
@Realetive
Realetive / widget.md
Created April 5, 2021 05:10 — forked from AlexxNB/widget.md
Howto make no-depends widget on Svelte and load it on the page

We should have at least three files: 'Widget.svelte', 'rollup.config.js' and 'package.json':

  1. Our widget Widget.svelte:
<script>
	export let name;
</script>

<h1>Hello {name}!</h1>
<form>
<fieldset>
<legend>Прозвище Дракса из «Стражей Галактики»?</legend>
<label>
<input type="radio" name="answer" value="Exterminator">
Уничтожитель
</label>
<label>
<input type="radio" name="answer" value="Destroyer">
Разрушитель
@Realetive
Realetive / from.json
Created September 13, 2019 08:06
Есть выборка из БД списка заказов. В каждом заказе есть products[].options[].tickets с количеством билетов и products[].product.directions[].ticket с параметрами каждого из билетов. Нужно так обойти граф, чтобы собрать общую статистику по каждому типу билетов: их суммарном количестве и стоимости.
[
{
"_id": {
"$oid": "5d49a871e8a893003da5aae7"
},
"products": [
{
"key": "8900a49ddca428441cab91c14e9cf85f580cfdc2",
"product": {
"_id": "cfzISQI39vvEyEH3XJV0Ru",
@Realetive
Realetive / offer.md
Created April 25, 2019 14:02
Разработка REST-сервера (open-source)
@Realetive
Realetive / remove-gpg-user.sh
Created February 25, 2019 12:36
Git-crypt remove user.
#!/usr/bin/env bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
$ sudo locale-gen ru_RU.UTF-8
$ sudo apt-get update && sudo apt-get upgrade -y

Keybase proof

I hereby claim:

  • I am realetive on github.
  • I am realetive (https://keybase.io/realetive) on keybase.
  • I have a public key whose fingerprint is DE14 3334 9B51 7C97 8A1A E45E 323B 9165 DB5B BBE2

To claim this, I am signing this object:

| Воскресенье, 4 марта || Понедельник, 5 марта || Вторник, 6 марта || Среда, 7 марта || Четверг, 8 марта || Пятница, 9 марта ||
| 10:00 | 11:00 | 12:00 | 13:00 | 14:00 | 15:00 | 16:00 | 17:00 | 18:00 | 19:00 | 20:00 | 21:00 | 22:00 | 23:00 || 10:00 | 11:00 | 12:00 | 13:00 | 14:00 | 15:00 | 16:00 | 17:00 | 18:00 | 19:00 | 20:00 | 21:00 | 22:00 | 23:00 || 10:00 | 11:00 | 12:00 | 13:00 | 14:00 | 15:00 | 16:00 | 17:00 | 18:00 | 19:00 | 20:00 | 21:00 |
@Realetive
Realetive / .vimrc
Last active July 20, 2018 23:10
NeoVim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'altercation/vim-colors-solarized'