Skip to content

Instantly share code, notes, and snippets.

@rsyuzyov
rsyuzyov / dhcp-dyndns.sh
Created February 27, 2024 16:43
dhcp-dyndns.sh
#!/bin/bash
# On FreeBSD change the above line to #!/usr/local/bin/bash
#
# /usr/local/bin/dhcp-dyndns.sh
#
# This script is for secure DDNS updates on Samba,
# it can also add the 'macAddress' to the Computers object.
#
# Version: 0.9.6
#
@rsyuzyov
rsyuzyov / addc+dhcp+dns.md
Last active February 28, 2024 09:35
ad dc + dhcp + dynamic update dns

AD DC

#Поднятие дополнительного контроллера в существующем домене: 
apt install acl attr samba winbind libpam-winbind libnss-winbind krb5-config krb5-user dnsutils python3-setproctitle -y
rm /etc/samba/smb.conf
kinit domaindaminuser
samba-tool domain join domain.local DC

#Все пользователи:
wbinfo -u
@rsyuzyov
rsyuzyov / setupProxy.js
Last active February 11, 2024 17:35
setupProxy.js
const { createProxyMiddleware } = require('http-proxy-middleware')
module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://host:port',
pathRewrite: {
'^/api': '/ibname/hs/servicename'
},
changeOrigin: true,
@rsyuzyov
rsyuzyov / easy-wg-quick.sh
Created October 29, 2023 04:26
easy-wg-quick
#!/bin/sh
# easy-wg-quick - Creates WireGuard configuration for hub and peers with ease
# Copyright (C) 2019-2023 Krzysztof Burghardt <[email protected]>
#
#
# License
# -------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
@rsyuzyov
rsyuzyov / pgcompacttable
Last active September 10, 2024 15:43
pgcompacttable
apt install libdbi-perl libdbd-pg-perl -y
su postgres
psql: create extension pgstattuple;
wget https://raw.githubusercontent.com/dataegret/pgcompacttable/master/bin/pgcompacttable
chmod +x pgcompacttable
./pgcompacttable -h localhost -U postgres -W password -d database --verbose
+1Создать в ЦБ и начать регистрацию изменений
+Сделать тонкий клон
+Проверить план в реплике
+Остановить старый кластер
+systemctl disable postgrespro-1c-11.service
+Поставить пг15 (https://github.com/rsyuzyov/work-on-linux/blob/master/postgresql/postgresql.md)
wget https://repo.postgrespro.ru/1c-15/keys/pgpro-repo-add.sh
sh pgpro-repo-add.sh
@rsyuzyov
rsyuzyov / 1c-background-extproc.txt
Last active March 12, 2023 07:36
1С: фоновое выполнение методов внешней обработки
Фоновое выполнение методов внешней обработки:
https://wiki.programstore.ru/zapusk-fonovogo-zadaniya-vo-vneshnej-obrabotke-s-indikaciei/
Фоновое многопоточное выполнение методов внешней обработки:
https://infostart.ru/1c/articles/1812197/
@rsyuzyov
rsyuzyov / install-1c-on-linux
Last active March 2, 2024 15:05
install 1c on linux
Подключить contrib и backports
apt install ttf-mscorefonts-installer libenchant1c2a fontconfig
fc-cache -fv
tar -xvzf server64_8_3_22_1750.tar.gz
./setup-full-8.3.22.1750-x86_64.run
systemctl link /opt/1cv8/x86_64/8.3.22.1750/[email protected]
systemctl enable [email protected]
systemctl start [email protected]
@rsyuzyov
rsyuzyov / shadowsocks
Created November 5, 2022 13:10
shadowsocks
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee /etc/apt/sources.list.d/buster-backports.list
apt update
apt -t buster-backports install shadowsocks-libev
systemctl enable shadowsocks-libev
systemctl start shadowsocks-libev
nano /etc/shadowsocks-libev/config.json
{
"server":"externalip",
"server_port":18388,
@rsyuzyov
rsyuzyov / 3proxy
Created November 5, 2022 11:52
3proxy
wget --no-check-certificate https://raw.github.com/SnoyIatk/3proxy/master/3proxyinstall.sh
chmod +x 3proxyinstall.sh
./3proxyinstall.sh
nano /etc/3proxy/.proxyauth
user:CL:password