Skip to content

Instantly share code, notes, and snippets.

View artsi0m's full-sized avatar

Artsiom Karakin artsi0m

  • Unemployed
  • Minsk
  • 20:25 (UTC +03:00)
View GitHub Profile
@artsi0m
artsi0m / tomeet.sh
Last active September 17, 2021 15:52
Script i run before meeting with someone on meet.google.com
#!/bin/ksh
set +o sh
case $(sysctl kern.video.record ) in
kern.video.record=0 )
printf "%s\n" "Sysctl video record was not enabled"
sysctl kern.video.record=1
;;
esac
@artsi0m
artsi0m / last_post.sh
Last active August 10, 2021 20:44
Get last post from a static page
#!/usr/bin/env sh
set -e
Url=$1
Sleep_Arg=$2
[ -z "$Sleep_Arg" ] && Sleep_Arg=60
get_http_header_last_modified () {
curl "$1" --output /dev/null --silent --dump-header - \
@artsi0m
artsi0m / ed_promt.sh
Created August 1, 2021 10:40
Standard text editor
#chmod 444
# . ./ed_prompt.sh
alias ed='ed -p "# "'
export EDITOR="ed -p '~ '"
@artsi0m
artsi0m / home_backup.sh
Created August 9, 2021 16:00
Backing up my home partition
#!/bin/sh
set -e # Errexit
set -u # Nounset
set -o pipefail
dump -0un -f - /home | gzip -9 | age -r \
agekeyusedforfileencryption_https_age-encryption_org_v1 \
> /mnt/backup/home_dump-0.gz.age
@artsi0m
artsi0m / Array.diff.py
Last active August 16, 2021 17:23
My codewars snippets
################################################################
# https://docs.python.org/3/tutorial/datastructures.html
# https://docs.python.org/3/howto/sorting.html
# https://docs.python.org/3/library/stdtypes.html
def array_diff(a, b):
c = []
for el in a:
if el not in b:
c.append(el)
@artsi0m
artsi0m / setxkbmap.awk
Last active August 16, 2021 16:58
Changing keyboard layout
#!/usr/bin/awk -f
BEGIN {
cmd_query = "setxkbmap -query | awk '/layout/{print $2}' ";
cmd_us = "setxkbmap us -variant colemak";
cmd_ru = "setxkbmap ru -variant ruu";
cmd_query | getline layout;
close(cmd_query);
@artsi0m
artsi0m / file_uploader.sh
Created August 19, 2021 23:48
My custom file uploader. Suggestions would be taken in ease.
#!/usr/bin/env sh
# File uploader
FILENAME=$1
transfer_holder=https://transfer.sh
transfer_upload () {
curl --upload-file "$1" "$transfer_holder"/"$1"
}
transfer_upload "$FILENAME" | xclip -selection clipboard
@artsi0m
artsi0m / .xsession
Last active September 22, 2021 23:13
Report on GNOME builder on OpenBSD
# 0BSD github.com/artsi0m
# filename could be .xinitrc or .xsessions
# Here goes stuff from xbase.tgz:
export LC_CTYPE="en_US.UTF-8" &
xcompmgr &
xrdb -merge .Xresources &
xclock -digital -geometry 184x40+652+24 &
xload -geometry 120x137+340+24 &
@artsi0m
artsi0m / com.c
Last active February 11, 2024 17:16
Modified Tom Duff's com. (Original http://www.iq0.com/duffgram/com.c)
/*% cc -O0 -g % -o #
* com [-n] [file ...]
* looks for the sequence /*% in each file, and sends the rest of the
* line off to the shell, after replacing any instances of a `%' character
* with the filename, and any instances of `#' with the filename with its
* suffix removed. Used to allow information about how to compile a program
* to be stored with the program. The -n flag causes com not to
* act, but to print out the action it would have taken.
*
* This version of com would also create compile_flags.txt for clangd if

Как подключиться к wifi в библиотеках БГУИР из OpenBSD

Предисловие

Здесь не будет написано о причинах использовать OpenBSD. WiFi в БГУИР предоставляется бесплатно для студентов,