Postingan

Menampilkan postingan dari Juni, 2020

tunning atau optimize server saat error 502 atau 504

Ubuntu : - Cek nginx.conf besarkan countcurrent user - Cek www.conf di php-fpm besarkan pm.max_children dan sesuaikan dengan kondisi server bisa dilihat di top atau plugin glances service php7.3-fpm restart service php7.3-fpm status systemctl status nginx systemctl restart nginx

Fungsi fungsi laravel model

- multiple like atau cara menggunakan fungsi like dengan banyak kondisi : $proposals = $this->where('is_submitted','=', $is_submit)                       ->where(function($query) use ($keyword)                             {                               $query->where( 'judul','LIKE', '%'.$keyword.'%' )                                     ->orWhere( 'nama_organisasi','LIKE', '%'.$keyword.'%' );                             })                   ->paginate(10); - kondisi untuk query jika param tidak ada : $query = $this->join('kategori_dokumens', 'kategori_dokumens.id'...

Import restore data mysql secara parsial per kolom per tabel

Extracting a Table from a MySQL Dump Occasionally, I need to use the data in a single table from a full  MySQL  database backup dump. Ordinarily, you’d just import the database dump into MySQL and go. Unfortunately, if the dump file is several Gigabytes (even when compressed), it becomes time-consuming to  SCP  this file around and then load it into MySQL. In order to speed up the process, I extract the table I need from the full database dump. Then, I can take that table,  SCP  it to where I need it, load it into MySQL, and perform necessary operations with it. Fortunately, complicated programs and commands are not necessary for this: only  grep  and  sed  are needed. The first step is to determine the table structure from the decompressed MySQL database dump: BASH $ grep -n "Table structure" [ MySQL_dump_filename ] .sql Example: Let’s say we want to extract the  phpbb_config  table from a giant MySQL phpBB ...