Skip to content

Instantly share code, notes, and snippets.

View bnjdg's full-sized avatar

Benj Dag bnjdg

  • UP COE HPC Team / ERDT
  • Quezon City
View GitHub Profile
@bnjdg
bnjdg / tmux.conf
Last active February 25, 2017 08:46
my tmux conf for mosh
#tmux2.1
new-session
set -g mouse on
set -g history-limit 30000
@bnjdg
bnjdg / dmz-pmsat.sh
Last active May 23, 2017 07:24
replaces routes on specified servers
#!/bin/bash
printf "%s" "$GREEN"
route delete default
route delete default
route delete default
route delete default
route add default gw 192.168.27.3
sed -i '/route delete default/d' /etc/rc.local
sed -i '/route add default gw 192.168.27.252.*/d' /etc/rc.local
sed -i '/route add default gw 192.168.27.253.*/d' /etc/rc.local
@bnjdg
bnjdg / 0_reuse_code.js
Created June 6, 2017 23:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bnjdg
bnjdg / iptables-web.sh
Created July 2, 2017 18:53
Iptables for web servers
#!/bin/sh
DEF_IF=$(route | grep '^default' | grep -o '[^ ]*$')
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -X
iptables -X -t nat
iptables -F
iptables -F -t nat
@bnjdg
bnjdg / geonode-install.sh
Last active February 27, 2018 13:39
geonode setup
#!/bin/bash
apt-get update
apt-get install -y software-properties-common
apt-get install -y python-virtualenv python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk
apt-get install -y build-essential openssh-server gettext nano vim unzip zip patch git-core postfix
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-add-repository -y ppa:ubuntugis && apt-get update && apt-get upgrade
apt-add-repository -y ppa:ubuntugis/ppa && apt-get update && apt-get upgrade
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://ph.archive.ubuntu.com/ubuntu/ artful main restricted universe multiverse
deb-src http://ph.archive.ubuntu.com/ubuntu/ artful main restricted universe multiverse
###### Ubuntu Update Repos
@bnjdg
bnjdg / setup.sh
Created March 28, 2018 17:20
create lxd ct with static ip
Create the network config
vi network-config.yml
version: 1
config:
- type: physical
name: eth0
subnets:
- type: static
ipv4: true
@bnjdg
bnjdg / openvpn-in-lxd.txt
Last active June 14, 2018 10:51 — forked from wastrachan/openvpn-in-lxd.txt
OpenVPN in LXD Container
# On the host
=============
lxc profile set default raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'
lxc profile device add default tun unix-char path=/dev/net/tun
# In the container
==================
1. mknod /dev/net/tun c 10 200
@bnjdg
bnjdg / README.md
Last active September 19, 2021 10:15
XMRig tmux systemd service files
@bnjdg
bnjdg / conf.sh
Created June 17, 2018 19:10 — forked from CHEF-KOCH/conf.sh
OpenVPN + DNSCrypt and Unbound traffic (Debian)
# Unbound configuration file for Debian.
# See the unbound.conf(5) man page.
# See /usr/share/doc/unbound/examples/unbound.conf for a commented
# reference config file.
server:
# The following line will configure unbound to perform cryptographic
# DNSSEC validation using the root trust anchor.
auto-trust-anchor-file: "/var/lib/unbound/root.key"
server: