Skip to content

Instantly share code, notes, and snippets.

@popstas
popstas / README.md
Created January 4, 2020 13:06
Отчёт за год - шаблон

Обзор можно разделить на 3 части:

  1. Контент - что я читал, слушал и смотрел, самая полезная часть, отсюда можно что-то утянуть себе
  2. Технические итоги - для инженеров
  3. Про жизнь - кому интересно лично про меня

@popstas
popstas / Список книг 2019.md
Created September 18, 2019 15:08
Список книг 2019

Список книг TODO:

1. Анатолий Некрасов - Путы материнской любви

О последствиях избыточной заботы матерей о детях.

2. Ким Чан - Стратегия голубого океана

О том, как найти свою нишу в бизнесе.

3. Максим Батырев - 45 татуировок менеджера

Как правильно работать с людьми.

@popstas
popstas / docker-logs-localtime
Last active August 2, 2023 09:04
docker-logs-localtime - Replace all UTC dates in docker logs output to local dates in pipe
#!/usr/bin/env node
// replace all UTC dates to local dates in pipe
// usage: docker logs -t container_name | docker-logs-localtime
// install:
// curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime
// alternative: https://github.com/HuangYingNing/docker-logs-localtime
const pad = d => (d > 9 ? d : '0' + d);
@popstas
popstas / gnome-extensions-ubuntu-18.04.json
Created July 13, 2018 17:08
Gnome extensions that I used on Ubuntu 18.04
[
{
"name": "Ubuntu AppIndicators",
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator"
},
{
"name": "Ubuntu Dock",
"url": "https://micheleg.github.io/dash-to-dock/"
},
{
@popstas
popstas / gitlab-project-favicon.user.js
Last active May 14, 2022 13:15
Use og:image as favicon on Gitlab pages
// ==UserScript==
// @name Gitlab project favicon
// @author Stanislav Popov
// @version 0.1
// @namespace popstas.ru
// @description Use og:image as favicon on Gitlab pages
// @unwrap
// @noframes
// @run-at document-end
// @updateURL https://gist.github.com/popstas/9d17c1b0e1772a84581b3af8a342ad73/raw/1f2c562a128568e1b220457bdab1e9d60dc1467d/gitlab-project-favicon.user.js
@popstas
popstas / git.home.popstas.ru.conf
Last active May 20, 2018 22:24
nginx-site configs
server {
listen 443 ssl http2;
server_name git.home.popstas.ru;
access_log off;
ssl_certificate /etc/letsencrypt/live/git.home.popstas.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/git.home.popstas.ru/privkey.pem;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
location / {
proxy_pass http://localhost:10080;
proxy_set_header Host $http_host;
list_terms (){
uuids=$(gsettings get org.gnome.Terminal.ProfilesList list | tr -d \' | tr -d \[ | tr -d \] | tr -d ,)
for uuid in $(echo $uuids); do
gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid}/ visible-name | tr -d \'
done
}
select_term (){
selected="$(list_terms | sort -n | fzf)"
if [ -n "$selected" ]; then
@popstas
popstas / sa-core-2018-drupal-older-7.35.patch
Created April 26, 2018 05:50
SA-CORE-2018-004 for Drupal 7.34 or older
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 06acf93..d5963a0 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -2778,6 +2778,31 @@ function _drupal_bootstrap_variables() {
// Load bootstrap modules.
require_once DRUPAL_ROOT . '/includes/module.inc';
module_load_all(TRUE);
+
+ // Sanitize the destination parameter (which is often used for redirects) to
@popstas
popstas / media_buttons.ahk
Last active March 21, 2018 15:33 — forked from VitalyKondratiev/media_buttons.ahk
Управление воспроизведением с клавиатуры ( AutoHotkey)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
+^!End::Send {Media_Play_Pause}
+^!Left::Send {Media_Prev}
+^!Right::Send {Media_Next}
+^!Down::Send {Volume_Down}
+^!Up::Send {Volume_Up}
@popstas
popstas / ubuntu-preseed.txt
Last active October 11, 2017 18:28
ubuntu-preseed.txt
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/splash boolean false
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i console-setup/variantcode string
choose-mirror-bin mirror/http/proxy string
d-i debian-installer/language string en
d-i debian-installer/country string RU
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select us