Skip to content

Instantly share code, notes, and snippets.

View kyob's full-sized avatar

kyob

View GitHub Profile
# jan/16/2019 11:20:26 by RouterOS 6.43.8
# software id = 5S5F-0ISV
#
# model = 951G-2HnD
/interface ethernet
set [ find default-name=ether1 ] comment=UPLINK speed=100Mbps
set [ find default-name=ether2 ] comment=NET speed=100Mbps
set [ find default-name=ether3 ] comment=NET speed=100Mbps
set [ find default-name=ether4 ] comment=TV speed=100Mbps
set [ find default-name=ether5 ] comment=PROBE speed=100Mbps
<style>
div.counter-container {
color: #333;
text-align: center;
background-color: #ffd54f;
padding: 1em;
maring: 1em;
}
h1.counter {
# show counters interface ethernet 1/0/28
eth1/0/28 counters
rxHCTotalPkts : 2000990451
txHCTotalPkts : 140111769
rxHCUnicastPkts : 315903239
txHCUnicastPkts : 140016860
rxHCMulticastPkts : 1685054808
txHCMulticastPkts : 72747
rxHCBroadcastPkts : 32403
@kyob
kyob / switches-dlink-dgs-1510.expect
Created September 3, 2018 13:12
DLINK DGS-1510 save output of "show unit" then extract all serial numbers
<?php
//SELECT `id`, `pin` FROM `customersview` WHERE `ssn` != '' AND `deleted` = '0' AND `email` != '' ORDER BY `id`
//echo htmlentities($row['_message']);
$mysqli_remote = new mysqli("remote_host", "user", "pass", "db");
$mysqli_local = new mysqli("localhost", "user", "pass", "db");
/* check connection */
#!/bin/bash
cmd="${0##*/}"
usage() {
cat >&2 <<EOI
usage: $cmd [ -h ]
Output column definitions:
cpu # of the cpu
@kyob
kyob / bonding-primary-reselect.sh
Created July 14, 2018 07:20
Force to set prefered nic for bonding. It can be useful when we mix 1G and 10G in bonding to two switches.
#!/bin/bash
exec 1> >(logger -s -t $(basename $0)) 2>&1
# VLAN 12 LAN
SLAVE_INTERFACE="eth6"
BONDING_INTERFACE="bond0"
echo -$SLAVE_INTERFACE > /sys/class/net/$BONDING_INTERFACE/bonding/slaves
echo +$SLAVE_INTERFACE > /sys/class/net/$BONDING_INTERFACE/bonding/slaves
@kyob
kyob / smarty-smart-debug.tpl
Created May 23, 2018 11:58
smarty debug highlights
{"<?php\n\$data =\n"|@cat:{$variable|@var_export:true|@cat:";\n?>"}|@highlight_string:true}
echo "/ip firewall filter" ; whois -h whois.radb.net -- '-i origin AS32934' | grep '^route:' | sort -n | uniq | awk '{print "add action=drop chain=forward comment=Facebook dst-address="$2}'
echo "/ipv6 firewall filter" ; whois -h whois.radb.net -- '-i origin AS32934' | grep '^route6:' | sort -n | uniq | awk '{print "add action=drop chain=forward comment=Facebook dst-address="$2}'
@kyob
kyob / jpegoptim-recursively.txt
Created June 23, 2017 10:41
Recursively optimze jpg starting from current directory.
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;