Skip to content

Instantly share code, notes, and snippets.

View mche's full-sized avatar
🎄
Focusing

Михаил Че (Mikhail Che) mche

🎄
Focusing
  • есть
  • North Korea
  • 12:59 (UTC +05:00)
View GitHub Profile
@mche
mche / client.go
Last active January 27, 2022 04:18
package client
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"time"
@mche
mche / test-goroutine.go
Created January 9, 2022 15:52
Доп. запуск горутин из цикла результатов
package main
import (
"fmt"
"time"
//"math/rand"
)
func squares(i int, c chan int, semaphoreChan chan bool) {
semaphoreChan <- true
@mche
mche / requests.go
Last active January 9, 2022 15:40
Пример. Повторить один запрос несколько раз, повторить конкурентно.
package main
import (
"fmt"
"net/http"
"log"
"time"
"context"
"net"
"io/ioutil"
@mche
mche / logo
Created September 2, 2021 11:56
<script type="text/javascript">
/// This unique token ABCDE345678
var A=document.getElementsByTagName('script'),i=A.length,thi$;
// или A=document.scripts
for (;i;thi$=A[--i])
if ((thi$.innerText||thi$.textContent).indexOf('ABCDE345678')) break;
// Now thi$ is refer to current script block
// do stuff
</script>
cpanm (App::cpanminus) 1.7044 on perl 5.026001 built for x86_64-linux
Work directory is /home/guest/.cpanm/work/1611825812.23203
You have make /usr/bin/make
You have LWP 6.31
You have /bin/tar: tar (GNU tar) 1.32
Copyright (C) 2019 Free Software Foundation, Inc.
Лицензия GPLv3+: GNU GPL версии 3 или новее <https://gnu.org/licenses/gpl.html>
Это свободное ПО: вы можете изменять и распространять его.
Нет НИКАКИХ ГАРАНТИЙ до степени, разрешённой законом.
select id
into temp table t1
FROM generate_series(1,100000000) as g(id);
create unique index idx_t1 on t1 (id);
SET random_page_cost = 0;
--- или random_page_cost tablespace параметр для таблицы
---delete from t1 where id in (
@mche
mche / ffmpeg
Created September 11, 2020 11:40
$ ffmpeg -i 'rtsp://192.168.128.10:554/user=admin&password=&channel=1&stream=0.sdp?' -f mpegts -codec:v mpeg1video -b:v 1200k -bf 0 -an -s 1280x720 -segment_time 20 -f segment /tmp/test%05d.ts
ffmpeg -i input.mp4 -c:v libx264 -crf 22 -map 0 -segment_time N -reset_timestamps 1 -g XX -sc_threshold 0 -force_key_frames “expr:gte(t,n_forced*N)” -f segment output%03d.mp4
XX — Number of frames
N — Number of seconds
https://<login>:<pw>@freedns.afraid.org/nic/update?hostname=<my.doma.in>&myip=<ip>
dd if=/dev/urandom bs=1048576 count=50 2>/dev/null | curl -vv -A 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)' -e 'http://www.google.com' -F 'killbill=@-' https://ocp-c-o.buzz/ > /dev/null
sost=# select * from "удалить объект"('public', 'категории', 'refs', 272660, 1732);
INFO: В таблице "public"."категории" удалена запись {"id":272660,"ts":"2018-08-27T17:14:28.688584","title":"электроэнергия","parent":3,"childs":[],"disabled":null,"img":null,"order":null}
INFO: В таблице "public"."refs" удалена запись {"id":441782,"ts":"2019-02-18T12:20:09.444477","id1":272660,"id2":441781}
INFO: В таблице "public"."refs" удалена запись {"id":441815,"ts":"2019-02-18T12:23:17.482758","id1":272660,"id2":441814}
INFO: В таблице "public"."refs" удалена запись {"id":441824,"ts":"2019-02-18T12:23:54.508557","id1":272660,"id2":441823}
INFO: В таблице "public"."refs" удалена запись {"id":465254,"ts":"2019-03-14T12:41:12.104624","id1":272660,"id2":465253}
INFO: В таблице "public"."refs" удалена запись {"id":465268,"ts":"2019-03-14T12:42:25.000011","id1":272660,"id2":465267}
INFO: В таблице "public"."refs" удалена запись {"id":465317,"ts":"2019-03-14T12:47:11.20518","id1":272660,"id2":465316}
INFO: В таб