Search found 167 matches

by brid.surapol
31 Mar 2026, 17:10
Forum: การใช้งาน Linux
Topic: Loop Command ด้วย seq
Replies: 0
Views: 1716

Loop Command ด้วย seq

Code: Select all

 seq 100000 | xargs -I{} -- sh -c 'command1; command2; command3; . . .'

Example:

Code: Select all

seq 100000 | xargs -I{} -- sh -c 'echo "Loop {}"; ab -n 100000 -c 1000 http://172.16.22.110/'
by brid.surapol
27 Feb 2026, 09:32
Forum: การใช้งาน Linux
Topic: การติดตั้ง fail2ban
Replies: 1
Views: 9114

Re: การติดตั้ง fail2ban

/etc/ssh/sshd_conf

Code: Select all

PermitRootLogin no
MaxAuthTries 4
restart sshd

Code: Select all

sudo service ssh restart
by brid.surapol
27 Feb 2026, 09:23
Forum: การใช้งาน Linux
Topic: การติดตั้ง fail2ban
Replies: 1
Views: 9114

การติดตั้ง fail2ban

วิธีดู attempt attack หรือ login เข้า sshd

tail -f /var/log/auth.log | grep 'sshd'



sudo apt install fail2ban


ใน /etc/fail2ban
แก้ไขfile jail.conf

bantime = 10m
เป็น
bantime = 2h

findtime = 60m
เป็น
findtime = 30m

maxretry = 5
เป็น
maxretry = 3

port = ssh
เป็น
port = 0:65535


เพิ่ม ...
by brid.surapol
12 Nov 2025, 15:18
Forum: การใช้งาน Linux
Topic: วิธีการเพิ่ม DNS Server อย่างถาวร
Replies: 1
Views: 20770

Re: วิธีการเพิ่ม DNS Server อย่างถาวร

หากใช้ systemd-resolved เช่นใน wsl

Code: Select all

sudo vim /etc/systemd/resolved.conf

Code: Select all

[Resolve]
DNS=8.8.8.8 8.8.4.4
Domains=example.com local.domain
by brid.surapol
12 Jul 2025, 16:52
Forum: การใช้งาน Linux
Topic: Manage routing of multiple gateways and interfaces from a single VM
Replies: 0
Views: 8692

Manage routing of multiple gateways and interfaces from a single VM

https://synaptica.info/en/2021/06/16/ubuntu-20-04-gestire-instradamento-di-piu-gateway-e-interfacce-da-una-singola-vm/


sudo apt install iproute2



sudo vim /etc/iproute2/rt_tables


ใส่ 2 บรรทัดสุดท้าย

800 800
801 801


name: eno1
ip address: 192.168.100.214
network: 192.168.100.0/22 ...
by brid.surapol
23 Feb 2025, 10:34
Forum: การใช้งาน Linux
Topic: วิธี rsync เพื่อทำ backup ข้าม network
Replies: 0
Views: 3901

วิธี rsync เพื่อทำ backup ข้าม network

Code: Select all

rsync -arvz --delete -e 'ssh -p #PORT' #source #user@#destination_ip:#destination_parent
ตัวอย่าง

Code: Select all

rsync -arvz --delete -e 'ssh -p 58038' bpc2 p1admin@192.168.3.5:/home/p1admin/cloud_services/ns_files/nsm_attachedfiles/
ไม่ต้องใช้ argument 'v' หาก run ผ่าน bash script
by brid.surapol
20 Feb 2025, 18:33
Forum: การใช้งาน PostgreSQL
Topic: วิธีการ Reload Configurations โดยไม่ต้อง restart pgsql
Replies: 0
Views: 35216

วิธีการ Reload Configurations โดยไม่ต้อง restart pgsql

วิธีที่ 1

Code: Select all

select pg_reload_conf();
วิธีที่ 2

Code: Select all

pg_ctl -D $PGDATA reload
by brid.surapol
20 Feb 2025, 18:29
Forum: การใช้งาน PostgreSQL
Topic: วิธีกำหนด temp_tablespaces เพื่อเพิ่ม performance กับ ssd
Replies: 0
Views: 2490

วิธีกำหนด temp_tablespaces เพื่อเพิ่ม performance กับ ssd

Code: Select all

create tablespace temp_ssd_tablespace location '/path/to/ssd/directory';

Code: Select all

alter system set temp_tablspaces = 'temp_ssd_tablespace';
enable config change

Code: Select all

select pg_reload_conf();
by brid.surapol
18 Feb 2025, 19:15
Forum: การใช้งาน Linux
Topic: วิธีการเพิ่ม DNS Server อย่างถาวร
Replies: 1
Views: 20770

วิธีการเพิ่ม DNS Server อย่างถาวร

เพิ่ม
8.8.8.8

ลงใน

Code: Select all

sudo vim /etc/resolvconf/resolv.conf.d/tail

Go to advanced search