Skip to content

Instantly share code, notes, and snippets.

#Collect the Data Stats from a MikroTik LTE Interface
#make the empty file
#/file print file="lteCount.txt"
{
#Get RX and TX data from LTE1 interface
:local counterRX [/interface get lte1 rx-byte]
:local counterTX [/interface get lte1 tx-byte]
@jazzbanzai
jazzbanzai / check_internet.sh
Last active July 15, 2023 14:55
Reboot VirginMedia Super Hub 2
#!/bin/bash
# Create a log file
logfile="/tmp/check_internet.log"
# Get the current time and date
now=$(date)
# Check if wlan0 is up
ifconfig wlan0 | grep -q "inet addr:"
@jazzbanzai
jazzbanzai / PremiumBondChecker.ps1
Created April 6, 2023 17:52
PowerShell code to check UK NS&I Premium Bonds wins based on Holders Number
# PowerShell code to check UK NS&I Premium Bonds wins based on Holders Number
# URL: https://www.nsandi.com/prize-checker
# Holders Number -- Replace with your holders number (not the same as your account number)
# This number has 10 or 9 digits, or 8 digits followed by a letter. You can find your holder’s number
# by logging in to our online service and checking your Premium Bonds account page.
$BondHoldersNumber = '83674004A' #random valid number
############
@jazzbanzai
jazzbanzai / TFLStatus.ps1
Last active August 5, 2022 10:51
TFL Line Status - Powershell
<#
Using the API documentation on the Transport for London website, write a PowerShell script that can return the:
*status of a given Tube line along with any reason for disruption.
*The script should be capable of providing both the current status of the line
*and the future status of the line, if a date range is supplied.
*The script should be capable of returning all Tube lines that are currently facing unplanned disruption.”
#>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#REF1: https://www.dell.com/support/kbdoc/en-in/000126566/windows-how-to-identify-your-dell-docking-station-using-powershell
Set-Location -Path C:\temp
$dellcabURL = 'https://downloads.dell.com/catalog/DellSDPCatalogPC.cab'
$fileName = $dellcabURL.Substring($dellcabURL.LastIndexOf('/') + 1)
#Download Dell Cab
Invoke-WebRequest -URI $dellcabURL -UseBasicParsing -OutFile "c:\temp\$fileName"
#Extact DellSDPCatalogPC.xml
& extrac32.exe "c:\temp\$fileName" DellSDPCatalogPC.xml /Y
#find the line (would be beettr ro pharse the XML)
$MSIregex = 'https:\/\/.*DSIA.*.msi'