Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
@mark05e
mark05e / restart-synaptics-driver.bat
Created October 11, 2019 03:49
Batch script to restart Synaptics touchpad driver
:: Synaptics touchpad stops working randomly
:: reference - https://superuser.com/questions/504178/synaptics-touchpad-stops-working-randomly
taskkill -f -im syntpenh.exe
cd "C:\Program Files\Synaptics\SynTP"
start "" "syntpenh.exe"
timeout 2
exit
@mark05e
mark05e / 01-sbce-statcheck.sh
Last active December 15, 2024 14:40
Scripts for performing monitoring & alerting on Avaya SBCE v8.0. Intended to be run as cronjob.
# Script for monitoring some SBCE stats.
# Note: Requires root
now=$(date +"%Y-%m-%d %T")
me=`basename "$0"`
echo -e "Starting $me at $now \n\n"
# ref: https://support.avaya.com/public/index?page=content&id=PRCS100962&actp=LIST
# This command will show all the dynamic media flows opened on PCF.
@mark05e
mark05e / sbce-call-leg-count.sh
Created January 28, 2020 09:09
SBCE Call Leg Counter through log files
# Avaya SR# 1-15881456942
#
# Here is the way to check the call leg counter:
# 1. In GUI, go to Debugging under Device Specific Settings->Troubleshooting->Debugging, pick the SBC device, and under the subsystem logs, turn on both debug and Info for LOG_SUB_SIPCC (under process SSYNDI). Click save
# 2. Ssh into the primary SBC. login as root, Wait a few min to make sure some calls are made or terminated. Then go to /usr/local/ipcs/log/ss/logfiles/elog/SSYNDI
# 3. open the last log file using command: grep "created leg_count" SSYNDSSYNDIxxxxxxxxxxx
# EXAMPLE: INF#Call Leg Count-Del: 26994#[sip_call_leg.cpp:414] 2981723024 (null) (null) (null)
#
grep "created leg_count" `ls -tr /usr/local/ipcs/log/ss/logfiles/elog/SSYNDI/SSYNDI* | tail -n 1` | tail -1 | awk -F '#' '{print $2}' | awk -F 'leg_count ' '{print $2}'
@mark05e
mark05e / Powershell Parallel Execution
Created January 31, 2020 06:38
Some powershell projects that help with parallel execution
https://github.com/RamblingCookieMonster/Invoke-Parallel
https://github.com/proxb/PoshRSJob | https://github.com/MVKozlov/PoshRSJob
https://github.com/PaulHigin/PSThreadJob
https://github.com/sharpjs/PSConcurrent
https://github.com/codykonior/Jojoba
@mark05e
mark05e / win-dark-mode.cmd
Last active August 3, 2024 12:03
Enable dark/light mode in Windows 10 (tested on build 18363) through CLI. Make sure to update <<MODIFY_USERNAME_HERE>> with value from your registry.
REM **For Windows 10**
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0
powershell.exe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0
REM **For Office 2016**
powershell.exe Set-ItemProperty -Path HKCU:\Software\Microsoft\Office\16.0\Common -Name 'UI Theme' -Value 4
powershell.exe Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Common\Roaming\Identities\<<MODIFY_USERNAME_HERE>>\Settings\1186\{00000000-0000-0000-0000-000000000000}\PendingChanges' -Name 'Data' -Value ([byte[]](4, 0, 0, 0)) -Type Binary
REM ref: https://www.cloudappie.nl/change-theme-officeproplus-powershell/ for Office 2016
@mark05e
mark05e / MyPowershellSnippets.md
Last active February 29, 2020 17:17
My Powershell Snippets

XML to PSCustomObject

Function Convert-XMLtoPSObject {
    Param ( $XML )
    $Return = New-Object -TypeName PSCustomObject
    $xml |Get-Member -MemberType Property |Where-Object {$_.MemberType -EQ "Property"} |ForEach {
        IF ($_.Definition -Match "^\bstring\b.*$") {
            $Return | Add-Member -MemberType NoteProperty -Name $($_.Name) -Value $($XML.($_.Name))
 } ElseIf ($_.Definition -Match "^\System.Xml.XmlElement\b.*$") {
@mark05e
mark05e / getInstalledAppsFromRegistry-notes.md
Created February 29, 2020 12:09
Get list of all installed applications from registry in 32- or 64-bit Powershell

getInstalledAppsFromRegistry.ps1

Source: Technet Script Center

Example:

.\getInstalledAppsFromRegistry.ps1
$apps = Get-InstalledAppsFromRegistry
$apps | where {$_.DisplayName -like "*Firefox*"}
@mark05e
mark05e / zain-inet-scraper.ps1
Created March 9, 2020 04:28
Scrape internet usage from webpage and notify using telegram
###########################################################
# Zain Kuwait Prepaid Internet Usage notifier
# Mark | March 2020
# Requires: noti (https://github.com/variadico/noti)
###########################################################
#User modifiable variables
$url ='https://www.kw.zain.com/en/web/myzain'
$noti_exe = 'C:\MarkTools\noti.exe'
$noti_config = 'C:\MarkTools\.noti.yml'
@mark05e
mark05e / netgear-router-reboot.ps1
Last active November 2, 2023 02:34
NETGEAR Router DC112A reboot powershell script
#########################################################################
## NETGEAR Router DC112A reboot script
## Tested with Firmware: V1.0.0.18_1.0.60
## Mark 2020
#########################################################################
#-[Variables]------------------------------------------------------------
$user = 'admin'
$pass = 'admin'