This file contains hidden or 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 | |
| # This script will install network-manager-l2tp on linux distros from source. | |
| # Only instructions x86_64, per https://github.com/nm-l2tp/network-manager-l2tp | |
| # Untested everywhere (i.e. this is a rough draft) | |
| # Get the required files | |
| git clone https://github.com/nm-l2tp/network-manager-l2tp.git | |
| cd network-manager-l2tp | |
| git checkout 1.2.2 |
This file contains hidden or 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 | |
| #-*- coding:utf-8 -*- | |
| # Modified existing script for PyQt5 (https://stackoverflow.com/questions/14090353/) | |
| from PyQt5 import QtCore | |
| from PyQt5.QtWidgets import QWidget, QLineEdit, QPushButton, QHBoxLayout, \ | |
| QMainWindow, QApplication | |
| class widgetB(QWidget): | |
| procDone = QtCore.pyqtSignal(str) |
This file contains hidden or 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 | |
| tshark -r <YOUR_WIRELESS_CAPTURE> -T fields -e "radiotap.dbm_antsignal" -e "radiotap.dbm_antnoise" \ | |
| | awk '{ sum_signal += $1; sum_noise += $2; n++ } END { if (n > 0) print '\ | |
| '"\n802.11 Avgs (dbm)\n=================\nSignal: " sum_signal / n "\nNoise: " sum_noise / n ; }' |
This file contains hidden or 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
| # Built with Mint 17.3 based on Ubuntu 16.04 | |
| # Based on https://www.wireshark.org/docs/wsdg_html_chunked/ChSrcBuildFirstTime.html#_building_on_unix | |
| # With additional library installations found via trial and error | |
| # Install bcg729 (which is not installed by default) | |
| curl -L -O https://github.com/~/1.0.4.tar.gz | |
| tar xvzf 1.0.4.tar.gz | |
| cd bcg729-1.0.4 | |
| cmake | |
| make |
This file contains hidden or 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 | |
| # In response to https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14418 | |
| # First arg is filter, all other args are files | |
| # Usage: ./filter_combine.sh 'icmp' file1.pcap file2.pcap file3.pcap | |
| # Outputs `combined.pcapng` | |
| FILTER=$1 | |
| FILES=${@:2} | |
| i=0 | |
| TEMP_FILES=() |
This file contains hidden or 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 -*- | |
| """This program aims to provide tools to troubleshoot better | |
| NOTE: Default option is yes to continue troubleshooting. No is for steps if | |
| user has not done due diligence. | |
| Assuming that categories only need to be chosen at the beginning and from | |
| then on we can employ binary questions | |
| """ |
This file contains hidden or 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
| // Using code from http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html#ch5 | |
| // Using MBMS header bits from the pcap in wireshark bug#14875 | |
| // Expected output is 52 (0x34), which is the correct answer | |
| #include <stdio.h> | |
| int main(){ | |
| const int generator = 0x2f; | |
| int crc = 0; /* start with 0 so first byte can be 'xored' in */ | |
| // 0x10043b000000000000 aligned to 6 bits (from pcap) |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """Generator for Meraki API python module""" | |
| import requests | |
| import json | |
| import re | |
| api_key = '' | |
| base_url = 'https://api.meraki.com/api/v0/' | |
| # Should work for get | |
| function_text = """\ndef {0}({1}): |
This file contains hidden or 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
| # Compare Powershell hash tables using a helper function. | |
| # Usage: | |
| # PS> Import-Module ./compare_hash_tables.ps1 | |
| # PS> $hash1 = @{'1'='2'; '3'=@(@{'5'='8'; 'a'='b'},'7', 'c'); 'd'=@('e')} | |
| # PS> $hash2 = @{'1'='1'; '3'=@(@{'5'='9'},'6'); 'd'=@('e','f')} | |
| # PS> Compare-Hashes $hash1 $hash2 | |
| # | |
| # : hash['3'] : list[0] : hash['5'] : <-> | |
| # -> Expected '8' | |
| # -> Actually '9' |
This file contains hidden or 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
| # Evaluate a derivative of a single-variable function | |
| # Assume last argument is value/var and all others are function | |
| # Example: | |
| # $ julia derive.jl x^2 + x + 1 1 | |
| # > derivative at 1: | |
| # > 2.999999999960656 | |
| # $ julia derive.jl x^2 + x + 1 x | |
| # > derivative: | |
| # > 2 * 1 * x ^ (2 - 1) + 1 | |
| using Calculus |