แสดงกระทู้

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 ... 6 7 [8] 9 10 ... 73
106
Do the following to keep just the last 2 kernels on your system, to keep /boot clean

1 - Edit /etc/yum.conf and set the following parameter

installonly_limit=2
This will make your package manager keep just the 2 last kernels on your system(including the one that is running)

2 - Install yum-utils:

yum install yum-utils
3- Make an oldkernel cleanup:

package-cleanup --oldkernels --count=2
Done. This will erase in a good fashion the old kernels, and, keep just the last 2 of them for the next upgrades.

108
วิธีเพิ่มความยาวตัวอักษรของหัวข้อกระทู้

โดยปรกติหัวข้อกระทู้จะตั้งได้ยาว 80 ตัวอักษรภาษาอังกฤษ แต่ถ้าเป็นภาษาไทยจะได้ไม่ถึง 80 ตัวอักษรจริงๆ
ทำให้อาจน้อยเกินไปจนไม่ค่อยสื่อความหมายสำหรับภาษาไทย เรามีวิธีเพิ่มความยาวตัวอักษรของหัวข้อกระทู้ดังนี้

แก้ไขไฟล์ Post.template.php ที่อยู่ใน Themes/default/Post.template.php

// Now show the subject box for this post.
   echo '
      <dt>
         <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
      </dt>
      <dd>
         <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
      </dd>
      <dt class="clear_left">
         ', $txt['message_icon'], ':
      </dt>
      <dd>

ลองแก้ maxlength จาก 80 เป็น 200 ดูนะครับ

// Now show the subject box for this post.
   echo '
      <dt>
         <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
      </dt>
      <dd>
         <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="200" class="input_text" />
      </dd>
      <dt class="clear_left">
         ', $txt['message_icon'], ':
      </dt>
      <dd>

บางคนทำแค่นี้ก็ใช้ได้ (อาจเป็น Version อื่น) แต่ของผมต้องแก้อีกไฟล์นึงครับที่ไฟล์ Post.php ที่อยู่ใน Sources/Post.php อีก 2 ที่คือ

// Make sure the subject isn't too long - taking into account special characters.
if ($smcFunc['strlen']($form_subject) > 100)
   $form_subject = $smcFunc['substr']($form_subject, 0, 100);

และ

// At this point, we want to make sure the subject isn't too long.
if ($smcFunc['strlen']($_POST['subject']) > 100)
   $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100);


แก้จาก 100 เป็น 200 ครับ

// Make sure the subject isn't too long - taking into account special characters.
if ($smcFunc['strlen']($form_subject) > 200)
   $form_subject = $smcFunc['substr']($form_subject, 0, 200);

และ

// At this point, we want to make sure the subject isn't too long.
if ($smcFunc['strlen']($_POST['subject']) > 200)
   $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 200);


แก้ได้มากที่สุดคือ 255 นะครับ

เครดิตจาก
How to increase the Subject length
http://www.simplemachines.org/community/index.php?topic=359405.0
http://itamusing.com/smf/index.php?topic=14.0

109
==install letencrypt
yum install certbot python2-certbot-nginx
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

===Obtaining a certificate for dev.packetlove.com
certbot --nginx -d dev.packetlove.com

===Renewing a certificate
certbot renew --dry-run
certbot renew
nginx -s reload


===vi /etc/cron.daily/letsencrypt-renew
#!/bin/sh
if certbot renew > /var/log/letsencrypt/renew.log 2>&1 ; then
   nginx -s reload
fi
exit

===chown
chmod +x /etc/cron.daily/letsencrypt-renew

===crontab -e
01 02,14 * * * /etc/cron.daily/letsencrypt-renew


===analyse ssl
https://www.ssllabs.com/ssltest/analyze.html?d=dev.packetlove.com

110
microsoft office 2016 pro plus found 1920 problem how to fixed related with network Service not have permission to install program.

In Windows Explorer:

Right Click  on the folder OfficeSoftwareProtection Platform from C:\Program Files\Common Files\Microsoft Shared and Microsoft from C:Program data(hidden folder) Properties > Security > Edit > Add > Type Network Service > OK > Check the Full control box > Apply and OK.

In Registry Editor (regedit.exe):

Go to HKEY_CLASSES_ROOT\AppID registry >Right Click on the folder > Permissions > Add > TypeNETWORK SERVICE >  OK > Check Full Control > Apply > OK

This worked for me and many others with the same problem, and took mere minutes to do.

111
cd /usr/local/directadmin/custombuild
./build update
./build roundcube

112
All Security via cyber space relate golfreeze task. / malware for mac os download
« on: ตุลาคม 03, 2019, 06:37:08 PM »
malware for mac os download
https://objective-see.com/malware.html

113
command , shell script ,tool , crontab / javascript block enter button in php script
« on: กันยายน 29, 2019, 04:09:37 PM »
ในกรณี จะให้ user ใส่ค่าใน field รับค่า แต่จะไม่ให้กดปุ่ม "enter" ให้แค่กดเม้าที่ปุ่มใน หน้าสคิปเท่านั้นถึงจะทำงานได้
สามารถใช้งานเป็น javascript ได้ดังนี้

<script language="javascript">
$('input,select').keypress(function(event) {
        // detect ENTER key
        if (event.keyCode == 13) {
            // simulate submit button click
            $("#btn-submit").click();
            // stop form from submitting via ENTER key press
            event.preventDefault ? event.preventDefault() : event.returnValue = false;
        }
    });
</script>

114
process explorer ไว้วิเคราะห์ process ไรบ้างทำงานใน os window เหมือน ps aux ใน linux
https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

115
https://keepass.info application keep password

116
command , shell script ,tool , crontab / archive file to .tgz
« on: กันยายน 08, 2019, 02:46:33 PM »
A tar.gz file and a .tgz file are similar.

Compress files using tar:

tar -cvzf <name of tarball>.tgz /path/to/source/folder
for example, I want to create a backup.tgz or backup.tar.gz from folder /home/user/project

tar -cvzf backup.tgz /home/user/project

tar -cvzf backup.tar.gz /home/user/project
You can use tar cvzf instead of tar -cvzf as well.

Extract .tgz or .tar.gz files using tar

tar -xvzf backup.tgz

tar -xvzf backup.tar.gz
Mnemonic for compression (the order of the flags do not matter)

C ompress
Z ee
F ile
V erbose
Mnemonic for extraction (the order of the flags do not matter)

e X tract
Z ee
F ile
V erbose

117
หลายๆ บริษัทในญี่ปุ่นส่วนใหญ่มีวัฒนธรรมที่เรียกว่า “โชเร (朝礼)” ちょうれい หรือการประชุมช่วงเช้าก่อนเริ่มงาน เนื้อหาหลักๆ นอกจากจะเป็นเรื่องงานที่ต้องทำในวันนี้แล้ว บางบริษัทก็มีกิจกรรมปลุกใจเพื่อให้พนักงานพร้อมที่จะเริ่มทำงานได้อย่างเต็มที่ ไม่ว่าจะเป็นการท่องคำขวัญของบริษัท, ร้องเพลงประจำบริษัท หรือออกกำลังกายเล็กๆ ร่วมกันยามเช้า

118
all application on unix knowledges by golfreeze / add additional ip on interface in freebsd os
« on: สิงหาคม 17, 2019, 06:32:30 PM »

#vi /etc/rc.conf

# Force 10Mbps for both public and private LAN interace
ifconfig_em0="inet 10.20.110.2 netmask 255.255.255.192 media 10baseT/UTP mediaopt full-duplex"
ifconfig_em1="inet 202.52.1.2 netmask 255.255.255.248 media 10baseT/UTP mediaopt full-duplex"
ifconfig_em0_alias0="inet 10.20.1.226 netmask 255.255.255.0"
ifconfig_em0_alias1="inet 10.20.1.227 netmask 255.255.255.0"

restart network
#/etc/netstart

119
phpmyadmin could not mysql 8.x server

=> mysql -p
=>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';

Then try to login phpmyadmin url again.

120
PHP7.x with MySQL 8.0+ error: The server requested authentication method unknown to the client

=> error : the server requested authentication method unknown to the client

== fixed by use mysql_native_password
ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';

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