Skip to content

Instantly share code, notes, and snippets.

💭
I'm programer and I have wife 😄

Mochamad Arifin ndunks

💭
I'm programer and I have wife 😄
Block or report user

Report or block ndunks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ndunks
ndunks / dnsmasq-tester.sh
Last active Dec 17, 2018
dnsmasq DHCP Example and logging
View dnsmasq-tester.sh
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
sudo ifconfig eth0 up 192.168.2.1
sudo dnsmasq --no-daemon --log-queries --log-dhcp \
--bind-interfaces --conf-file= --conf-dir= \
--interface=eth0 --except-interface=lo \
--dhcp-range=192.168.2.100,192.168.2.200,12h \
--listen-address=192.168.2.1
@ndunks
ndunks / modem-indihome-zte
Created Mar 21, 2018
Default login telnet/webuser modem indihome ZTE F609
View modem-indihome-zte
webuser
=======
admin:admin
admin:Telkomdso123
user:user
telnet
======
root:Zte521
@ndunks
ndunks / Dockerfile
Created Oct 18, 2018
Docker Image php 7.0 FPM with gmp mysql gd iconv
View Dockerfile
FROM php:7.0-fpm-stretch
RUN apt-get update && apt-get install -q -y ssmtp mailutils
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libgmp-dev \
&& docker-php-ext-install -j$(nproc) iconv \
@ndunks
ndunks / gitlab.php
Created Oct 16, 2018
Gitlab Hook auto deploy live web server
View gitlab.php
<?php
// CONFIG
// This token must sent with the request, for security
$TOKEN='XXXXXXXXXXX';
$LOCAL_GIT=realpath(dirname(__DIR__) . '/app.git');
$PRODUCTION_DIR=realpath(dirname(__DIR__) . '/public_html');
$REMOTE = 'origin';
$LOCAL_BRANCH = 'master';
@ndunks
ndunks / stats.php
Last active Jun 21, 2018
PHP-FPM status wrapper for each serverpilot web apps
View stats.php
<?php
/**
* Serverpilot PHP-FPM Status wrapper for all apps
* Install required package:
* $ sudo apt install libfcgi-bin
*
* Add .htaccess:
* RewriteRule ^php\-stats/ stats.php [NC,L]
*
* Place this script on 'default' web app.
@ndunks
ndunks / histat-fast-load.html
Created May 13, 2018
Histat Code quick load
View histat-fast-load.html
<!-- OLD CODE: -->
<!-- Histats.com START (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.start', '1,3630122,4,0,0,0,00010000']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('//s10.histats.com/js15_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
@ndunks
ndunks / dnsmasq-wlan
Created May 5, 2018
Start dnsmaq when connected to wifi
View dnsmasq-wlan
#!/bin/bash
# Write file /etc/network/if-up.d/ and link to /etc/network/if-post-down.d/
# by default, scripts on that directories will be triggered by NetworkManager
PID="/var/run/dnsmasq/wlan.pid"
WLAN="wlan0"
DNSMASQCONF="/etc/dnsmasq.conf"
IP=$(ifconfig $WLAN | sed -En 's/.*inet ([0-9\\.]+) .+/\1/p')
ME="$IFACE-dnsmasq:"
@ndunks
ndunks / ZTE-F609.md
Last active Feb 16, 2018
Manual help untuk Modem Indihome TELNET ZTE F609
View ZTE-F609.md

Telnet Manual Modem Indihome

Saya sering lupa, jadi tulis aja di gist.

Login Root via Telnet

telnet 192.168.1.1
login: root
pass : Zte521
View wp-shell.sh
for dir in `find ~/apps/* -maxdepth 0 -type d`
do
grep -Rl --include "*.php" "eval(" "$dir/public/"
done
@ndunks
ndunks / DB.php
Created Dec 8, 2017
PHP DB Class for MySQL
View DB.php
<?php
class DB
{
var $con = null;
var $result = null;
var $has_result = false;
var $error = false;
var $last_query;
var $affected_rows;
You can’t perform that action at this time.