Skip to content

Instantly share code, notes, and snippets.

[[email protected] Mertokondo Kebumen] > /ip firewall mangle export
# apr/05/2015 13:12:09 by RouterOS 6.25
#
/ip firewall mangle
add action=mark-connection chain=prerouting in-interface=wan new-connection-mark=wan01_conn
add action=mark-connection chain=prerouting in-interface=wan-02 new-connection-mark=wan02_conn
add action=mark-routing chain=output connection-mark=wan01_conn new-routing-mark=to_wan01
add action=mark-routing chain=output connection-mark=wan02_conn new-routing-mark=to_wan02
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=local new-connection-mark=wan01_conn per-connection-classifier=\
both-addresses-and-ports:2/0
@mb00g
mb00g / low-level-nexenta.md
Last active November 22, 2019 06:55
Low Level Nexenta
nmc@san-dal:/$ option expert_mode=1
nmc@san-dal:/$ !bash
You are about to enter the Unix ("raw") shell and execute low-level Unix command(s). Warning: using low-level Unix commands is not recommended! Execute? Yes
root@san-dal:/volumes#
@mb00g
mb00g / nginx-conf.md
Last active November 22, 2019 06:57
nginx.conf

Pada file /etc/nginx/nginx.conf

user                       nginx;
worker_processes           1;
worker_rlimit_nofile       5120;
 
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
 
@mb00g
mb00g / vhost-nginx.md
Last active November 22, 2019 06:59
vhost nginx

Contoh, misalnya untuk domain blog.fadjar.name yang menggunakan CMS WordPress

server {
	listen       0.0.0.0:80;
	server_name  blog.fadjar.name www.blog.fadjar.name;
	access_log  /var/log/nginx/blog.fadjar.name.access.log  main;
 
location / {
@mb00g
mb00g / export-import-mysql.md
Last active November 22, 2019 07:14
export import mysql

EXPORT

mysqldump -Q -- databases nama_db > file_db.sql

IMPORT

mysql> create database nama_db;
mysql> create user 'nama_user'@'localhost' IDENTIFIED BY 'password_user';
@mb00g
mb00g / bash_profile.md
Last active November 22, 2019 07:17
bash profile

Saat SSH menggunakan terminal keluar error

perl: warning: Please check that your locale settings:
LC_ALL = “En_US”,
LANG = (unset) are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).

Solusinya adalah menambahkan di dalam file ~/.bash_profile baris berikut

@mb00g
mb00g / wget_multi.md
Last active November 22, 2019 07:19
wget multi url
@mb00g
mb00g / ttl_bind.md
Last active November 22, 2019 07:29
update ttl dns bind

Masuk ke /var/named

Jalankan

for zone in *.db; do grep -q xxx.xxx.xxx.xxx $zone && echo "mengubah $zone..." && sed -i 's/14400\(\s*IN\s*A\)/222\1/' $zone; done; rndc reload

Isi xxx.xxx.xxx.xxx dengan IP address server yang di update.

@mb00g
mb00g / ct_iptables_modules
Created May 16, 2015 02:40
ct iptablaes modules
#!/bin/bash
modprobe ipt_conntrack
modprobe ipt_LOG
modprobe ipt_owner
modprobe ipt_state
modprobe ip_conntrack_ftp
modprobe ipt_recent
modprobe xt_connlimit
@mb00g
mb00g / ctid_iptables_conf
Created May 16, 2015 02:41
ctid conf iptables
IPTABLES="ipt_REDIRECT ipt_owner ipt_recent iptable_filter iptable_mangle ipt_limit ipt_multiport ipt_tos ipt_TOS ipt_REJECT ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_LOG ipt_length ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_conntrack ipt_state ipt_helper iptable_nat ip_nat_ftp ip_nat_irc xt_connlimit"