แสดงกระทู้

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.


Topics - golfreeze

Pages: 1 ... 5 6 [7] 8 9 ... 73
91
รวม bootable iso ผ่าน flash drive support mac , window , linux os
https://unetbootin.github.io/

92
I need IMAP compiled into php   Last Modified: Mar 28, 2019, 11:58 am
If you need imap compiled into php, run these pre-install commands:
CentOS
yum -y install pam-devel

Debian
apt-get install libc-client-dev



Once pre-install is done for your OS, run the following:
cd /root
wget -O imap_php.sh files.directadmin.com/services/all/imap_php.sh
chmod 755 imap_php.sh
./imap_php.sh

supports both CustomBuild 1.x and 2.x.
For CB2, it will automatically detect the configure.phpX path.

Note that this is beyond our technical support.
Check IMAP in PHP status
Note that version 1.2 of this script now supports the ability to call it like this:
./imap_php.sh --check

===reference
https://help.directadmin.com/item.php?id=341

93

อัฟแรมเครื่องเซิฟเวอร์แล้วเจอปัญหา บน ESX-i 6.x
error loading s.v00 fatal error:8 (Device error) on esx-i 6.x

เท่าที่ลองเชคดูเป็นปัญหาของ md5sum ที่เชคไฟล์ s.v00 เป็น module หนึ่งที่ต้องทำการเชคในช่วงบูต ESX-i ครับ
วิธีการแก้ไขปัญหานั้น ไม่ยากเท่าไรครับ แต่ว่าต้องใช้งาน flash drive สองตัว

=== อุปกรณ์ที่ต้องเตรียม และ
1. ทำการ boot slax linux ที่เป็นตัว liveCD เพื่อเข้าไปใช้งาน environment เสมือน livecd ผมใช้งานเป็น slax-32bit ครับ
http://ftp.sh.cvut.cz/slax/Slax-9.x/slax-32bit-9.11.0.iso
โหลดมาแล้ว build bootable ผ่านตัว unetbootin for mac ครับ 
2. flash drive อีกไฟล์คือหาไฟล์ s.v00 มาจากตัว iso image ของตัว esx-i ครับแล้ว copy มาเตรียมรอไว้
3. Harddisk ของตัวที่มีไฟล์ s.v00 ที่มีการ corrupted นี้

เริ่มแรกทำการบูตข้ึนมาด้วย slax ก่อนครับเลือกบูตจาก USB drive ใน bios
หลังจากเข้ามาใน slax livecd ทำการเปิด terminal ขึ้นมาเพื่อเชค device name ของตัว hdd และ flashdrive ที่เตรียมไว้
dmesg | less

===hdd ที่เป็น esx-i ผมถูกระบบให้ใช้งานเป็น sda ครับ
128GB=> /dev/sda (esx-i) boot
/dev/sda5 => 250MB

slax=/dev/sde1 bootable flashdrive
sandisk=/dev/sdf2 มีไฟล์ s.v00 ตัวใหม่

=== ทำการ mount ทุกตัวขึ้นมา
mount /dev/sdf2 /mnt/sdf2
mount /dev/sda5 /mnt/sda5
ทำการ copy s.v00 ตัวเก่าไว้ก่อนนะครับ
cp /mnt/sda5/s.v00 /mnt/sdf2/s.v00_corrupt

หลังจากนั้นเอาไฟล์ s.v00 ที่แตกมาจาก iso ของ esx-i 6.x ที่โหลดจาก vmware แล้ว copy ไปใสที่ /dev/sda5
md5sum /mnt/sdf2/s.v00
cp /mnt/sdf2/s.v00  /mnt/sda5/.

เสร็จแล้วทำการ check sum ไฟล์ที่ copy ไปที่ sda5 อีกทีเพื่อดูว่าเป็นค่าเดียวกันหรือเปล่า
umount /mnt/sda5
ทำการ reboot แล้วให้ไป boot ที่ hdd ของ esx-i บนเซิฟเวอร์แล้วลองเข้าใช้งานดูครับ

: )
suuport [at] packetlove [dot] com

94
การย้าย vm hdd ไปยัง datastore ใหม่
เคสนี้เอาไว้ใช้แก้ไขปัญหา ในกรณีพื้นที่ของ hdd ใน datastore ที่ใช้งานอยู่เกือบเต็ม (เลยทำให้ไม่สามารถเพิ่ม RAM ใน esx-i ได้ครับ)
เราสามารถทำการ shutdown vm นั้นก่อนแล้ว ทำการ move ใน datastore
โดยทำการเลือก hdd ต้นทาง แล้วก็ตัว hdd ปลายทางที่ต้องการย้าย data vm นั้นๆไปครับ ดูเพิ่มเติมในลิ้งด้านล่างได้เลย
ไม่ต้องมี license v-center ก็ใช้งานใน function นี้ได้ครับผม : )

https://networklessons.com/uncategorized/vmware-esxi-5-move-vm-to-different-datastore

ทีมงาน @ support [at] packetlove [dot] com

95
#whois packetlove.com
using server whois.verisign-grs.com
connection refused

ถ้าเกิดเจอเหตุการณ์แบบนี้ สามารถเชค iptables rule หรือ csf (configure server firewall) ได้นะครับ
#vi /etc/csf/csf.conf

เพิ่มในส่วนของ TCP_OUT = "43"
# Allow outgoing TCP ports
TCP_OUT = "43"
แล้วทำการ reload csf rule
#csf -r

แล้วลองรัน whois command อีกทีก็จะสามารถออกไปได้ละครับผม : )

96
==== Update license in FreeBSD ==== fixed
==== * An error has occurred while trying to update the license file *

cd /usr/local/directadmin/scripts
./getLicense.sh CID LID 103.x.y.z
/usr/local/etc/rc.d/directadmin restart

97
ในกรณีเราใช้งาน docker image ที่เป็น syslog-ng หรือ syslog ที่ port 514 (tcp/udp)
เราสามารถที่จะ troubleshooting ปัญหาว่ามี log ส่งผ่าน container ตัวนี้หรือเปล่า
โดยใช้งานตัว netshoot ซึ่งรวบรวม command เกี่ยวกับ tcpdump,route และ command อื่นๆ ให้ troubleshooting ได้ครับดูเพิ่มเติม
https://github.com/nicolaka/netshoot

===run command
docker run -it --rm --net container:<container_name> nicolaka/netshoot tcpdump

===or check more info before access pull tcpdump on that container then output to pcap file
ssh to server
docker ps -a
===send command tcpdump to capture syslog on src
docker run -it --rm --net container:syslog_service_1 nicolaka/netshoot tcpdump src port 514 -w abc.pcap

98
$ git pull origin master

From https://github.com/mkyong/java-concurrency
 * branch            master     -> FETCH_HEAD
 
fatal: refusing to merge unrelated histories

ทำการแก้ไขโดย

$ git pull origin master --allow-unrelated-histories

From https://github.com/mkyong/java-concurrency
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 674 insertions(+)
 create mode 100644 LICENSE

แล้วทำการ push ใหม่อีกรอบโดยเริ่มจาก

$git add .
$git commit -m "Add Staging 1"
$got push -u origin master

99
แก้ไขปัญหา Cross-Origin Resource Sharing (CORS) ใน dev-tool ของ browser ขึ้นเตือน

เกิดจากในหน้าเว็บมีการเรียกใช้งาน url ระหว่าง frontend , backend แยกกันซึ่งทำให้ resource
บางส่วนไม่ได้ถูกแชร์หรืออนุญาตให้ url มาดึงได้ ดังนั้นเลยต้องประกาศว่า ให้ url ไหนบ้างที่สามารถมาดึง resource ได้ 

===== Basic
Access-Control-Allow-Origin: คือ Origin ที่อนุญาตให้ใช้ Resource ร่วมกันได้
Access-Control-Allow-Methods: คือ Methods ที่อนุญาตให้ใช้ในการติดต่อได้
Access-Control-Allow-Headers: คือ Headers ที่อนุญาตให้ใช้ในการติดต่อได้

==== Add in js
const express = require("express")
const app = express()
const PORT = process.env.PORT || 8445

app.use((req, res, next) => {
   let ALLOW_ORIGIN = ['domain-a.com', 'domain-b.com', 'domain-c.com']
   let ORIGIN = req.headers.origin
      if (ALLOW_ORIGIN.includes(ORIGIN)) {
        res.header('Access-Control-Allow-Origin', ORIGIN)
      }
      res.header('Access-Control-Allow-Methods','POST, GET, PUT, PATCH, DELETE, OPTIONS')
      res.header('Access-Control-Allow-Headers','Content-Type, Option, Authorization')
      return next()
   })
}

app.use('/', (req,res) => res.send("test"))
app.listen(PORT, () => { console.info(`server started on port ${PORT}`)})

100
command , shell script ,tool , crontab / ssh command send to remote host howto by packetlove team
« on: พฤศจิกายน 22, 2019, 06:31:06 AM »
เราสามารถประยุกต์ใช้ ssh command send to remote host ได้นะครับ
ในกรณี เราทำเรื่อง authentication via public key เรียบร้อยแล้ว เราสามารถสั่งให้ เครื่องต้นทาง run ssh command ที่ฝั่ง remote host ได้ดังนี้

ssh -t -p22 testssh2@203.86.x.5 'ls /home'

ก็จะเป็นการ ls /home ที่เครื่อง 203.86.x.5
แล้วเราก็สามารถสั่งให้ไปรัน shell script ในเครื่อง 203.86.x.5 ได้ดังนี้

ssh -t -p22 testssh2@203.86.x.5 '/home/testssh2/testscript.sh'

เท่านี้เองครับผม : )
Support [at] Packetlove [dot] com

101
สแกน ip จริงหลังม่าน cloudflare

git clone https://github.com/m0rtem/CloudFail.git
cd CloudFail
pip2 install -r requirements.txt
python2.7 cloudfail.py --target web.url

##https://github.com/m0rtem/CloudFail

102
==จาก bug [CVE-2019-10149 Exim <4.92] แก้ไขโดย directadmin exim
cd /usr/local/directadmin/custombuild
./build update
./build set exim yes
./build exim

exim --version

103
all application on unix knowledges by golfreeze / install redis on centos7 directadmin
« on: พฤศจิกายน 01, 2019, 09:58:08 PM »
wget http://download.redis.io/releases/redis-5.0.6.tar.gz
tar xzf redis-5.0.6.tar.gz
cd redis-5.0.6
make
make test
make install
cd utils
chmod +x install_server.sh
./install_server.sh

104
วันนี้มีการติดตั้ง directadmin บน FreeBSD 11 ครับแล้วเจอ error 2 ตัว
===== error 1 =====
grep: /usr/local/directadmin/data/admin/ips: No such file or directory
Unable to detect your server IP in /etc/hosts. Please enter it:
===== error 2 =====
Cannot find /usr/bin/mysqldump
ensure_my_cnf: cannot find /usr/local/directadmin/conf/mysql.conf
Setting mysql_milestone_16=1 in directadmin.conf.
Cannot find mysql-5.7.27 package for installation
Could not find /usr/local/directadmin/scripts/directadmin_cron or it is empty

####fixed by
pkg install mysql57-client
pkg install mysql57-server

vi /etc/hosts
แอด ip-address hostname

แล้วทำการ ลงอีกรอบ
./setup.sh auto

105
All Security via cyber space relate golfreeze task. / urlcrazy domain_name
« on: ตุลาคม 31, 2019, 01:38:31 PM »
เราสามารถสแกนหา ชื่อ โดเมน
urlcrazy domain_name
เป็น tool ใน kali

Pages: 1 ... 5 6 [7] 8 9 ... 73