Skip to content

Instantly share code, notes, and snippets.

View ctmcisco's full-sized avatar
🏠
Working from home

Francisco Navarro ctmcisco

🏠
Working from home
View GitHub Profile
@dnburgess
dnburgess / gist:e00fc05a567f278828ff72b3e35ed3cc
Last active October 17, 2023 16:36
DB Tech Media Server Setup
---
version: "2"
services:
emby:
image: linuxserver/emby
container_name: emby
environment:
- PUID=998
- PGID=100
- TZ=America/Denver
@JustinGrote
JustinGrote / Watch-AzLog.ps1
Last active June 2, 2023 08:31
Be Notified when something changes in Azure
using namespace Microsoft.Azure.Commands.Insights.OutputClasses
$ErrorActionPreference = 'Stop'
[PSEventDataNoDetails]$lastEvent = Get-AzActivityLog -MaxRecord 1 -StartTime (Get-Date).AddDays(-89) -WarningAction SilentlyContinue
if (-not $lastEvent) {throw [NotImplementedException]'You have an empty activity log!'}
while ($true) {
Write-Verbose "Waiting for new events..."
while (-not $newEvent) {
Write-Verbose "No new event detected after $($lastEvent.EventTimestamp.ToLocalTime()), waiting for changes..."
@steviecoaster
steviecoaster / InternalizePackageIcons.ps1
Last active December 17, 2020 19:34
Internalize package icons for packages created with Chocolatey's Package Internalizer
<#
.SYNOPSIS
Internalize package icons for internalized packages
.EXAMPLE
$params = @{
InternalizerDownloadPath = 'C:\internalized\download\'
IconRepository = 'http://nexus.fabrikam.com:8081/repository/icons/'
PackageRepository = 'http://nexus.fabrikam.com:8081/repository/choco/'
}
@brettmillerb
brettmillerb / setup.sh
Last active April 9, 2021 19:55
New Mac Setup
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
echo "Updating homebrew..."
brew update
@dnburgess
dnburgess / gist:fdcaf27280e031fe88dd2fb9728649f6
Created October 28, 2020 22:49
DB Tech NextCloud on Pi 4
version: '2'
volumes:
nextcloud:
db:
services:
db:
image: yobasystems/alpine-mariadb:latest
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
@alexverboon
alexverboon / DeviceNetworkInfo.kql
Created October 25, 2020 11:02
DeviceNetworkInfo
// Query for Microsoft Defender 365 - exploring devicenetwork info. Identify Wi-Fi hotspots, DHCP servers, DNS servers etc.
DeviceNetworkInfo
| where Timestamp > ago (30d)
// | where DeviceName contains "ADD YOUR COMPUTERNAME HERE"
| where NetworkAdapterStatus contains "Up"
| extend NetworkName = tostring(parse_json(ConnectedNetworks)[0].Name)
| extend Description = tostring(parse_json(ConnectedNetworks)[0].Description)
| extend IsConnectedToInternet = tostring(parse_json(ConnectedNetworks)[0].IsConnectedToInternet)
| extend Category = tostring(parse_json(ConnectedNetworks)[0].Category)
| extend Dns1 = tostring(parse_json(DnsAddresses)[0])
@jdhitsolutions
jdhitsolutions / settings.json
Last active May 15, 2022 05:13
My Windows Terminal settings file.
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
@dbird03
dbird03 / PowerShell FizzBuzz Test.ps1
Created October 14, 2020 16:01
PowerShell FizzBuzz Test (David C. Bird solution)
<#
PowerShell FizzBuzz Test
.ASSIGNMENT
Write a program that prints the numbers from 1 to 100.
But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.
For numbers which are multiples of both three and five print “FizzBuzz”.
.SOLUTION
Author: David C. Bird
$parameters = @{
Key = 'F7'
BriefDescription = 'ShowMatchingHistoryOcgv'
LongDescription = 'Show Matching History using Out-ConsoleGridView'
ScriptBlock = {
param($key, $arg) # The arguments are ignored in this example
$line = $null
$cursor = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
$history = [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems().CommandLine | Select-Object -Unique
@awakecoding
awakecoding / Get-Netstat.ps1
Created September 26, 2020 02:51
PowerShell netstat wrapper
function Get-Netstat
{
$netstat = Get-Command -Name 'netstat' -ErrorAction SilentlyContinue
if (-Not $netstat) {
Write-Warning "netstat command not available"
return ,@()
}