|
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - golfreeze
16
« on: กุมภาพันธ์ 20, 2023, 07:10:54 PM »
==expect command /app/pklscript/sftp.sh set DATE.[timestamp -format {%Y-%m-%d}] $DATE
17
« on: กุมภาพันธ์ 12, 2023, 03:03:03 PM »
**** ถ้าเจอกรณี login เข้า root ผ่านหน้า ui ไม่ได้ แสดงว่าอาจจะ โดน brute force จากหน้า ui ต้องเข้าผ่าน account admin อีกตัว แล้วเข้าไปเปิด ssh แล้วทำการ un-locked user “root” *** ผ่าน command : pam_tally2 --user root --reset แล้วทำการ login ผ่านหน้าเวบ ui อีกที ถ้า login ได้ก็ปิด ssh service ด้วยนะครับ
18
« on: กุมภาพันธ์ 07, 2023, 12:42:48 PM »
=== export memcache data from old-web /usr/share/memcached/scripts/memcached-tool 127.0.0.1:11211 dump > memcache7feb.dumpall
### import memcache data into new-memcache node # nc 127.0.0.1 11211 < oldweb_memcached7feb.dumpall
19
« on: มกราคม 28, 2023, 11:56:11 AM »
ถ้าต้องการเพิ่ม php-fpm pool เพื่อใช้งานใน nginx เพิ่มเติม เพื่อรองรับ web connection เพิ่มเติม สามารถทำได้ดังนี้
PKLLAB.com have php-fpm5.6 running 4 pool If need to add pool add configure on #cp /etc/php/5.6/fpm/pool.d/www4.conf /etc/php/5.6/fpm/pool.d/www5.conf And change configure pool-name on www5.conf From www4->www5
And add configure on /etc/nginx/sites-available/pkllab.com upstream php56_pkllab { server "unix:/run/php/php5.6-fpm-www1.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www2.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www3.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www4.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www5.sock" max_fails=0;
Then restart 2 service /etc/init.d/php5.6-fpm restart Systemctl restart nginx
20
« on: มกราคม 26, 2023, 07:51:46 PM »
ถ้าต้องการสร้าง tmux แล้วตั้งเป็นชื่อ session นี้ tmux new -s pklsession tmux a -t pklsession
ทำการ kill ทุก session ยกเว้นเหลือไว้แค่ pklsession tmux kill-session -a -t pklsession
21
« on: ธันวาคม 29, 2022, 07:43:00 AM »
==== อีกตัวอย่าง จะทำการเปลี่ยน folder หลักและ sub-folder ภายใน folder หลักด้วย ===== find /home/test/public_html/wp-admin -type d -exec chmod 755 {} \; หรือจะ cd /home/test/public_html/wp-admin find . -type d -exec chmod 755 {} \;
To change all the files to 644 (-rw-r--r--): find /opt/lampp/htdocs -type f -exec chmod 644 {} \;
Some splainin': (thanks @tobbez)
chmod 755 {} specifies the command that will be executed by find for each directory chmod 644 {} specifies the command that will be executed by find for each file {} is replaced by the path ; the semicolon tells find that this is the end of the command it's supposed to execute \; the semicolon is escaped, otherwise it would be interpreted by the shell instead of find
22
« on: ธันวาคม 29, 2022, 07:31:30 AM »
===สคิป find folder then chmod folder 755 and file 644 in wordpress find /home/wordpress/htdocs \ \( -type f -exec chmod ug+rw,o+r {} \; \) , \ \( -type d -exec chmod ug+rwxs,o+rx {} \; \)
23
« on: ธันวาคม 04, 2022, 04:06:12 PM »
tmux ดู output เก่าที่รันไปแล้ว ctrl+b+[ แล้วเลื่อนลูกศร ขึ้นไปเรื่อยๆ
24
« on: ธันวาคม 04, 2022, 09:36:03 AM »
ถ้าไม่สามารถแจ้งเมลไปให้ยัง gmail.com ได้ และต้องการแอด IP เพื่อเป็น whitelist ในระบบของ Gmail.com สามารถทำได้ดังนี้ 1.Log in to https://admin.google.com and click Apps. 2.Click Google Workspace. 3.Click Gmail. 4.Click Spam, Phishing and Malware. ... 5.Under the Organizational Unit section, highlight your domain. ... 6.In the Email whitelist section, enter our IP addresses separated by commas. ... 7.Click Save. ก็จะสามารถทำให้ ส่งอีเมลจาก ip ที่เราแจ้งไว้ได้ *** แต่ต้องตรวจสอบให้ดีว่า ip เราจะไม่ส่งพวกสแปมอีเมลมาหา gmail.com ด้วยนะครับ ***
25
« on: ธันวาคม 03, 2022, 02:29:13 PM »
ในกรณีถ้ามีการปรับขยาย disk size ของก้อนที่ใช้งานอยู่เดิมอยู่แล้ว บนระบบ ESX-i หรือ Proxmox อาจจะทำให้ MBR (Master boot record) size เพี้ยนไปตอนที่รันเชคด้วย command #fdisk -l (แอลเล็ก , small L)
GPT PMBR size mismatch (209715199 != 262143999) will be corrected by w(rite)
สามารถแก้ไขปัญหาด้วย command parted -l (แอลเล็ก , small L) # parted -l Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 52428800 blocks) or continue with the current setting? Fix/Ignore? Fix Model: QEMU QEMU HARDDISK (scsi) Disk /dev/sda: 134GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub 2 2097kB 106GB 106GB 3 106GB 107GB 1074MB xfs
Model: QEMU QEMU HARDDISK (scsi) Disk /dev/sdb: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 1049kB 4800MB 4799MB xfs primary
Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/ubuntu--vg-lv--0: 106GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags:
Number Start End Size File system Flags 1 0.00B 106GB 106GB xfs
เท่านี้ก็เป็นอันที่เรียบร้อย แล้ว หลังจากนั้นให้ทำการ reboot os 1 รอบแล้วทำการ fdisk ตาม process ได้เลย fdisk /dev/sda n p 4
=change type to LVM as 8e and write save config t 8e w
==create pv pvcreate /dev/sda4 y vgextend ubuntu-vg /dev/sda4 lvextend -L +25G /dev/mapper/ubuntu--vg-ubuntu--lv xfs_growfs /dev/mapper/ubuntu--vg-ubuntu--lv
26
« on: กันยายน 10, 2022, 08:58:20 PM »
=== ถ้าเรา grep output ชื่อสักอย่าง ได้ออกมาเป็น column ที่9 แล้วจะทำให้ ข้อมูลที่เรียงเป็น column นั้นออกมาเป็นแถวเดียวต่อกัน และเว้นช่องว่างด้วย ,_ สามารถทำได้ดังนี้คือ ls -lah | awk '{print $9}' | grep [a-z] | xargs -t | sed 's/ /, /g'
27
« on: กันยายน 10, 2022, 08:39:24 PM »
==มีโจทย์ว่าต้องการเปลี่ยน chown ของ folder โดยเพิ่มชื่อโดเมนเข้าไปด้วย แล้วให้เปลี่ยนทุกไฟล์ใน folder นั้นๆ ls -lah | awk '{print $10}' | grep vditest01 | xargs -I {} chown -R {}@dpa.or.th:domain\ users@dpa.or.th {}
28
« on: กันยายน 04, 2022, 06:59:26 PM »
===fgrep = fix grep use with need finding word contain $ {} ? + . | ( ) fgrep "day$" test.txt
29
« on: กันยายน 04, 2022, 06:21:05 PM »
##grep without word "tomorrow" on file test.txt grep -v "tomorrow" test.txt
30
« on: กันยายน 04, 2022, 06:17:29 PM »
==found word="today" or "future" in file test.txt then show number also grep -nw -i -e "today" -e "future" test.txt
|
|
|