LetsEncrypt certificate Error

โดย Little Bear on August,24 2018 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 ใหม่อีกที

Hello Darling

โดย Little Bear on August,16 2018 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

Copy and rename an Android project in Android Studio

โดย Little Bear on August,03 2018 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"



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

Recovering data from a WD Mybook Live 1TB

โดย Little Bear on July,02 2018 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

How can I convert a part of Java source file to Kotlin?

โดย Little Bear on July,02 2018 00.32

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

รายละเอียด

543 items|« First « Prev 3 4 (5/109) 6 7 Next » Last »|