Langsung ke konten utama

Postingan

Terimakasih 2020

Postingan terbaru

Deploy Projek Next.js Ke Github Pages

بِŘłْŮ…ِ اللَّهِ الرَّŘ­ْŮ…َنِ الرَّŘ­ِŮŠŮ… Contoh hasil akhir : Disa's Blog Source : source   Bahan-bahan yang diperlukan : 1. Akun Github . Sebagai remote repositori. 2. Akun Travis CI . Kita akan menggukan Travis CI sebagai layanan hostingnya. Biasa dipakai untuk projek-projek open source . Terintegrasi dengan Github. 3. Projek Next.js . Cara kerja : Karena Github Pages ada hosting khusus website statis saja, jadi kita akan menggunakan perintah n ext export pada projek Next.js kita untuk meng- export projek kita menjadi halaman-halaman statis. Dengan memanfaatkan Travis CI, kita akan setting Travis CI agar menjalankan perintah next export saat ia mem- build projek kita. Langkah-langkah : 1. Membuat Github Token Berfungsi sebagai kunci untuk menghubungkan Travis CI dan Github. Jika sudah punya bisa di- skip. Kalau belum punya masuk ke Settings  akun Github kita, klik submenu Developer Settings , pilih Personal access tokens, klik tombol Generate new token , masukkan passwo...

Otentikasi User Dengan JWT Dalam ExpressJS

 Otentikasi dilakukan untuk pengecekan agar tidak sembarang orang yang bisa mengakses fitur/ request , melainkan hanya untuk orang-orang yg sudah terdaftar/login saja. Kalau dulu dalam pengecekan ini saya mengetahuinya dengan menggunakan session , dengan alur ketika user login, data login disimpan di session store , lalu ketika user hendak mengakses suatu fitur/meminta request , server akan mengecek apakah datanya ada di dalam session store atau tidak. Kalau tidak, request -nya akan ditolak sehingga mengharusnya dia login kembali. Nah, JWT (JSON Web Token) juga mirip-mirip alur logikanya, hanya data yang digunakan untuk pengecekannya tidak menggunakan session , melainkan dengan token. Kalau digambarkan alurnya seperti ini: Disini saya menggunakan Postman sebagai simulasi client agar saya bisa fokus ke bagian pemrograman servernya (step nomor 2, 3, 6, dan 7). Lalu diasumsikan sudah terkoneksi dengan database dan sudah ada beberapa data user (password dienkripsi dengan menggunaka...

Membuat SSH Key Untuk Github

Photo by Kari Shea on Unsplash Jika kita sering menggunakan repositori remote seperti Github, SSH key akan sangat berguna karena kita tidak perlu memasukkan username dan password ketika kita akan melakukan push  ke Github. Berikut cara konfigurasi SSH key untuk Github dari nol (saat belum punya SSH key) : 1. Membuat SSH key dengan perintah ssh-keygen -t rsa -b 4096 -C "your_email@example.com" nanti akan ditanya soal nama file  dan passphrase  yang diinginkan, diabaikan saja dengan menekan enter  agar disetting nama dan passphrase  nya dengan dengan settingan default 2. Aktifkan SSH key eval "$(ssh-agent -s)" 3. Tambahkan SSH key ke ssh-agent ssh-add ~/.ssh/id_rsa 4. Copy SSH key dengan xclip (install xclip jika belum punya) sudo apt install xclip xclip -sel clip < ~/.ssh/id_rsa.pub 5. Masuk ke Github, di pojok kanan atas klik foto profil kita, klik menu Settings 6. Klik menu SSH and GPG Keys , lalu klik tombol New SSH Key 7. Paste kan SSH key yang sudah di...

Laravel Migrate Error : Could not find driver and no [PDOException] problem

Photo by Tianyi Ma on Unsplash I found problem when i want to migrating in Laravel, the error said [Illuminate\Database\QueryException] could not find driver (SQL: select * from information_schema.tables where table_schema = belajarlaravel and table_name = migrations i searched the solution, but almost all of forum have a problem with PDOException, which means they have to install php-mysql (for connecting between php and mysql) and set up php.ini. But my php-mysql already installed so what i have to do is set up my php.ini. Here what i did : 1. Go to /opt/lampp/etc/ 2. edit php.ini  using sudo gedit php.ini 3. find  extension=php_pdo_mysql.dll, remove the semicolon and save 4. Restart the web server When i tried to migrating again with php artisan migrate , i found new error [Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = belajarlaravel and table_name = migrations and table_type...

[SOLVED] #1558 - Column count of mysql.proc is wrong. Expected 21, found 20.

Photo by ClĂ©ment H on Unsplash When i imported a database, i got problem with the error said  After i search the solution on the internet, i found a simple solution. If you are using Xampp with MariaDB server. Here what you need to do : 1. Open terminal, go to opt/lampp/bin directory 2. Do upgrade with mysql_upgrade command. Enter the password, wait untill the upgrade is done That's it ! it works for me, now i can import my database

LARAVEL INSTALLING PROBLEM : LARAVEL COMMAND NOT FOUND

Photo by Glenn Carstens-Peters on Unsplash When i start to migrating from Windows to Linux (i am using Ubuntu 18.04) i have to install everthing including Laravel. So i installed the Laravel globally using composer  everything went ok. Then i found problem when i want to make a project named " perpus " using command    The erro r says : "laravel : command not found". Then i checked what the official website says : "Make sure to place Composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common location inceelude : GNU / Linux Distributions : $HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin " So we have to check our Composer PATH location and Linux's Bash to make sure there are in the same location. First, open the terminal and type we can see my Composer PATH located in /.compose...