Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
== ถ้าต้องการ import public key แบบ custom path และระบุ passphrase เลย
gpg2 --import '/app/test/PKL.asc'
gpg2 --batch passparse=123xxPKL --symmetric filename
22
==expect command
/app/pklscript/sftp.sh
set DATE.[timestamp -format {%Y-%m-%d}]
$DATE
23
All about virtualization openstack + vmare esxi / reset user root on cli esx-i
« Last post by golfreeze 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 ด้วยนะครับ
 8)
24
command , shell script ,tool , crontab / memcache export and import with memcached-tools and nc
« Last post by golfreeze 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
25
ถ้าต้องการเพิ่ม 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
26
ถ้าต้องการสร้าง tmux แล้วตั้งเป็นชื่อ session นี้
tmux new -s pklsession
tmux a -t pklsession

ทำการ kill ทุก session ยกเว้นเหลือไว้แค่ pklsession
tmux kill-session -a -t pklsession
27
==== อีกตัวอย่าง จะทำการเปลี่ยน 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
28
===สคิป 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 {} \; \)
29
tmux ดู output เก่าที่รันไปแล้ว
ctrl+b+[
แล้วเลื่อนลูกศร ขึ้นไปเรื่อยๆ  8)
30
ถ้าไม่สามารถแจ้งเมลไปให้ยัง 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 ด้วยนะครับ ***  ;)
Pages: 1 2 [3] 4 5 ... 10