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
import sys | |
import xml.etree.ElementTree as ET | |
if len(sys.argv) < 2: | |
print "Usage \n\tpython "+ sys.argv[0]+ " file.xml" | |
exit() | |
else: | |
filename = sys.argv[1] | |
print "\nUsing file: "+filename+" \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
USER="myPcUser" | |
ID="ist1xxxxx@tecnico.ulisboa.pt" | |
INTERFACE="wifi0" | |
PC_MAC="12:34:56:78:90:AB" | |
CERT_PATH="/home/MY_CERT_PATH/.cacert.pem" | |
D="/etc/NetworkManager/system-connections/eduroam" | |
FPATH=$(echo "/tmp/"$(date | sha1sum | awk '{print $1}')) | |
iwlist $INTERFACE scan | grep '"eduroam"' -B5 | grep "Frequency:5" -A1 -B2 > $FPATH |
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
options hid_apple fnmode=2 |
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
rocommunity public | |
#Zpool Usage | |
extend .1.3.6.1.4.1.2021.88 zpool_name /bin/bash -c "sudo zpool list -H -o name" | |
extend .1.3.6.1.4.1.2021.88 zpool_snap /bin/bash -c "sudo zpool list -Ho name|for strzpool in `xargs`;do sudo zfs get -rHp -o value usedbysnapshots $strzpool|awk -F: '{sum+=$1} END{print sum}';done" | |
extend .1.3.6.1.4.1.2021.88 zpool_used /bin/bash -c "sudo zpool list -Ho name|xargs sudo zfs get -Hp -o value used" | |
extend .1.3.6.1.4.1.2021.88 zpool_data_used /bin/bash -c "sudo zpool list -Ho name|for strzpool in `xargs`;do snap=`sudo zfs get -rHp -o value usedbysnapshots $strzpool|awk -F: '{sum+=$1} END{print sum}'`;pool=`sudo zfs get -Hp -o value used $zpool`; echo $pool $snap|awk '{print (\$1-\$2);}';done" | |
extend .1.3.6.1.4.1.2021.88 zpool_available /bin/bash -c "sudo zpool list -Ho name|xargs sudo zfs get -Hp -o value available" | |
extend .1.3.6.1.4.1.2021.88 zpool_capacity /bin/bash -c "sudo zpool list -H -o capacity" | |
#ARC Usage |
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
import sys, getopt | |
help = "ovpn.py --host <host> --ca <capath> --crt <certpath> --key <keypath> [--port <port>, --proto <proto>, --options <optionspath>]" | |
template = """ | |
dev tun | |
port {{PORT}} | |
proto {{PROTO}} | |
remote {{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 python2.7 | |
"""Gets Temperature and Humidity values | |
from api.openweathermap.org using the api key""" | |
__author__ = "Artur Balanuta" | |
__version__ = "2.0.1" | |
__email__ = "arturb [at] andrew.cmu.edu" | |
import signal |
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 | |
openssl req -new -x509 -keyout yourpemfile.pem -out yourpemfile.pem -days 3650 -nodes |
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 | |
""" | |
Twisted SSL webserver with basic authentication using plain in-memory passwords. | |
The first argument is the path of the directory to serve; if not provided then the current folder is used ("."). | |
INSTALL DEPENDENCIES: | |
pip install twisted | |
pip install pyOpenSSL | |
pip install service_identity |
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
# ip:port to bind the UDP listener to (default: "0.0.0.0:1700") | |
UDP_BIND=127.0.0.1:1700 | |
# mqtt server (e.g. scheme://host:port where scheme is tcp, ssl or ws) (default: "tcp://127.0.0.1:1883") | |
MQTT_SERVER=tls://openchirp.andrew.cmu.edu:1883 | |
# mqtt prefix | |
MQTT_PREFIX="<your_openchirp_device_endpoint>" | |
# mqtt server username (optional) |
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
for i in `ssh -Q cipher`; do dd if=/dev/zero bs=1M count=300 2> /dev/null | ssh -c $i $USER@localhost "(time -p cat) > /dev/null" 2>&1 | grep real | awk '{print "'$i': "300 / $2" MB/s" }'; done | |
# /etc/ssh/ssh_config (or ~/.ssh/config) and sshd_config | |
Ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com | |
#https://turecki.net/content/getting-most-out-ssh-hardware-acceleration-tuning-aes-ni |
OlderNewer