Thursday, June 26, 2014

Using netinstall to update MikroTik


  1. Download netinstall (http://www.mikrotik.com/download)
  2. Download the package (http://www.mikrotik.com/download)
  3. Run/Open netinstall
  4. Click "Net Booting" button
  5. Check "Boot Server Enabled"
  6. Fill client IP address with 192.168.88.10 (in this example my computer IP address is 192.168.88.9)
  7. Connect router board and PC via ether1
  8. Turn off the router board
  9. User paper clip or something to push the reset button on the router board
  10. Push and hold the reset button, turn on the router board, stay hold the reset button until the act indicator stop flashing
  11. Wait 10-20 seconds it should detected from netinstall
  12. Select the package and click install button

Wednesday, June 25, 2014

Grails Jasper plugins - direct pdf output

I use jasper plugin (http://grails.org/plugin/jasper) in my grails application. I want to send direct pdf file to the browser.

package com.jasper

import org.codehaus.groovy.grails.plugins.jasper.JasperExportFormat
import org.codehaus.groovy.grails.plugins.jasper.JasperReportDef

class LabController {

    def jasperService
    def directpdf() {

        def reportDef = new JasperReportDef(name:'mbarang.jrxml', fileFormat:JasperExportFormat.PDF_FORMAT)
        response.contentType = 'application/pdf'
        response.outputStream << jasperService.generateReport(reportDef).toByteArray()
        return(false);
    }
}