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 | |
| #script to change all desktop backgrounds | |
| echo -n “Drag and drop an image file here then press ‘return’ or | |
| press ‘control-c’ to cancel…” | |
| read -e WLPR; | |
| function change_wallpaper | |
| { | |
| defaults write com.apple.desktop Background “{default = {ImageFilePath=’$WLPR’; };}”; killall Dock | |
| } | |
| change_wallpaper |
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 | |
| # Fedora64 Ubuntu64 Ubuntu32 Fedora32 | |
| OS='Ubuntu64' | |
| DEB=('Ubuntu' 'elementary OS' 'Lubuntu') | |
| RPM=('Fedora' 'Centos') | |
| DIST='Lubuntu' | |
| SCRAPELINK='https://plex.tv/downloads?channel=plexpass' | |
| SCRAPESTR='data-event-action="Linux" data-event-category="Download-Media-Server' | |
| declare -A array | |
| declare $(curl -sk $SCRAPELINK |grep -i "$SCRAPESTR" | awk 'BEGIN { FS = "\"" } { print "array["$10"]="$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
| New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate" | |
| New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate\AU" | |
| Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUServer -Value "http://wsus.domain.com:8530" -Type String -force | |
| Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUStatusServer -Value "http://wsus.domain.co:8530" -Type String -force | |
| Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate\AU" -Name UseWUServer -Value "1" -Type DWORD -force |
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
| # commit docker image (container then repo/image:tag) | |
| docker commit centos jollygoodhorsepower/centos-ps:latest | |
| # stop all containers: | |
| docker kill $(docker ps -q) | |
| # remove all containers | |
| docker rm $(docker ps -a -q) | |
| # remove all docker images |
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
| # Logparser | |
| ############### | |
| # Security Log | |
| ############### | |
| # Find Event id | |
| & 'C:\Program Files (x86)\Log Parser 2.2\LogParser.exe' -stats:OFF -i:EVT "SELECT * FROM 'Security.evtx' WHERE EventID = '5038'" |
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
| #Security log | |
| #============ | |
| #### | |
| #4624 - Logon & Logoff events successful | |
| #4625 - Logon unsucceful | |
| #### | |
| # Get usernames | |
| Get-WinEvent -path .\Security.evtx | Where {$_.id -eq "4624"} | Foreach {([xml]$_.ToXml()).GetElementsByTagName("Data").ItemOf(5)}| Select -ExpandProperty "#text" -Unique | |
| # Get domains |
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
| Rename-Item Function:\Prompt PoshGitPrompt -Force | |
| function Prompt() {if(Test-Path Function:\PrePoshGitPrompt){++$global:poshScope; New-Item function:\script:Write-host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) " -Force | Out-Null;$private:p = PrePoshGitPrompt; if(--$global:poshScope -eq 0) {Remove-Item function:\Write-Host -Force}}PoshGitPrompt} | |
| # Chocolatey profile | |
| $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
| if (Test-Path($ChocolateyProfile)) { | |
| Import-Module "$ChocolateyProfile" | |
| } | |
| # Docker Module |
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
| # Source: https://github.com/n8felton/Mac-OS-X-Scripts | |
| # Find an active network interface | |
| interface=$(route get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}') | |
| # If ${interface} wasn't set, we probably don't have an internet connection | |
| # Exit now because we're not going to talk to DNS like this. | |
| if [[ -z "${interface}" ]]; then | |
| exit 1 | |
| fi |
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 bash | |
| # See McAfee KBs: | |
| # https://kc.mcafee.com/corporate/index?page=content&id=KB88461 # Remove ENS for Mac (ENSM) | |
| # https://kc.mcafee.com/corporate/index?page=content&id=KB61125 # Remove McAfee Agent | |
| # Exit upon failed command | |
| # set -e |
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
| for i in 3des-cbc aes128-cbc aes128-ctr aes128-gcm@openssh.com aes192-cbc aes192-ctr aes256-cbc aes256-ctr aes256-gcm@openssh.com arcfour arcfour128 arcfour256 blowfish-cbc cast128-cbc chacha20-poly1305@openssh.com rijndael-cbc@lysator.liu.se; do dd if=/dev/zero bs=1000000 count=1000 2> /dev/null | ssh -c $i localhost "(time -p cat) > /dev/null" 2>&1 | grep real | awk '{print "'$i': "1000 / $2" MB/s" }'; done |