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() { |
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/sh | |
if [ "$#" = "0" ]; then | |
echo "missing hosts" | |
exit 1 | |
fi | |
for host in $@; do | |
inet=`dig +short a $host` | |
inet6=`dig +short aaaa $host` |
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 python | |
from subprocess import Popen, PIPE | |
def read_var(name): | |
args = ["sysrc", "-n", "-i", name] | |
process = Popen(args, stdout=PIPE, stderr=PIPE) | |
stdout, stderr = process.communicate() | |
if 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
package main | |
import ( | |
"net" | |
) | |
// Calculate a subnet | |
func (network *net.IPNet) IPSubnet(size int, offset int) *net.IPNet { | |
var maskLen int | |
ip := network.IP |
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/sh -e | |
# use at your own risk! | |
# `fetch` can be replaced by curl or wget | |
cd /tmp/ | |
fetch http://www.pcengines.ch/file/apu140908.zip | |
unzip apu140908.zip | |
env ASSUME_ALWAYS_YES=YES pkg install flashrom | |
flashrom --programmer internal -w apu140908.rom -c "MX25L1605A/MX25L1606E" |
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 python | |
# -*- coding: utf-8 -*- | |
import csv | |
import json | |
import re | |
features = [] | |
colors = { | |
"versorgt": "2c8537", |
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 ruby | |
require 'capybara' | |
require 'capybara/poltergeist' | |
Capybara.default_max_wait_time = 5 | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app) | |
end |
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
--- | |
- hosts: all | |
environment: | |
LC_ALL: C | |
LANG: C | |
tasks: | |
- name: Update APT package cache | |
apt: update_cache=yes cache_valid_time=600 |
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
# Sample configuration file for an installation using pc-sysinstall | |
installMode=fresh | |
installInteractive=no | |
# Set if we are installing via optical, USB, or FTP | |
installType=FreeBSD | |
installMedium=usb | |
# List our components to install | |
installComponents=ports |
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
uci del network.port2 | |
uci del network.port3 | |
uci del network.port4 | |
uci del network.port5 | |
uci del network.port2_vlan | |
uci del network.port3_vlan | |
uci del network.port4_vlan | |
uci del network.port5_vlan | |
uci del network.office_vlan | |
uci set network.wan.ifname=eth0.2 |