Skip to content

Instantly share code, notes, and snippets.

View umardx's full-sized avatar
🏠
Working from home

Umar Nawawi umardx

🏠
Working from home
View GitHub Profile
#!/bin/sh
set -e
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo add-apt-repository -y ppa:chris-lea/redis-server
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo apt-get -qq update

Stable Version

1- Install Dependensi Package.

apt-get install -y checkinstall build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev sudo unzip redis-server mongodb libsqlite3-dev curl joe tmux

2- Compile dan Install Ruby 2.3.4 # Ref : https://www.ruby-lang.org/en/downloads/

cd /opt
// ┌∩┐(◣_◢)┌∩┐
int Lane1[] = {13,12,11}; // Lane 1 Red, Yellow and Green
int Lane2[] = {10,9,8}; // Lane 2 Red, Yellow and Green
int Lane3[] = {7,6,5}; // Lane 3 Red, Yellow and Green
int Lane4[] = {4,3,2}; // Lane 4 Red, Yellow and Green
void setup()
{
for (int i = 0; i < 3; i++)
@umardx
umardx / WiFi-Monit.sh
Created April 5, 2017 01:37
Script checks to see if WiFi has a network IP and if not then restart WiFi.
#!/bin/bash
##################################################################
#
# Purpose:
#
# Script checks to see if WiFi has a network IP and if not
# restart WiFi
#
# Uses a lock file which prevents the script from running more
# than one at a time. If lockfile is old, it removes it
@umardx
umardx / Openvswitch LTS in CentOS 7.md
Last active December 6, 2022 13:50
Installation Openvswitch LTS in CentOS 7

Based on this post: https://n40lab.wordpress.com/2016/03/02/openvswitch-lts-in-centos-7 The most recent release from the LTS series: http://openvswitch.org/releases/openvswitch-2.5.4.tar.gz

Instructions:

As the root user let’s install some packages:

yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool python-twisted-core python-zope-interface PyQt4 desktop-file-utils libcap-ng-devel groff checkpolicy selinux-policy-devel
#!/bin/bash
# Install script for GenieACS
# Ubuntu Server 14.04
echo ">>>>> Install nodejs and build tools"
sudo apt update
sudo apt -y install nodejs-legacy npm build-essential
echo ">>>>> Install Redis server"
sudo apt -y install redis-server

WiFi Setting

root# cat /etc/wpa_supplicant/wpa_supplicant.conf
country=ID
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid=""
    psk=""
 psk=WPA-PSK

Define a custom option space for tr069 options

    option space tr069;
    option tr069.acs-server-url code 1 = text;
    option tr069.provisioning-code code 2 = text;

And then within the scope where you would like to assign the options

Let's take a real, I have 2 NIC eth0 (public) 167.205.3.4/24, eth1 (private) 172.30.3.0/24, and tun0 (VPN) 10.8.0.1/24 connected. To perform NAT source base IP Address on eth1 to tun0 and let eth0 as usual, I used source policy routing.

The local table:

root@reverse:~# ip route list table local
broadcast 10.8.0.0 dev tun0  proto kernel  scope link  src 10.8.0.2
local 10.8.0.2 dev tun0  proto kernel  scope host  src 10.8.0.2
broadcast 10.8.0.255 dev tun0  proto kernel  scope link  src 10.8.0.2
broadcast 127.0.0.0 dev lo  proto kernel  scope link  src 127.0.0.1

ESP8266 WiFi Control Relay 👍

Hardware

  1. ESP8266 WiFi Module ( or NodeMCU )
  2. 4-Channel Relay Board. ( Active High )
  3. OLED Display0

Wiring

Wiring Diagram