แสดงกระทู้

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

Pages: 1 2 [3] 4 5 ... 146
31
tmux ดู output เก่าที่รันไปแล้ว
ctrl+b+[
แล้วเลื่อนลูกศร ขึ้นไปเรื่อยๆ  8)

32
ถ้าไม่สามารถแจ้งเมลไปให้ยัง 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 ด้วยนะครับ ***  ;)

33
ในกรณีถ้ามีการปรับขยาย 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

34
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« 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'

 :-[

35
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« 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 {}

36
command , shell script ,tool , crontab / Re: grep , egrep , fgrep howto
« on: กันยายน 04, 2022, 06:59:26 PM »
===fgrep = fix grep use with need finding word contain $ {} ? + . | ( )
fgrep "day$" test.txt

37
command , shell script ,tool , crontab / Re: grep , egrep howto
« on: กันยายน 04, 2022, 06:21:05 PM »
##grep without word "tomorrow" on file test.txt
grep -v "tomorrow" test.txt

38
command , shell script ,tool , crontab / Re: grep , egrep howto
« 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

39
command , shell script ,tool , crontab / grep , egrep , fgrep howto
« on: กันยายน 04, 2022, 06:16:03 PM »
==show line number if found exact word "day" not "today" in file test.txt
grep -n -w "day" test.txt

40
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« on: กันยายน 04, 2022, 11:57:30 AM »
==show verbose "-t" and -n "max-args, --max-args=max-args per command line" and show echo filename
ls | cut -d. -f1 | xargs -t -n 1

41
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« on: กันยายน 04, 2022, 11:50:40 AM »
=== echo all name in "/home" and show as /home/test/{}
cd /home/
ls | xargs -I {} echo "/home/test/{}"

42
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« on: กันยายน 04, 2022, 11:47:56 AM »
=== grep only name of /etc/password and show in 1 line
cut -d: -f1 < /etc/passwd | sort | xargs

43
command , shell script ,tool , crontab / Re: basic command for xargs by golfreeze
« on: กันยายน 04, 2022, 10:34:02 AM »
=== delete all *.txt command with xargs faster than "-exec rm {} \;"  ;)
find . -type f -name "*.txt" | xargs rm

=="-exec rm" more slowly than "xargs rm"  :-X
find . -type f -name "*.txt" -exec rm {} \;

44
command , shell script ,tool , crontab / Re: basic command for xargs
« on: กันยายน 04, 2022, 10:30:43 AM »
== create 10 files with extension .txt with xargs
seq 10 | xargs -I {} touch {}.txt

45
command , shell script ,tool , crontab / Re: basic of awk by golfreeze
« on: กันยายน 04, 2022, 10:25:30 AM »
=== text3 ====
store                manager       total_sales
Woodridge,Australia  Jon Stephens     33726.77
Lethbridge,Canada    Mike Hillyer     33679.79
Bridge,Canada   Mike Hillyer          43679.89
Sisaket,Thailand        thong       562.22
Pathumthani,Thailand    White           992.42
Saimai,Bangkok          Packetlove      8229.4

=== text4 ===
store:manager:total_sales
Woodridge,Australia:Stephens:33726.77
Lethbridge,Canada:Hillyer:33679.79
Bridge,Canada:Mike:43679.89
Sisaket,Thailand:thong:562.22
Pathumthani,Thailand:White:992.42
Saimai,Bangkok:Packetlove:8229.4

Pages: 1 2 [3] 4 5 ... 146