แสดงกระทู้

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 ... 6 7 [8] 9 10 ... 146
107
อัฟเดทเป็น firo-0.14.2.3 ทั้งบน window
https://firo.org/get-firo/download/
https://github.com/firoorg/firo/releases/download/v0.14.2.3/firo-0.14.2.3-win64-setup.exe


และทำการอัฟเกรดใน ubuntu box ของท่านด้วย
wget https://github.com/firoorg/firo/releases/download/v0.14.2.3/firo-0.14.2.3-linux64.tar.gz
./firod -daemon

==more information on
https://firo.org/guide/masternode-upgrade.html

108
ในกรณี ที่รัน update

===generate new "feeSourceAddress" by run below command on debug console in "Znode"
listaddressbalances 0.01

and get line3 value to input as "feeSourceAddress"
then running
=> protx update_service xxx again.

 8)

109
all application on unix knowledges by golfreeze / limit bandwidth in linux app
« on: ธันวาคม 22, 2020, 02:29:26 PM »
https://www.tecmint.com/wondershaper-limit-network-bandwidth-in-linux/

สามารถใช้งาน wondershaper command ได้ครับ

#apt install wondershaper  [On Debian/Ubuntu]
$ sudo yum install wondershaper  [On CentOS/RHEL]
$ sudo dnf install wondershaper  [On Fedora 22+]

wondershaper -a wlp1s0 -d 4048 -u 1048

110
=== compile nginx1.19.5 with Lua on Centos7.x 64bit
yum install nginx-1.19.5

เราสามารถทำการ install ผ่าน repo nginx ของ nginx ได้ครับผม จะทำให้ง่ายกว่า แล้วค่อยมารัน compile module lua เพิ่มได้ครับผม

wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz
wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.10.10.zip
wget http://nginx.org/download/nginx-1.19.5.tar.gz
wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.41/pcre-8.41.tar.gz
wget http://zlib.net/zlib-1.2.11.tar.gz

yum install gcc zlib-devel gcc-c++
yum install openssl-devel-1.0.2k openssl11-libs

cd /home/packetlove
tar zxvf v0.3.0.tar.gz
unzip -q v0.10.10.zip

tar zxf LuaJIT-2.0.5.tar.gz
cd LuaJIT-2.0.5
make && make install

tar zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install

tar zxf nginx-1.19.5.tar.gz
cd nginx-1.19.5
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0

tar zxf nginx-1.19.5.tar.gz
cd nginx-1.19.5
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0

==ทำการ reconfigure module nginx ที่สำคัญคือเพิ่ม module lua เข้าไปครับ
== --add-module=../ngx_devel_kit-0.3.0/ --add-module=../lua-nginx-module-0.10.10/
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'  --add-module=../ngx_devel_kit-0.3.0/ --add-module=../lua-nginx-module-0.10.10/
==make
make -j2 && make install
==link
ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2

systemctl restart nginx
netstat -ntlp
เรียบร้อยครับผม
nginx -V ก็จะมี lua-nginx-module ขึ้นมาด้วยครับผม : )

111
ในกรณีเราติดตั้ง 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)


112
เราสามารถทำการ 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

113
=== 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

114
=== 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 ตัวที่แก้ไข ก็จะเข้าได้

115
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 ดูนะครับผม : )

116
=== เจอปัญหา 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

117
=== 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 ทีครับ

118
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

119
ถ้ามีการอัฟเกรดระบบ และถ้ามีการเรียกอัฟเกรด 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

120
ทำการเพิ่ม
   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 รอบ

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