ก๊วนซอฟท์แวร์ </softganz> SoftGang (Gang Software)

Web &amp; Software Developer Gang.

602 items|« First « Prev 7 8 (9/61) 10 11 Next » Last »|
โดย Little Bear on 24 ส.ค. 61 13:09

LetsEncrypt certificate error ประมาณ

Details
Getting challenge for domain.com from acme-server...
Error: http://domain.com/.well-known/acme-challenge/letsencrypt_xxxxxxxxxx is not reachable. Aborting the script.
Please make sure /.well-known alias is setup in WWW server.

ยังหาสาเหตุไม่เจอ

แก้ไขชั่วคราว

Check /etc/httpd/conf/extra/httpd-alias.conf that have this line: Alias /.well-known /var/www/html/.well-known

หากไม่มีก็เพิ่มเข้าไป

Alias /.well-known /var/www/html/.well-known

แล้วลองสร้าง SSL หากขึ้น error ก็ให้สร้าง folder /var/www/html/.well-known/acme-challenge/letsencrypt_xxxxxxxxxx ด้วย

mkdir /var/www/html/.well-known/acme-challenge/letsencrypt_xxxxxxxxxx

แล้วสร้าง SSL ใหม่อีกที

โดย Little Bear on 16 ส.ค. 61 09:39
Hello Darling
written and recorded by Conway Twitty

C                                           C7
Hello darling  nice to see you  it's been a long time
               F                      C
You're just as lovely  as you used to be
                             G7      C
How's your new love  are you happy   hope you're doing fine
        D7                       G7
Just to know it means so much to me
C                            G7          C
What's that darling  how'm I doing   I'm doing all right
         F                                    C
Except I can't sleep and I cry all night till dawn
                             F                   C
What I'm trying to say is  I love you and I miss you
           F          G7        C
And I'm so sorry that I did you wrong

                        G7                 C
Look up darling  let me kiss you  just for old time sake
       F                            C
Let me hold you in my arms one more time
                           G7         C
Thank you darling  may God bless you  and may each step you take
          D7                               G7
Bring you closer to the things you seek to find

C                         G7         C
Goodbye darling  gotta go now  gotta try to find a way
              F                              C
To lose these memories of a love so warm and true
                                       F        C
And if you should ever find it in your heart to forgive me
                          G7          C
Come back darling I'll be waiting for you


Hello Darling
written and recorded by Conway Twitty

C/G C/G C/G C7 C/G                        G        C          C7 Hello darling  nice to see you  it's been a long time               F                      C G You're just as lovely  as you used to be C/G                          G      C                C7 How's your new love  are you happy  Hope you're doing fine         D                        G Just to know it means so much to me C/G                  G                  C        C7 What's that darling  how'm I doing  I'm doing all right         F                                    C G Except I can't sleep and I cry all night till dawn         C        C7        F              C What I'm trying to say is  I love you and I miss you     F            G              C G And I'm so sorry that I did you wrong

C/G                    G              C            C7 Look up darling  let me kiss you  just for old time sake       F                            C G Let me hold you in my arms one more time C/G                    G                      C            C7 Thank you darling  may God bless you  and may each step you take           D                                G Bring you closer to the things you seek to find

C/G                    G            C            C7 Goodbye darling  gotta go now  gotta try to find a way               F                              C G To lose these memories of a love so warm and true C/G                    G              C        C7 And if you should ever find it in your heart to forgive me           F              G          C        F C G C Come back darling I'll be waiting for you

Video : 1 2
Ref : 1 2

โดย Little Bear on 3 ส.ค. 61 17:00

วิธีสำเนา Android Application Source Code ไปเป็น Application ใหม่ ลองทำตามขั้นตอนดังนี้

Copy and rename a project

For some lessons, you will need to make a copy of a project before making new changes. You may also want to copy a project to use some of its code in a new project. In either case you can copy the existing project (ExistingProject), and then rename and refactor the new project's (NewProject) components to use the new project's name. (In the instructions below, substitute your actual project names for ExistingProject and NewProject.

1. Copy the project

  1. On your computer's file system (not in Android Studio), make a copy of the ExistingProject directory.
  2. Rename the copied directory to NewProject .

2. Rename and refactor the project components

The old name of the project, ExistingProject, still appears throughout the packages and files in the new copy of your project. Change the file and the package references in your app to the new name, as follows:

  1. Start Android Studio
  2. Click Open an existing Android Studio project.
  3. Navigate to the NewProject directory, select it, and click OK.
  4. Select Build > Clean Project to remove the auto-generated files.
  5. Click the 1:Project side-tab and choose Android from the drop-down menu to see your files in the Project view.
  6. Expand app > java.
  7. Right-click com.example.android.existingproject and choose Refactor > Rename. This opens the Rename dialog.
  8. Change existingproject to newproject.
  9. Check Search in comments and strings and Search for text occurrences and click Refactor.
  10. The Find Refactoring Preview pane appears, showing the code to be refactored.
  11. Click Do Refactor. (ปุ่ม Do Refactor อยู่ที่แถบด้านล่าง มองหาตั้งนาน เพิ่งเจอ)
  12. Expand res > values and double-click the strings.xml file.
  13. Change the name="app_name" string to New Project.

3. Update the build.gradle and AndroidManifest.xml files

Each app you create must have a unique application ID, as defined in the app's build.gradle file. Even though the above steps should have changed the build.gradle file, you should check it to make sure, and also sync the project with the gradle file:

  1. Expand Gradle Scripts and double-click build.gradle (Module: app).
  2. Under defaultConfig, check to make sure that the value of the applicationID key has been changed to "com.example.android.newproject". If it has not changed, change it manuall now.
  3. Click Sync Now in the top right corner of the Android Studio window.
    Tip: You can also choose Tools > Android > Sync Project with Gradle File to sync your gradle files.

In addition, some apps include the app name in readable form (such as "New Project" rather than newproject) as a label in the AndroidManifest.xml file.

  1. Expand app > manifests and double-click AndroidManifest.xml.
  2. Find the statement below, and if necessary, change the label if to the string resource for the new app name:
android:label="@string/app_name"

เปิดใช้งาน ADB ผ่าน WIFI โดยไม่ต้องใช้สาย USB

$Library/Android/sdk/platform-tools/adb tcpip 5555
$Library/Android/sdk/platform-tools/adb connect 192.168.2.103:5555

อ่านรายละเอียดต่อได้ที่ Copy and rename a project

โดย Little Bear on 2 ก.ค. 61 23:21

คาดว่า Mainboard ของ WD My Book Live คงจะเสียหายจากฟ้าผ่า หลังจากรื้อเอา harddisk ออกมา ก็หาทางเอาข้อมูลออก

เนื่องจากไม่มีเครื่องคอมตั้งโต๊ะเหลืออยู่อีกแล้ว เลยสั่ง Orico Harddisk Dock มา 1 ตัว

หลังจากเสียบ harddisk ลงไปก็มองเห็น harddisk แต่ mount ไม่ได้

จำเป็นต้องใช้ fuseext2 ตามนี้

ติดตั้งโปรแกรมก่อน

sudo apt-get install fuseext2 parted
sudo parted -l

มองเห็น partition /dev/sdb4

สั่ง mount disk

sudo mkdir -p ~/WD
sudo fuseext2 -o ro -o sync_read /dev/sdb4 ~/WD

แล้วก็หาทาง copy data ออกมา

อ่านต่อได้ที่ Recovering data from a WD Mybook Live 2TB / 3TB

โดย Little Bear on 2 ก.ค. 61 00:32

CMD+SHFT+ALT+K is the easiest way to convert from Java to Kotlin in Android Studio

รายละเอียด

โดย Little Bear on 18 มี.ค. 61 09:34

เกิดปัญหาจากการ mount network drive บน Finder ของ Mac OSX เมื่อใช้ SMB ที่ป้อนรหัสแล้วไม่ผ่าน เลยเปลี่ยนมาเป็น CIFS ที่ป้อนรหัสเดียวกัน กลับผ่านเฉยเลย

open 'cifs://user:password@server/share'

หาก mount ด้วย SMB เมื่อป้อนรหัสแล้วไม่ผ่าน (ยังไม่รู้ว่าเกิดอะไรขึ้น) แต่หาก mount ด้วย CIFS ด้วยรหัสเดียวกัน จะผ่าน เมื่อเปิดดู Info ก็จะบอกว่าเป็น smb เหมือนกัน

open 'smb://user:password@server/share'

ที่มา How can I mount an SMB share from the command line? , Make your AFP NAS more responsive

โดย Little Bear on 30 ม.ค. 61 12:00

Enabling JavaScript

JavaScript is disabled in a WebView by default. You can enable it through the WebSettings attached to your WebView. You can retrieve WebSettings with getSettings(), then enable JavaScript with setJavaScriptEnabled().

WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

Binding JavaScript code to Android code

public class WebAppInterface {
    Context mContext;

    /** Instantiate the interface and set the context */
    WebAppInterface(Context c) {
        mContext = c;
    }

    /** Show a toast from the web page */
    @JavascriptInterface
    public void showToast(String toast) {
        Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
    }
}

Bind class Android

WebView webView = (WebView) findViewById(R.id.webview);
webView.addJavascriptInterface(new WebAppInterface(this), "Android");

Coding in javascript

<a href="javascript:void(0)" onclick="showAndroidToast('Hello Android!')">Click for android</a>
<script type="text/javascript">
function showAndroidToast(toast) {
    if (typeof Android=="object") Android.showToast(toast);
    else console.log("App not run on Android")
}
</script>



ที่มา Building Web Apps in WebView

โดย Little Bear on 10 ม.ค. 61 12:40

Update for MacOS : @2021-08-24

วิธีติดตั้ง

วิธีที่ 1 : ผ่าน BrewInstall

ลองแล้ว ผ่าน แต่จะติดตรง "Meld.app" cannot be opened because the developer cannot be verified.

ติดตั้ง brew cask

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

ติดตั้ง meld

brew install --cask meld

วิธีแก้ไข "Meld.app" cannot be opened because the developer cannot be verified. จาก Open a Mac app from an unidentified developer ให้เปิดโปรแกรมโดยกดปุ่ม CTRL+Click บน icon app (แนะนำให้ใช้ Finder) แล้วคลิกขวา เลือก "Open"

ที่มา Install Meld for OSX on Mac OSX – Brew Cask – Big Sur, Mojave, Catalina, High Sierra, Capitan

วิธีที่ 2 : ติดตั้งจากไฟล์ .dmg โดยตรง

  1. Download and Install Yousseb fork for Mac https://yousseb.github.io/meld/.
  2. Create a meld file somewhere on my path, with code from comment by Levsa (pasted bellow) https://techtldr.com/how-to-run-meld-on-mac-os-x-yosemite-without-homebrew-macports-or-think/#comment-50195
  3. Make sure the file is still executable
    sudo chmod a+x ~/bin/meld

ที่มา How To Run Meld on Mac OS X Yosemite Without Homebrew, MacPorts, or Think

วิธีที่ 3 : ติดตั้งผ่าน MacPorts

ซับซ้อนพอสมควร ยังไม่ได้ลอง

ที่มา : Installing MacPorts


สำหรับการติดตั้งใน Mac OSX รุ่นเก่า

หลังจากพยายามติดตั้ง Meld บน Mac OSX High Sierra มาหลายรอบ และไม่เคยสำเร็จสักที แม้กระทั่งพยามยามลง Ubuntu บน OSX ก็ยอม ก็เจอปัญหาหน้าจอถูกจำกัดอยู่ที่ 800x600 ซะนี่

แต่ว่า..... ในที่สุดก็ต้องขอขอบคุณ  ผู้มีพระคุณที่ Github ที่ช่วยทำ OSX dmg file ให้ติดตั้งได้โดยง่ายยยยยยยย

ช้าอยู่ใย ดาวน์โหลดเลย และติดตั้งเลย

Update : 2020-10-03 หลังจากติดตั้งเสร็จ เมื่อเปิดใช้ครั้งแรก จะแสดง developer not verify ให้เปิด System Preference / Security & Privacy / General แล้วคลิก Aloow apps ด้วย

Update : 2018-10-01 ต.ค. 2018 Upgrade Mac OSX เป็น Mojave เกิดปัญหาเปิด Meld ไม่ได้ มีแต่ icon แต่ไม่มีหน้าต่างโผล่มา

เขาบอกว่าให้ run Bash script _clean-meld-settings.sh เพื่อคลีน settings ของ Meld

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

OK WORK!!!!!

ที่มา Meld for OSX

โดย Little Bear on 4 พ.ค. 60 21:43

ต้องการให้สร้างลำดับของ sorder ของข้อมูลในกลุ่มที่มีค่า tpid เดียวกัน โดยเริ่มนับ sorder จาก 1 เป็นต้นไป และเริ่มนับ 1 ใหม่เมื่อเปลี่ยนค่า tpid

SET @f := null, @i = null;
UPDATE `jobtr`
SET
    sorder = IF(tpid = @f, @i := @i+1, @i := 1),
    tpid = (@f := tpid)
ORDER BY tpid, sorder, jobtrid;

หากไม่ต้องเริ่มต้น group

SET @i = 0;
UPDATE users SET uid = @i := @i+1 ORDER BY uid ASC;

602 items|« First « Prev 7 8 (9/61) 10 11 Next » Last »|