Ubuntu: различия между версиями
Перейти к навигации
Перейти к поиску
FireWolf (обсуждение | вклад) |
FireWolf (обсуждение | вклад) |
||
| (не показаны 3 промежуточные версии этого же участника) | |||
| Строка 8: | Строка 8: | ||
nameserver 192.168.0.1 | nameserver 192.168.0.1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Limit network speed == | |||
Limit: | |||
sudo tc qdisk add dev eth0 root tbf rate 1mbit burst 10kb latency 70ms | |||
Check: | |||
sudo tc -s -d qdisc show dev eth0 | |||
Disable: | |||
sudo tc qdisc del dev eth0 root | |||
== Отключение защит от SPECTRE MELTDOWN и т.д. == | == Отключение защит от SPECTRE MELTDOWN и т.д. == | ||
| Строка 20: | Строка 30: | ||
и выполнить <code>sudo update-grub</code> | и выполнить <code>sudo update-grub</code> | ||
== EASY RSA (from FreeBSD) == | |||
Создание сертификата: | |||
<syntaxhighlight> | |||
. ./vars | |||
./build-req iphone | |||
./sign-req iphone | |||
</syntaxhighlight> | |||
== openvpn ccd routes == | |||
python scrypt converting from 127.0.0.1/32 to 127.0.0.1 255.255.255.255: | |||
<syntaxhighlight> | |||
#!/usr/bin/env python3 | |||
import sys | |||
import ipaddress | |||
import re | |||
for line in sys.stdin: | |||
match = re.search(r'(\d+\.\d+\.\d+\.\d+)/(\d+)', line) | |||
if match: | |||
ip = match.group(1) | |||
cidr = int(match.group(2)) | |||
net = ipaddress.ip_network(f"{ip}/{cidr}", strict=False) | |||
mask = str(net.netmask) | |||
line = re.sub(r'/\d+', f' {mask}', line) | |||
sys.stdout.write(line) | |||
</syntaxhighlight> | |||
Скрипт конвертирования: | |||
<syntaxhighlight> | |||
cat goog.json | jq '.prefixes[] | .ipv4Prefix' | grep -v null | awk -F '"' '{ print "push \"route " $2 "\"" }' > ipv4_pre | |||
cat ipv4_pre | python3 converter.py > ipv4 | |||
cat goog.json | jq '.prefixes[] | .ipv6Prefix' | grep -v null | awk -F '"' '{ print "push \"route " $2 "\"" }' > ipv6 | |||
</syntaxhighlight> | |||
синтакс json: | |||
<syntaxhighlight> | |||
{ | |||
"syncToken": "1760234683896", | |||
"creationTime": "2025-10-11T19:04:43.896706", | |||
"prefixes": [{ | |||
"ipv4Prefix": "8.8.4.0/24" | |||
}, { | |||
"ipv4Prefix": "8.8.8.0/24" | |||
}, { | |||
"ipv6Prefix": "2606:40::/32" | |||
}] | |||
} | |||
</syntaxhighlight> | |||
goog subnets: https://www.gstatic.com/ipranges/goog.json | |||
https://gist.github.com/iamwildtuna/7772b7c84a11bf6e1385f23096a73a15 | |||
Текущая версия на 06:41, 13 октября 2025
Тормозит Youtube
Изменить настройки resolv.conf
domain wolf-a.ru
search wolf-a.ru
nameserver 8.8.8.8
nameserver 192.168.0.1Limit network speed
Limit: sudo tc qdisk add dev eth0 root tbf rate 1mbit burst 10kb latency 70ms
Check: sudo tc -s -d qdisc show dev eth0
Disable: sudo tc qdisc del dev eth0 root
Отключение защит от SPECTRE MELTDOWN и т.д.
https://linuxmint.com.ru/viewtopic.php?p=74099&sid=0430a33528a3f952dad4f1fc64433a15#p74099
В /etc/default/grub прописать:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nopti nospectre_v1 nospectre_v2 nospec_store_bypass_disable noibrs noibpb l1tf=off no_stf_barrier"и выполнить sudo update-grub
EASY RSA (from FreeBSD)
Создание сертификата:
. ./vars
./build-req iphone
./sign-req iphoneopenvpn ccd routes
python scrypt converting from 127.0.0.1/32 to 127.0.0.1 255.255.255.255:
#!/usr/bin/env python3
import sys
import ipaddress
import re
for line in sys.stdin:
match = re.search(r'(\d+\.\d+\.\d+\.\d+)/(\d+)', line)
if match:
ip = match.group(1)
cidr = int(match.group(2))
net = ipaddress.ip_network(f"{ip}/{cidr}", strict=False)
mask = str(net.netmask)
line = re.sub(r'/\d+', f' {mask}', line)
sys.stdout.write(line)Скрипт конвертирования:
cat goog.json | jq '.prefixes[] | .ipv4Prefix' | grep -v null | awk -F '"' '{ print "push \"route " $2 "\"" }' > ipv4_pre
cat ipv4_pre | python3 converter.py > ipv4
cat goog.json | jq '.prefixes[] | .ipv6Prefix' | grep -v null | awk -F '"' '{ print "push \"route " $2 "\"" }' > ipv6синтакс json:
{
"syncToken": "1760234683896",
"creationTime": "2025-10-11T19:04:43.896706",
"prefixes": [{
"ipv4Prefix": "8.8.4.0/24"
}, {
"ipv4Prefix": "8.8.8.0/24"
}, {
"ipv6Prefix": "2606:40::/32"
}]
}goog subnets: https://www.gstatic.com/ipranges/goog.json https://gist.github.com/iamwildtuna/7772b7c84a11bf6e1385f23096a73a15