Skip to content

Instantly share code, notes, and snippets.

View kyob's full-sized avatar

Łukasz Kopiszka kyob

View GitHub Profile
PATH=$PATH:/my/path
or
PATH=/my/path:$PATH
@kyob
kyob / README-Template.md
Created December 5, 2019 13:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kyob
kyob / genieacs-pending-tasks.txt
Created November 15, 2019 09:28
GenieACS pending tasks
# curl -i 'http://localhost:7557/tasks/?query=%7B%22device%22%3A%22F48CEB-Router-QXNN1J1004416%22%7D'
HTTP/1.1 200 OK
GenieACS-Version: 1.2.0-beta.0+20190829073154
Content-Type: application/json
total: 35
Date: Fri, 15 Nov 2019 09:26:23 GMT
Connection: keep-alive
Transfer-Encoding: chunked
# 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