Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
@notpushkin
notpushkin / outline-keygen.sh
Last active January 18, 2024 11:32
Outline VPN server stack adapted for use with Lunni / Docker Swarm
#!/bin/bash
set -euo pipefail
fb="$(tput bold)"
fn="$(tput sgr0)"
log() {
echo "$1" > /dev/stderr
}
@notpushkin
notpushkin / tic_tac_toe.py
Last active June 22, 2022 05:37
A tic-tac-toe game, (almost) implemented by GitHub Copilot
# Prompt:
"""A tic-tac-toe game."""
# Everything down below is autocompleted:
def print_board(board):
"""Prints the board."""
print(board[0] + ' | ' + board[1] + ' | ' + board[2])
print('---------')
#!/bin/bash
# Wrapper for brightnessctl, adding:
# - custom maximum value (useful when you override PWM settings)
# - smooooooooooooooooooooooooooooooooothiness
# - desktop notification
#
# Author: Alexander Pushkov <backlit@ale.sh>
# SPDX-License-Identifier: Apache-2.0 OR ISC
DELTA=2
$ flatpak run -vv com.github.suzie97.communique 2>&1 | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }'
[2021-09-04 18:05:37] F: No installations directory in /etc/flatpak/installations.d. Skipping
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: /var/lib/flatpak/runtime/io.elementary.Platform/x86_64/6/f6458cfe79a53d649c33716c75262c1a2027121f0290b529644adee9a809d39e/files/lib32 does not exist
[2021-09-04 18:05:37] F: Cleaning up unused container id 3669369054
An SSH key to connect to GitLab.com. Can read any public repos.
Public counterpart (feel free to add to your Git hostings as well):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDFlf7wWgBodc2IAnKweYK6qXR81h7S/6+FUkugxvuTm
@notpushkin
notpushkin / bpmtools.py
Created December 23, 2020 22:56
Double or halve stepchart BPM
def to_pairs(xs):
seq = iter(xs)
while True:
try:
x = next(seq)
except StopIteration:
return
try:
y = next(seq)
except StopIteration:
TOKEN="" # get yours at https://open-vsx.org/user-settings/tokens
temp_file="$(mktemp)"
namespace="${1?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
package_name="${2?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
version="$(curl "https://vscode-marketplace-api.herokuapp.com/${namespace}/${package_name}" | jq -r .Version)"
echo "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage"
curl --compressed "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage" > "${temp_file}"
@notpushkin
notpushkin / prigorod-client.js
Created June 8, 2020 00:42
API для покупки билетов на электрички РЖД (протестировано на СЗППК)
import { stringify as qs } from "querystring";
const API_V3_1 = "https://mobile.svrpk.ru/v3.1/api.php";
const API_MOBILE_USERS = "https://mobile.svrpk.ru/mobile_users/api.php";
export default class PrigorodClient {
static getApiToken() {
return fetch(
API_V3_1 +
"?" +
@notpushkin
notpushkin / README.md
Last active June 18, 2020 08:21
Docker OpenAPI schema converted from https://docs.docker.com/engine/api/v1.40.yaml for use with Swagger UI

Open with Swagger UI: v1.40