Skip to content

Instantly share code, notes, and snippets.

View marulitua's full-sized avatar

erwin maruli tua pakpahan marulitua

  • Bali
View GitHub Profile
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:88 ELOTraining:0 LISTENING
TCP 0.0.0.0:135 ELOTraining:0 LISTENING
TCP 0.0.0.0:389 ELOTraining:0 LISTENING
TCP 0.0.0.0:445 ELOTraining:0 LISTENING
TCP 0.0.0.0:464 ELOTraining:0 LISTENING
TCP 0.0.0.0:593 ELOTraining:0 LISTENING
<?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "registrasi".
*
* @property integer $id
<?php
$dir = 'public/report';
$key_name = 'file';
if(!is_null($file = $_FILES[$key_name])) {
$now = new \DateTime('NOW');
$date_dir = sprintf("%s/%s/%s", $now->format('Y'),$now->format('m'),$now->format('d'));
$full_path_dir = sprintf("%s/%s/%s",getcwd(), $dir, $date_dir);
========================HOW TO HOST UPLOAD SCRIPT with DOCKER========================
1. Make sure docker was installed and running
2. Get proper image
Kita akan menggunakan image web server nginx yang sudah terinistall
dan terkonfigurasi dengan php-fpm.
Image yang akan kita gunakan adalah richarvey/nginx-php-fpm dari https://hub.docker.com/r/richarvey/nginx-php-fpm/
untuk mendownload image dari registry (repo hub.docker.com) jalankan
<?php
$dir = '/reports';
$key_name = 'file';
$key_imei = 'imei';
if(isset($_FILES[$key_name]) && !is_null($file = $_FILES[$key_name]) && !is_null($imei = $_POST[$key_imei])) {
$now = new \DateTime('NOW');
$date_dir = sprintf("%s/%s/%s", $now->format('Y'),$now->format('m'),$now->format('d'));
$full_path_dir = sprintf("%s/%s/%s",getcwd(), $dir, $date_dir);

Keybase proof

I hereby claim:

  • I am marulitua on github.
  • I am marulitua (https://keybase.io/marulitua) on keybase.
  • I have a public key ASDIjXFT9IFyu9rtBZ3dtPA82VQoy6wj4OfJzF3Dy8nxkwo

To claim this, I am signing this object:

@marulitua
marulitua / introrx.md
Created September 20, 2016 10:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@marulitua
marulitua / dhcpd.conf
Created April 23, 2018 07:19 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@marulitua
marulitua / Wishlist
Last active September 15, 2018 12:26
woocomerce wl
// wp-content/themes/shop-isle-child/functions.php
// add class 'tinvwl-product-in-list' custom css class
add_action('woocommerce_after_shop_loop_item', 'add_a_custom_button', 11 );
function add_a_custom_button() {
global $product;
$wlButton = do_shortcode("[ti_wishlists_addtowishlist product_id=".$product->id."]");
$dom = new DOMDocument;
$dom->loadHTML($wlButton);
$dataTinvWlList = '';
@marulitua
marulitua / devtools.py
Created May 30, 2019 09:05 — forked from hellricer/devtools.py
ELinks hooks providing a framework for manipulating DOM
import os
import re
import subprocess
from bs4 import BeautifulSoup
import rules
def replacer(url, html):
new = html
reload(rules)