Contoh script <?php // Create a 100*30 image $im = imagecreate(100, 30); // White background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); // Write the string at the top left imagestring($im, 5, 0, 0, ‘Hello world!’, $textcolor); // Output the image header(’Content-type: image/png’); […]
Cara Mengakses URL Laravel dengan Akhiran html
Cara menambah .html di akhir URL Laravel. Untuk contoh singkat kita akan membuat langsung dari routes, buka routes/web.php tambahkan Route::get(’/{url}.{extension}’, function ($url) { echo "$url"; })->where(’extension’, ‘(?:html)?’); sekarang coba akses dari browser http://localhost/laravel/ini-link-ya.html sesuaikan http://localhost/laravel dengan link laravel anda
Cek Bash Script Dieksekusi Oleh User Sudo atau Bukan
Buat file baru dengan nama cek-sudo.sh #!/usr/bin/env bash # cek-sudo.sh USERSUDO=$SUDO_USER if [[ -z $USERSUDO ]]; then echo "Harus dijalankan pake sudo" exit 1 fi echo "Okay, saya dijalankan pake sudo" Coba jalankan bash ./cek-sudo.sh script langsung keluar dan menampilkan pesan errornya $ bash ./cek-sudo.sh Harus dijalankan pake sudo coba jalankan dengan sudo […]
Solusi Disk Windows 10 Selalu 100%
Apakah belakangan Windows 10 anda terasa lambat, tiba-tiba loading disana sini walaupun sudah pake SSD, memory gede? Coba gunakan tips singkat dibawah ini Buka Settings dari Start Menu atau pake shortcut CTRL + X pilih Settings klik System lalu klik Notification & actions. Nonaktifkan pilihan “Show me the Windows experience after updates and occasionally when […]
curl SSL received a malformed Alert record
Beberapa hari ini, parsing data kurs di Bank BRI gagal, karena konfigurasi SSL di server bank BRI chainnya tidak lengkap. $ curl -I https://eform.bri.co.id/ curl: (35) SSL received a malformed Alert record. Solusinya Solusinya untuk saat ini adalah melewatkan proses validasi SSL-nya, sampai pihak System Administrator BRI memperbaiki servernya. cURL ubah perintah curl menjadi curl […]
Install VirtualBox 5.2 di Fedora 26
Bila sebelumnya ada telah menginstall VirtualBox 5.1.x anda harus meng-uninstall versi tersebut dnf remove VirtualBox-5.1 -y dengan menghapus VirtualBox 5.1 data-data anda tetap aman, data/images/guest akan tetap muncul setelah menginstall VirtualBox 5.2 Download Repository VirtualBox Fedora 26 wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo Install VirtualBox 5.2 dnf install VirtualBox-5.2 -y Agar dapat mengakses USB, mengubah resolusi monitor […]