Skip to content

Instantly share code, notes, and snippets.

YenLeidong yenleidong

Block or report user

Report or block yenleidong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yenleidong
yenleidong / gist:be678080078d24bebce2
Created Dec 11, 2014
Blogger, Put ALL External To Target_Blank
View gist:be678080078d24bebce2
<!-- ALL External To _Blank, Put on above </head> -->
<script type='text/javascript'>
$(document).ready(function() {
$("a[href^='http://']").each(
function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr('target', '_blank');
}
}
);
@yenleidong
yenleidong / gist:32119aae58d399523934
Last active Aug 29, 2015
Mark Packet Ping dan DNS
View gist:32119aae58d399523934
#Lokal 192.168.8.0/24
/ ip firewall mangle
add action=mark-connection chain=prerouting comment="--> ping" \
new-connection-mark=icmp-c protocol=icmp src-address=192.168.8.0/24
add action=mark-packet chain=prerouting connection-mark=icmp-c \
new-packet-mark=icmp-p
add action=change-dscp chain=prerouting packet-mark=icmp-p
add action=mark-connection chain=prerouting comment="--> dns" dst-port=53 \
new-connection-mark=dns-c protocol=tcp src-address=192.168.8.0/24
add action=mark-connection chain=prerouting dst-port=53 new-connection-mark=\
View gist:b3a08e8e62b866e022b2
/ip fi nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
View gist:28007317d370394b9acb
/ip route
add check-gateway=ping dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=route-to-isp1 distance=1
add check-gateway=ping dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=route-to-isp1 distance=2
add check-gateway=ping dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=route-to-isp2 distance=1
add check-gateway=ping dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=route-to-isp2 distance=2
View gist:23988568bb20fc285719
/ip fi mangle
add action=mark-connection chain=input comment=LB disabled=no dst-address-list=\
!speedy2 in-interface=ether1 new-connection-mark=speedy1_conn \
passthrough=yes src-address-type=""
add action=mark-connection chain=input disabled=no dst-address-list=!speedy1 \
dst-address-type="" in-interface=ether2 new-connection-mark=\
speedy2_conn passthrough=yes
add action=mark-routing chain=output connection-mark=speedy2_conn disabled=no \
new-routing-mark=to_speedy2 passthrough=yes
View gist:eb476ddb9123d7019a5b
/tool netwatch
add disabled=no down-script="Squid OFF" host=192.168.7.250 interval=1m timeout=1s up-script="Squid ON"
@yenleidong
yenleidong / gist:fadab3ab6f42b8e650fe
Last active Aug 29, 2015
mikrotik_add_script_squid_netwatch
View gist:fadab3ab6f42b8e650fe
/script
add name="Squid ON" policy=ftp,reboot,read,write,policy,test,winbox,password source=\
":log info \"Squid ON, Enabling NAT Redirect\"\r\
\n/ip firewall nat set [find comment=Redirect_Ke_Squid] disable=no"
add name="Squid OFF" policy=ftp,reboot,read,write,policy,test,winbox,password source=\
":log info \"Squid OFF, Disabling NAT Redirecti\"\r\
\n/ip firewall nat set [find comment=Redirect_Ke_Squid] disable=yes"
View gist:2476bfac9a1b60917e09
/*! http://tinynav.viljamis.com v1.1 by @viljamis */
(function(a,i,g){a.fn.tinyNav=function(j){var b=a.extend({active:"selected",header:"",label:""},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,f=".l_"+d,e=a("<select/>").attr("id",d).addClass("tinynav "+d);if(h.is("ul,ol")){""!==b.header&&e.append(a("<option/>").text(b.header));var c="";h.addClass("l_"+d).find("a").each(function(){c+='<option value="'+a(this).attr("href")+'">';var b;for(b=0;b<a(this).parents("ul, ol").length-1;b++)c+="- ";c+=a(this).text()+"</option>"});e.append(c);
b.header||e.find(":eq("+a(f+" li").index(a(f+" li."+b.active))+")").attr("selected",!0);e.change(function(){i.location.href=a(this).val()});a(f).after(e);b.label&&e.before(a("<label/>").attr("for",d).addClass("tinynav_label "+d+"_label").append(b.label))}})}})(jQuery,this,0);
View gist:9b4535502d6816274b9b
#contoh file yang Imutabilitas
chattr +i foldergue
#atau
chattr +i filegue
You can’t perform that action at this time.