Rezha Julio

Hi!
My name is Rezha Julio
I am a chemist graduate from Bandung Institute of Technology. Currently working as Data Engineer at Traveloka.
You can reach me by email:

contact@rezhajulio.id

, @ Q Q

Powered by Hugo

filter by tags

Disabling Apport Error Reporting on Ubuntu

time to read 2 min | 333 words

What is Apport ?

Apport is an Error Reporting Service provided by Ubuntu to intercept and analyze crashes and bugs as and when they occur. Crashes and Bugs may sound like bad things, but actually most operating systems will have several a day, and it doesn’t mean your computer is broken, nor does it necessarily stop working. As such, Apport can usually be safely disabled, as it doesn’t fix anything, it just tells developers that something went wrong.

Ubuntu 12.04 is the first release of Ubuntu that ships with Apport Error Reporting enabled by default, and as a result, you may get a large quantity of Internal System Error popups inside Ubuntu. Similar popups may also read Sorry, Ubuntu 12.04 has experienced an internal error. These popups are part of Apport, an internal debugger which automatically generate reports to submit for packages that crash. Many reports can’t be filed or have already been filed, and as such it is usually safe to turn off.

Stopping Apport

You can stop the currently running Apport service with the following command.

sudo service apport stop

Note that unless you remove it or disable it at boot it will start again the next time you turn on your computer.

Disable Apport at Boot

You need to manually edit a file to Stop Apport Running at Boot (when you turn on your machine. Open the Terminal, and paste the following command with Ctrl+Shift+V, or type it in manually.

sudo nano /etc/default/apport

Change the line that says enabled=1 to enabled=0 to disable Apport. To re-enable, change it back.

Uninstall Apport

It is fairly simple to uninstall Apport, as you can open the Ubuntu Software Centre, search for apport, and simply click Remove.

A similar process can be used for the package apport in both Synaptic and the Terminal.

sudo apt-get purge apport

Even thought it is safe to uninstall apport, I don’t really recommend it, just in case you want to enable it back, stopping apport is already enough.

Push Notifications untuk Setiap Error di Laravel

time to read 1 min | 199 words

Karena user lebih memilih untuk menutup website daripada melaporkan error

Saya selalu kepengen tau ketika aplikasi yang saya bikin bermasalah. Ketika aplikasi yang kita buat bermasalah, pasti enak rasanya kalo ada notifikasi yang masuk ke smartphone kita, iya ga ?

Setting nya cukup mudah, kamu cuma perlu akun gmail dan aplikasi gmail di iOS atau android. Kalau kamu udah punya keduanya dan udah kamu setting supaya bisa dapet notifikasi email di smartphone kamu, maka kamu dah siap. Langkah yang kamu harus lakukan sebenernya mudah, kamu cuma harus buat aplikasi kamu kirim email setiap ada error.

Disini saya menggunakan fungsi mail() yang udah built-in di PHP karena saya ga butuh sesuatu yg spesial dan saya ga butuh tampilan email yg memukau. Simpel tapi efektif. Info yang saya butuhin cuma log error, IP pengguna dan server, sama URL dimana error terjadi. Untuk itu saya bikin script kayak gini

$ip = Request::server(‘REMOTE_ADDR’);
$host = getHostByAddr(Request::server(‘REMOTE_ADDR’));
$server = Request::server(‘HTTP_HOST’);
$url = $host.Request::server(‘REQUEST_URI’);
$message = "Client: $ip ($host)\r\nURL: http://$server\r\n\r\n$exception";
mail("you@gmail.com", "Exception at $server",$message, "From: $server <you@gmail.com>\r\nContent-Type: text/html;\r\nMime-Version: 1.0");  

Simpel kan ? Untuk Laravel 4 cukup kamu taruh di file app/start/global.php di bagian App::error. Di Laravel 3 ke bawah bisa kamu taruh di file application/config/error.php

RECENT SERIES

  1. java 101 (13):
    Apr 29, 2017 - Translating Scanner tokens into primitive types
  2. python data structure (5):
    May 03, 2017 - Enhance your tuples
  3. python function (2):
    Apr 16, 2017 - Lambda Functions in Python
  4. python generator (4):
    Apr 26, 2017 - Next, Function or Method ?

Friends of Rezha