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 / webpack.external.js
Created June 21, 2019 12:45
Get list of excluded module in webpak config
module.exports = function(){
var fs = require("fs");
var nodeExternal = {};
var pkg = JSON.parse(fs.readFileSync('package.json', { encoding: 'utf-8' }));
Object.keys(pkg.dependencies).forEach(function (name) {
nodeExternal[name] = "require('" + name + "')";
});
Object.keys(pkg.devDependencies).filter(function (v) { return !v.match(/@types/); }).forEach(function (name) {
nodeExternal[name] = "require('" + name + "')";
});
@ndunks
ndunks / email-getnada.spec.ts
Created June 27, 2019 15:13
Getnada email client API for browser with typescript implementation
// Jasmine Standalone testing suite
import { GetnadaClient, ListResponse } from "./email-getnada";
(jasmine.getEnv() as any) .configure({random: false, oneFailurePerSpec: true, failFast: true});
let listResponse: ListResponse;
describe('Plugins testing getnada api client', () => {
const email = 'learner@getnada.com';
const api = new GetnadaClient(email);
@ndunks
ndunks / qemu-linux-host-to-guest-bridge.md
Created March 30, 2020 15:40
Qemu Linux setup host to guest network connection using bridge
sudo su
brctl addbr br0
ip addr add 192.168.3.100/24 dev br0
ip link set br0 up
[ -d /etc/qemu ] || mkdir /etc/qemu
touch /etc/qemu/bridge.conf
echo "allow br0" >> /etc/qemu/bridge.conf
@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 / 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 / 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 / ddns-update
Last active January 17, 2021 03:23
Namecheap DDNS Updater Bash Script
# make it executable `chmod +x ddns-update`
# move it path `mv ddns-update /usr/bin/`
# setup cronjob for every 15 minutes `crontab -e`
# */15 * * * * ddns-update >/dev/null 2>&1
# dont forget to change your own domain & password
# uncomment if you want internet connection check before running
#while ! ping -c 1 -W 1 8.8.8.8; do
# echo "DDNS-UPDATE: Waiting internet connection.."
# sleep 2
@ndunks
ndunks / Modem 4G Cyborg
Last active February 18, 2021 15:59
Configuring 4G LTE Modem Cyborg Telkomsel Flash in Linux
# UDEV RULES
ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="92fe", RUN+="/usr/sbin/usb_modeswitch -v 05c6 -p 92fe -K"
ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyUSB1", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9201", SYMLINK+="modem"
# IF No ttyUSBX found
sudo modprobe usbserial
echo 05c6 9201 | sudo tee /sys/bus/usb-serial/drivers/generic/new_id
@ndunks
ndunks / debian-10-minial-graphical.md
Last active February 20, 2021 14:55
based on Debian 10 Netinstall Minimal Desktop

sudo qemu-system-x86_64 -enable-kvm -smp 4 -m 2G -drive file=/dev/sdc,format=raw -serial mon:stdio -cdrom debian-10.8.0-amd64-netinst.iso -boot d

Packages

apt install --no-install-recommends xorg
apt install lightdm openbox chromium

Disable tty2-6

@ndunks
ndunks / smsd
Last active March 2, 2021 08:03
Gammu SMS Daemon usb_modeswitch helper with Cyborg Mobile Broadband E488 4G LTE USB Stick (Telkomsel Flash)
#!/sbin/openrc-run
# Gammu SMS Daemon usb_modeswitch helper with Cyborg Mobile Broadband E488 4G LTE USB Stick (Telkomsel Flash)
retry="60"
pidfile="/var/run/$RC_SVCNAME.pid"
command="/usr/bin/gammu-smsd"
command_args="-d -p /var/run/$RC_SVCNAME.pid -c /etc/gammurc"
#command_background=true
#procname="gammu-smsd"
depend() {