This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Script to read the ARP table from a KTI switch using SSH without password | |
import pexpect | |
import sys | |
from collections import defaultdict | |
res = defaultdict(list) | |
prompt = '\S+:/>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import pexpect | |
import sys | |
prompt = '\S+:/>' | |
s = pexpect.spawn("sshpass", ["-p",'', "ssh", "-l", "admin", "-oStrictHostKeyChecking=no", "-oKexAlgorithms=+diffie-hellman-group1-sha1", sys.argv[1]]) | |
s.expect(prompt) | |
s.send("mac dump\r\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"math" | |
"sync/atomic" | |
"time" | |
"github.com/influxdata/telegraf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Enable plugin unix_socket | |
command: mysql --defaults-file=/etc/mysql/debian.cnf -e "INSTALL PLUGIN unix_socket SONAME 'auth_socket'" | |
register: mysql_result | |
changed_when: mysql_result.rc == 0 | |
failed_when: mysql_result.rc != 0 and 'already installed' not in mysql_result.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Stores entries in a local SQLite database | |
until they have been processed by a submit function. | |
*/ | |
package journal | |
import ( | |
"database/sql" | |
_ "github.com/mattn/go-sqlite3" | |
"sync" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=================================================================== | |
MT7621 stage1 code 10:33:11 (ASIC) | |
CPU=50000000 HZ BUS=16666666 HZ | |
================================================================== | |
Change MPLL source from XTAL to CR... | |
do MEMPLL setting.. | |
MEMPLL Config : 0x11100000 | |
3PLL mode + External loopback | |
=== XTAL-40Mhz === DDR-1200Mhz === | |
PLL4 FB_DL: 0xc, 1/0 = 747/277 31000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
remote=$1 | |
options="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=15 -o ServerAliveInterval=10" | |
filename=gluon-ffhb-2016.1.5+breminale1-tp-link-tl-wdr3600-v1-sysupgrade.bin | |
scp $options /tmp/$filename "root@[$remote]:/tmp/" | |
ssh $options "root@$remote" "sysupgrade -n /tmp/$filename" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua5.2 | |
-- | |
-- apt install lua5.2 lua-socket | |
-- | |
local socket = require("socket") | |
local udp = assert(socket.udp()) | |
local data | |
udp:settimeout(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import re | |
import os | |
import sys | |
if len(sys.argv) != 2: | |
sys.stderr.write('device angeben!\n') | |
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ssh-multi.sh - a script to ssh multiple servers over multiple tmux panes | |
# usage: type tmux then from inside tmux type ssh-multi.sh HOST1 HOST2 ... HOSTN | |
# Muayyad Alsadi, D.Kovalov | |
# https://gist.github.com/muayyad-alsadi/bd25845776bb6b4185ba/ | |
# https://gist.github.com/dmytro/3984680 | |
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html | |
# Tested with Ubuntu 16.04 and tmux 2.1 | |
function error() { |