Skip to content

Instantly share code, notes, and snippets.

View lexfrei's full-sized avatar
🎯
Overloaded

Aleksei Sviridkin lexfrei

🎯
Overloaded
View GitHub Profile
version: '2.2'
services:
openhab:
image: "openhab/openhab:2.2.0-amd64-debian"
restart: always
network_mode: host
tty: true
volumes:
- "/etc/localtime:/etc/localtime:ro"
{
"__inputs": [],
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"hideControls": false,
"id": null,
"links": [],
@lexfrei
lexfrei / log
Created May 7, 2018 22:19
Transmission build fail
/transmission-2.94/build # cmake ..
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
Sending build context to Docker daemon 63.49kB
Step 1/9 : FROM alpine
---> 3fd9065eaf02
Step 2/9 : RUN ["apk", "add", "--update", "--no-cache", "cmake", "gcc", "make", "musl-dev", "g++", "curl-dev", "zlib-dev", "patch", "automake", "autoconf", "libtool"]
---> Running in d5441ae37f7e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/45) Upgrading musl (1.1.18-r2 -> 1.1.18-r3)
--- C13
EVASIVE MANEUVERS uwg https://magic.wizards.com/en/content/evasive-maneuvers-commander-2013-card-set-archive
MIND SEIZE ubr https://magic.wizards.com/en/content/mind-seize-commander-2013-card-set-archive
--- C14 https://magic.wizards.com/en/articles/archive/arcana/commander-2014-edition-decklists-2014-10-31
PEER THROUGH TIME u ^
SWORN TO DARKNESS b ^
BUILT FROM SCRATCH r ^
GUIDED BY NATURE g ^
@lexfrei
lexfrei / price.js
Last active September 1, 2018 15:59
function priceToRub(usdPrice, currency, marks, name) {
Utilities.sleep(200)
if (name == "" ) {
return
}
var rubPrice = usdPrice * currency
if (isRu(name) && isFoil(marks)) {
***RB**R
B**R***B
***RB**R
B**R***B
***RB**R
B**R***B
***RB**R
B**R***B
CPU: Intel Core i7-4820K (Ivy Bridge-E, S1)
3700 MHz (37.00x100.0) @ 3911 MHz (39.00x100.3)
Motherboard: ASUS X79-DELUXE
Chipset: Intel C600/X79 (Patsburg)
Memory: 32768 MBytes @ 802 MHz, 11-11-11-28
- 4096 MB PC12800 DDR3 SDRAM - Kingston 99U5474-023.A00LF
- 4096 MB PC12800 DDR3 SDRAM - Kingston 99U5474-023.A00LF
- 4096 MB PC12800 DDR3 SDRAM - Kingston 99U5474-023.A00LF
- 4096 MB PC12800 DDR3 SDRAM - Kingston 99U5474-023.A00LF
- 4096 MB PC12800 DDR3 SDRAM - Kingston 99U5474-023.A00LF

В этом задании мы пишем аналог unix pipeline, что-то вроде:

grep 127.0.0.1 | awk '{print $2}' | sort | uniq -c | sort -nr

Когда STDOUT одной программы передаётся как STDIN в другую программу

Но в нашем случае эти роли выполняют каналы, которые мы передаём из одной функции в другую.

Само задание по сути состоит из двух частей

lex@localhost:~$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC0
native-path: AC0
power supply: yes
updated: Tue 04 Jun 2019 10:20:16 AM MSK (474 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: yes