Skip to content

Instantly share code, notes, and snippets.

@popstas
popstas / winmove-desktop-4positions
Created January 16, 2021 16:37
Move window by `Ctrl+Alt+Shift+h/j/k/i/o/l/n`
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
LeftX := 0
LeftY := 0
RightX := 2560
RightY := -920
ResetWindowSize() {
WinGet activeWin, ID, A
posX := 0
@popstas
popstas / ansible.sh
Created March 26, 2017 01:41
Build docker and vagrant images with packer and ansible
#!/bin/bash -eux
# Install Ansible repository.
apt -y update && apt-get -y upgrade
apt -y install software-properties-common
apt-add-repository ppa:ansible/ansible
# Install Ansible.
apt -y update
apt -y install ansible
@popstas
popstas / dashboard.json
Created January 4, 2021 16:02
site-audit-seo Grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@popstas
popstas / Список книг 2019.md
Created September 18, 2019 15:08
Список книг 2019

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

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

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

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

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

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

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

@popstas
popstas / macosx.md
Last active August 12, 2020 01:29
mac os x setup log

Переезд с Ubuntu на Mac OS без нытья и розовых очков

На протяжении 2015 года я просмотрел много записей с конференций и прослушал очень много подкастов. Сложилось впечатление, что все пользуются маками. Я подумал, что это неспроста и решил как-нибудь попробовать, взять у знакомых макбук, посидеть на нем пару недель, но руки все не доходили. В итоге коллега напомнил о проекте Hackintosh, позволяющем запускать Mac OS на любом PC (оказалось, что не на любом). Я об этом раньше слышал краем уха и думал, что это набор костылей типа Wine, но потом прочитал статью на Geektimes и понял, что проблем не так уж много и все они решаются. И вот, 2 января был начат переезд.

Если коротко, то для меня мак для меня оказался приятной смесью Windows и Linux, на что я и рассчитывал. Минусы тоже есть, но плюсы перевешивают.

Этот пост преследует две цели: Первая в том, чтобы записать все грабли, чтобы после переустановки системы я смог настроить ее за вечер, а не за 2 недели. Вторая - чтобы

@popstas
popstas / planfix-task-list.php
Created April 23, 2020 14:04
Расширение отправляет задачи из 2 списков в планировщике Планфикса в json файл
<?php
$filename = 'planfix-tasks.json';
if($_POST['tasks']) {
file_put_contents($filename, $_POST['tasks']);
return;
}
$lists = json_decode(file_get_contents($filename));
foreach($lists as $listName => $data) {
@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/"
},
{
'''Trains a simple deep NN on the MNIST dataset.
Gets to 98.40% test accuracy after 20 epochs
(there is *a lot* of margin for parameter tuning).
2 seconds per epoch on a K520 GPU.
'''
from __future__ import print_function
import os
# os.environ['CUDA_VISIBLE_DEVICES']='-1'
@popstas
popstas / README.md
Created January 4, 2020 13:06
Отчёт за год - шаблон

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

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

@popstas
popstas / install.sh
Last active August 22, 2018 07:55
Install LAMP with ansible from geerlingguy
sudo apt-get install -y python-dev python-pip
sudo pip install ansible
sudo ansible-galaxy install geerlingguy.apache geerlingguy.mysql geerlingguy.php
wget https://gist.githubusercontent.com/popstas/61a5ddce08fe1a269f62576808cee54e/raw/de7bceea261f5a76fd88d8673046e5e18be7e35a/lamp.yml
ansible-playbook -i 'localhost,' -c local lamp.yml