Skip to content

Instantly share code, notes, and snippets.

View mche's full-sized avatar
🎄
Focusing

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

🎄
Focusing
  • есть
  • North Korea
  • 23:15 (UTC +05:00)
View GitHub Profile
@mche
mche / manual sound capture linux
Last active January 16, 2018 13:51
Захват исходящего звука с сайта говорилки
# узнать монитор устройство для захвата
$ ls /dev/snd/by-path/
pci-0000:00:1f.3
# захват на устройстве (вместо двоеточия будет _)
$ parec -d 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' --file-format=wav output.wav
# хорошая говорилка https://www.linguatec.de/voice-reader-home-15-demo/
# обрезка со второй по седьмую секунду
find lib -type f -name '*.pm' -exec grep -Hni "$позиции тмц" {} \; -exec perl -pi.bak -e 's/\$позиции тмц/@позиции тмц/g' {} \;
find static/js -type f -name '*' -exec grep -Hni "$позиции тмц" {} \; -exec perl -pi.bak -e 's/\$позиции тмц/@позиции тмц/g' {} \;
find lib -type f -name '*.pm.bak' -ls -delete
find static/js -type f -name '*.bak' -ls -delete
@mche
mche / log
Created October 25, 2018 06:43
Th 25.10 11:14:36 [d] 3190〉Mojolicious:126 GET "/phpMyAdmin/phpMyAdmin/index.php" (c3843a98)
Th 25.10 11:14:37 [d] 3190〉Mojolicious:126 GET "/phpMyAbmin/index.php" (c0dd0465)
Th 25.10 11:14:38 [d] 3190〉Mojolicious:126 GET "/phpMyAdmin__/index.php" (32b71710)
Th 25.10 11:14:39 [d] 3190〉Mojolicious:126 GET "/phpMyAdmin+++---/index.php" (e633c190)
Th 25.10 11:14:40 [d] 3190〉Mojolicious:126 GET "/v/index.php" (5a6d6071)
Th 25.10 11:14:42 [d] 3190〉Mojolicious:126 GET "/phpmyadm1n/index.php" (3d656294)
Th 25.10 11:14:42 [d] 3190〉Mojolicious:126 GET "/phpMyAdm1n/index.php" (b74dc8d0)
Th 25.10 11:14:43 [d] 3190〉Mojolicious:126 GET "/shaAdmin/index.php" (b6553fee)
Th 25.10 11:14:43 [d] 3190〉Mojolicious:126 GET "/phpMyadmi/index.php" (5b31157e)
Th 25.10 11:14:45 [d] 3190〉Mojolicious:126 GET "/phpMyAdmion/index.php" (a9c51689)
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_commands="clean_cache"
extra_started_commands="reload upgrade force_stop"
#~ extra_stopped_commands="clean-cache-start"
description="Веб-система СоюзОСТ"
perl -pi.bak -e 's/\.(\d+) ₽/,$1 ₽/g' uniost.pg.dump.sql
perl -pi.bak2 -e 's/ (\d+,\d+) ₽/$1 ₽/g' uniost.pg.dump.sql
perl -pi.bak2 -e 's/ (\d+,\d+) ₽/$1 ₽/g' uniost.pg.dump.sql
perl -pi.bak2 -e 's/ (\d+,\d+) ₽/$1 ₽/g' uniost.pg.dump.sql
perl -pi.bak3 -e 's/(,\d+) ₽/$1/g' uniost.pg.dump.sql
psql -U postgres uniost < uniost.pg.dump.sql
@mche
mche / fstab
Created November 12, 2018 05:03
#/dev/md0
UUID=6ded2b63-2e27-4b10-805c-ae15d84f2120 /boot ext2 defaults,noatime 0 2
UUID=cd700869-67ba-4447-b17d-068bcf9c6031 none swap sw 0 0
#/dev/SysVg/lvroot
UUID=00ceb967-5c49-4f69-889f-a0adcdc813ad / ext4 noatime 0 1
#/dev/SambaVg/samba:
UUID=3dd4deb0-3773-4c95-8607-252b7699f7a2 /mnt/samba ext4 defaults,noatime 0 3
@mche
mche / postgresql init rc script
Last active November 15, 2018 11:10
Gentoo openrc postgresql init
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Comma-separated list of directories that contain a unix
# socket. Created and controlled by the related initscript. The
# directories created will be owned root:postgres with mode 1775.
#
# /run/postgresql is the default directory.
#~ PG_SOCKET_DIRECTORIES="/tmp"
@mche
mche / check_pid.pl
Last active February 4, 2019 06:46
process pid file #perl #mojo
use Mojo::File 'path';
# check process
sub check_pid {
my ($pid_path) = @_;
return undef unless -r $pid_path;
my $pid = $pid_path->slurp;
chomp $pid;
# Running
return $pid if $pid && kill 0, $pid;
grub-instal /dev/sda # или какой там у вас, lsblk покажет первым
grub-mkconfig -o /boot/grub/grub.cfg
dispatch-conf
// ==UserScript==
// @name Fotostrana popup remove
// @description Fotostrana popup remove
// @version 0.0.8
// @namespace https://gist.github.com/mche/a7f6f49a5257f2e9eb00b4be326e9fc7
// @updateURL https://gist.github.com/mche/a7f6f49a5257f2e9eb00b4be326e9fc7/raw/fotostrana.user.js
// @match https://fotostrana.ru/*
// @grant none
// ==/UserScript==