Skip to content

Instantly share code, notes, and snippets.

View alex-pat's full-sized avatar

Alexander Pateenok alex-pat

View GitHub Profile
@alex-pat
alex-pat / Article.md
Last active October 4, 2023 14:11
Голосовой помощник

Делаем голосового помощника своими руками

С самого выхода Космической одиссеи Стенли Кубрика люди мечтали иметь компьютер, с которым можно было бы общаться так же, как с другим человеком. Прошло уже почти полвека с момента выхода сей культовой картины, а технологии лишь недавно позволили людям приблизиться к технологиям воображаемого будущего. И хотя космические корабли всё ещё слабо бороздят Большой театр просторы Вселенной,

@alex-pat
alex-pat / toggle_border.lua
Created May 4, 2017 16:29
awesome wm border toggling binding
awful.key({ modkey, "Control" }, "c",
function (c) c.border_width = c.border_width > 0 and 0 or beautiful.border_width end,
{description = "toggle border", group = "client"})
! 3/15/2017, 10:20:32 AM https://vk.com/feed
vk.com##.post_views
! 3/15/2017, 10:22:13 AM https://vk.com/feed
vk.com##._link.post_like_link
! 3/15/2017, 10:24:02 AM https://vk.com/feed
vk.com##._link.post_reply_link
! 3/15/2017, 10:32:58 AM https://vk.com/feed
@alex-pat
alex-pat / empls.py
Last active March 12, 2017 21:26
bsuir employees
#!/usr/bin/env python3
from xml.dom import minidom
from employees.models import Employee
def add_attr(employee, dom, attr_name):
attr = dom.getElementsByTagName(attr_name)
employee[attr_name] = attr[0].childNodes[0].data if attr and attr[0].childNodes else ''
def parse(file):
@alex-pat
alex-pat / host_ping.sh
Created March 8, 2017 14:09
Raspberry Pi
#!/bin/bash
# sends ip to all devices in local network
PORT=3001
C_IP=$(ifconfig wlan0 | grep -oe 'addr:192.168.[[:digit:]]*' | cut -d. -f 3 )
COMPS=$(nmap 192.168.$C_IP.1/24 | grep "scan report" | grep -v raspberrypi | grep -oe '(192.168.[[:digit:]]*.[[:digit:]]*' | cut -d. -f4 )
for i in ${COMPS[@]}
do
echo "ip of pi is $(hostname -I)" | netcat "192.168.$C_IP.$i" "$PORT"
done
@alex-pat
alex-pat / scribd.js
Last active March 15, 2018 18:16
Scribd sheet music
// https://www.scribd.com/doc/70541177/Chop-Suey-Sheet-Music for example
$("span.a").css("color", "black");
$("img.absimg").css("opacity", 1);
$("div.page_blur_promo").remove();
$("div.between_page_module").remove();
$("div.text_layer").css("text-shadow","");
$("div.page_blur_promo_overlay").remove();
#!/usr/bin/env python3
# Как юзать
# python3 vksis-testing.py файл_с_вопросами.txt
import sys
import os
from random import choice
@alex-pat
alex-pat / main.py
Created December 22, 2016 08:27
token ring
#!/usr/bin/env python3
import os
import sys
import random
import time
SD = b'S'
ED = b'E'
RING_SIZE = 5
@alex-pat
alex-pat / vksis-test-stat.sh
Created December 20, 2016 22:28
статы по токсу
# Сколько вопросов в каждом файле
$ for i in *.txt; do echo " $(grep -c "Q:" "$i") tests in $i"; done
46 tests in ATM, ISDN, Frame Relay, FDDI.txt
67 tests in common.txt
23 tests in Ethernet.txt
24 tests in ISO HDLC&X.25.txt
19 tests in ISO high&transp.txt
29 tests in OSI_ISO model.txt
21 tests in stack-ipx_spx.txt
119 tests in stack-tcp_ip.txt
@alex-pat
alex-pat / toks.org
Created December 11, 2016 22:40
toks

Var 18 S -> C 700 Double segment

NC-SSNANFLAGSDATA
1–>0SYN0
2<–50001SYN, ACK0
3–>15001ACK0
4<–50011ACK200