แสดงกระทู้

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 ... 7 8 [9] 10 11 ... 146
121
ในกรณีเราติดตั้ง apache 2.4 อยู่บน centos 7 หรือ 8
โดยปกติแล้วจะมีการใช้งาน selinux เป็น
SELINUX=enforcing
SELINUXTYPE=targeted
 
เราต้องทำการ enable homedir ด้วยนะครับ เพราะปกติค่าตัวนี้จะถูกตั้งเป็น false
เลยทำให้ apache homedir ที่ใช้เป็น /home/user/public_html เวลาเรียกแล้วจะขึ้นเป้น error 403
getsebool -a | grep http

===enable homedir public_html
/home/gotomoon/public_html
setsebool -P httpd_enable_homedirs true

ลองเข้าหน้าเว็บอีกทีก็จะเรียกได้ปกติครับ  8)


122
เราสามารถทำการ debug nagios nrpe ได้ครับ

#strace -f -s 128 -e execve -p `pgrep -ox nrpe`
แล้วเปิดอีก terminal ทำการรัน

/usr/local/nagios/libexec/check_nrpe -H0 -c check_pose_score

ก็จะสามารถดู debug ได้ครับผม

strace: Process 23817 attached
[pid xxxx] execve("/usr/local/nagios/libexec/check_post_score.sh", ["/usr/local/nagios/libexec/check_post_score.sh"], 0x5564695cfb70 /* 9 vars */) = -1 ENOENT (No such file or directory)

ก็แสดงว่าไม่มีสิทธิ์ในการเข้าถึง folder เลยไม่เจอ path หรือ file ดังกล่างในสคิป check_pose_score.sh

123
=== download new version from
https://gitmemory.com/reubenyap
https://github.com/zcoinofficial/zcoin/releases/download/v0.14.0.5/zcoin-0.14.0.5-win64-setup.exe

=== Upgrade from zcoin-0.14.0.1-win64.exe to zcoin-0.14.0.5-win64.exe

Added “znodeblsprivkey” into file
===zcoin.conf in window locate on
C:\Users\Administrator\AppData\Roaming\zcoin\zcoin.conf

====  block you are stuck on. Memorize this number
https://zcoinkb.wordpress.com/2017/12/22/zcoin-wallet-shows-no-block-source-available-or-stuck-on-block/


Open your wallet and see which block you are stuck on. Memorize this number
Go to Help > Debug Window. In there, go to Console .
Subtract about 1,000 blocks from the block number you memorized
Now type getblockhash block# where block# is the block number from step 1 minus 1,000. Example: You’re stuck on block 62393, subtract 1,000 and a little more, type getblockhash 61000
Copy the resulting block hash
We are now invalidating this hash by typing invalidateblock copiedhash where copiedhash is – you guessed it – the copied hash from step 5
Great. Now you confused your poor wallet. Give it a nudge and ask it to reconsider the block by typing reconsiderblock copiedhash
Now your wallet will start syncing from this block onwards and once it’s done, you should be all set!

===then open zcoin-qt.exe program again
And see stuck on block:296903
Minus 1000 -> 295903
And choose 295900

===access “Help” -> “Debug” ->  to “console" in window
getblockhash 295900
a20bf26a75c90920a79595fb7aa50acc9954dsssxxxxxxxxxxxxxx

invalidateblock a20bf26a75c90920a79595fb7aa50acc9954dsssxxxxxxxxxxxxxx
null

reconsiderblock a20bf26a75c90920a79595fb7aa50acc9954dsssxxxxxxxxxxxxxx
null

==then zcoin console will re-sync again and pass that block

124
=== change selinux=targeted to  selinux=disabled
Then reboot found “Failed to load SELinux policy, freezing.
Random: cringe init done

ต้องบูตเข้า linux rescue
แล้วทำการ edit boot loader แก้ไข บันทัดที่มี linux16
ให้เพิ่ม selinux=0 ก่อนหน้า ro
แล้วทำการ ctrl+x เพื่อ boot ตัวที่แก้ไข ก็จะเข้าได้

125
Nodejs Nginx error: (13: Permission denied) while connecting to upstream
ถ้าเจอเรื่อง permission denied ของ nginx
ถึงแม้จะแก้ไขเรื่อง chmod , chown เรียบร้อยแล้ว ก็ยังเป็นอยู่
ให้ลองเชค selinux อีกทีนะครับ ว่ามีใช้งาน mode ไหน
หรือจะเปิดให้ httpd เข้าใช้งาน network ได้
setsebool -P httpd_can_network_connect 1

หรือบางทีเป็นที่ codeignetor ไม่สามารถเขียน sessions ลงใน folder system/cache/sessions ได้
ให้ลองเชคที่ selinux ดูนะครับผม : )

126
=== เจอปัญหา Posed_BANNED บน zcoin wallet (window)
เนื่องจากว่า upgrade Zcoin wallet แต่ลืมทำการ upgrade binary บน VPS server
ซึ่งทำให้โดน banned ไปเลย และหนักกว่านั้น ใน version 0.14.0.1 เป็นต้นมา ต้องใส่ค่า znodeblsprivkey ลงไปใน zcoin.conf ด้วย
แต่ว่าดันไม่ได้เซฟไว้ ค่า OperatorKey ไว้ งานเข้าเลย และ VPS server ยังคงเป็น binary version 0.13.0
ซึ่งสามารถที่จะ protx register ได้ แต่ใช้ไปสักพัก ก็จะให้โดน posed_banned ครับ

เพราะถ้าเจอปัญหา POSED_BANNED ถ้าเรามีค่า OperatorKey (znodeblsprivkey)  ก็สามารถรัน
protx update_service proTxHash ipAndPort operatorKey (operatorPayoutAddress feeSourceAddress)
ได้เลยแล้วรอ confirm address ขึ้นแค่ 1 ก็จะทำให้ ค่าที่เป็น posed_banned หายไป แล้วค่อยมานับเริ่มใหม่ เพื่อรอรับ zcoin reward

ดังนั้นเราต้องทำการรัน "bls generate" บน wallet console ใหม่ แล้วทำการ update_registrar ใหม่อีกที ซึ่งมี syntax ดังนี้ (operatorPubKey)=> ใช้ตัวใหม่ที่เจน bls generate ได้แล้วทำการเซฟไว้ด้วยนะครัห้ามลืม หลังจากนั้นทำการเพิ่ม configure "znodeblsprivkey" ใน zcoin.conf ด้วยแล้ว start process ใหม่
หลังจากนั้นทำการ update_registrar ตามด้านล่าง
#protx update_registrar protxhash operatorPubKey "" payoutAddress feeSourceAddress

หลังจากรัน update_registrar แล้วทำการรอ confirmed
หลังจากนั้นก็ให้รัน update_service อีกรอบ โดยใส่ ค่า operatorKey ชุดใหม่
protx update_service proTxHash ipAndPort operatorKey (operatorPayoutAddress feeSourceAddress)

เท่านี้ Znode เราก็จะกลับมา mined mint ต่อได้แล้วครับผม   8)

===Special Thank : Zcoin Support in Discord.
johnsmith [will not PM you]
CardcaptorZakura#9636

===site reference
https://github.com/zcoinofficial/zcoin/wiki/Deterministic-Znodes-Operator-Guide
https://github.com/zcoinofficial/zcoin/wiki/Migrating-your-Legacy-Znodes-to-the-new-Deterministic-Znodes-system

127
=== Rootclause  :  PostgreSQL v10 and v11
 ===check replicate log make disk full
 postgres=> select slot_name, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(),restart_lsn)) as replicationSlotLag, active from pg_replication_slots;

            slot_name             | replicationslotlag | active
----------------------------------+--------------------+--------
 re_sub                | 64 MB              | t
 replication_slot1  | 904 GB             | f
 replication_slot2  | 904 GB             | f

(3 rows)

เราสามารถทำการ drop slot ที่กินพื้นที่ได้ ดังนี้
postgres=# SELECT pg_drop_replication_slot('replication_slot1');
postgres=# SELECT pg_drop_replication_slot('replication_slot2');

แล้วทำการปรับ purge delete log จาก default 3 วัน (4320minute) เป็น 1 วัน (1440minute)ได้ครับ
rds.log_retention_period = 1440
แล้วทำการ  restart service 1 ทีครับ

128
custom memory_limit for user da

cd /usr/local/directadmin/data/users/php
vi php-fpm74.conf

edit
memory_limit=256MB

==restart service 1 times
/usr/local/etc/rc.d/php-fpm74 restart

129
ถ้ามีการอัฟเกรดระบบ และถ้ามีการเรียกอัฟเกรด xz ไปด้วย จะทำให้ตอน boot os เจอ error ประมาณนี้ครับ
xz /usr/local/lib/liblzma.so.5 version XZ 5.2.2 not found (required by xz)
/lib64/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib/librpmio.so.5)

ทำการแก้ไขโดยใช้ ISO ของ CentOS7.x image โหลดเข้า "linux rescue" mode
ทำการเข้าไปในโหมด Option 1 (Continue) to get to the shell.

mount --bind /proc /mnt/sysimage/proc
mount --bind /dev /mnt/sysimage/dev
mount --bind /sys /mnt/sysimage/sys
chroot /mnt/sysimage
cd /usr/local/lib
unlink liblzma.so.5
ln -s /usr/lib64/liblzma.so.5  /usr/local/lib/liblzma.so.5

dracut -f
exit
cd /
sync
telinit 6

130
ทำการเพิ่ม
   location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

ลงไปในแถบ server ใน nginx.conf ดังข้างล่างครับ

vi /etc/nginx/nginx.conf

server {
    server_name www.packetlove.com packetlove.com; # managed by Certbot
        index index.php index.html index.htm;
        root         /var/www/it-money.com/public_html;
        include snippets/phpMyAdmin.conf;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        if ( !-e $request_filename ){
                rewrite ^/(.*)$ /index.php?/$1 last;
                break;
        }

        location / {
                try_files $uri $uri/ /index.html;
        }

         location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
....

หลังจากนั้นทำการ restart nginx 1 รอบ

131
command , shell script ,tool , crontab / added routing in centos 8.x
« on: กรกฎาคม 22, 2020, 08:14:15 pm »
ถ้าต้องการทำ static route ใน centos 8.x เช่น
192.168.0.0/16 ให้วิ่งออก 192.168.1.254 สามารถทำได้ดังนี้
172.30.0.0/16 ให้วิ่งออก 192.168.1.254 สามารถทำได้ดังนี้

vi /etc/sysconfig/network-scripts/route-ens160
192.168.0.0/16 via 192.168.1.254
172.30.0.0/16 via 192.168.1.254


132
=== check status logstash
curl -XGET '10.2.8.123:9600/_node/stats/jvm?pretty'

=== test send curl post to logstash
curl -X GET "localhost:9600/?v"
curl -X GET "10.2.8.123:9600/?v"

=== test send stat to logstash server port 9600
curl -XGET '10.2.8.123:9600/_node/stats/events?pretty'

133
ทำการอัฟเกรด จาก zcoin 0.13 -> 0.14


1.ทำการ download ตาม os ที่ใช้งาน
https://github.com/zcoinofficial/zcoin/releases/tag/v0.14.0.1

2.แล้วทำการ backup wallet ก่อนจาก console version 0.13
File -> Backup Wallet

3. ปิดโปรแกรม zcoin console version 0.13

4. ทำการติดตั้ง zcoin console version 0.14

5. ทำการเปิดโปรแกรม zcoin version 0.14

6. ทำการ configure ตามลิ้ง
https://github.com/zcoinofficial/zcoin/wiki/Migrating-your-Legacy-Znodes-to-the-new-Deterministic-Znodes-system

Preparing for migration
Legacy Znodes can be registered as Deterministic Znodes with this command:

protx register collateralHash collateralIndex ipAndPort ownerAddress operatorPubKey votingAddress operatorReward payoutAddress feeSourceAddress

An example of how this would look like is as follows:

protx register 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0 207.148.122.12:8168 TRVDAxJwaZYFfmti4aTeKCByz1jbMq8Jy4 995b3e1e2a65ce960a8cc7d305c5914b7f60e888c338c1f3317efbdcac58e82ecc110315ce03f49d9d387ff35c2796ad "" 0 TEZ8M8Fgp8h4HvUjXtjz3krYraRtySiXdw

This looks extremely complicated but don't worry! The guide will explain each field below.

135
all application on unix knowledges by golfreeze / rufus burn iso to boot disk usb on window 10
« on: มิถุนายน 23, 2020, 01:26:58 pm »
rufus burn iso to boot disk usb on window 10
https://github.com/pbatard/rufus/releases/download/v3.11/rufus-3.11.exe

หรือเข้าไป download จาก https://rufus.ie

Pages: 1 ... 7 8 [9] 10 11 ... 146