start new:
tmux
start new with session name:
tmux new -s myname
| import "hash" | |
| private rule Macho | |
| { | |
| meta: | |
| description = "private rule to match Mach-O binaries" | |
| condition: | |
| uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca | |
| } |
| #!/usr/bin/env python | |
| import re | |
| import os | |
| import sys | |
| from subprocess import check_output, check_call, call, STDOUT | |
| BLUE = '\033[94m' | |
| GRAY = '\033[90m' | |
| ENDC = '\033[0m' |
| Function Get-LocalAdmins { | |
| <# | |
| .SYNOPSIS | |
| Gets the members of the local administrators of the computer | |
| and outputs the result to a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS | |
| System.String. Get-LocalAdmins can accept a string value to | |
| determine the Computers parameter. |
| # Your Configuration | |
| Configuration ExchangeService { | |
| # Parameters | |
| # Accepts a string value computername or defaults to localhost | |
| Param([string[]]$ComputerName = "localhost") | |
| # Target Node | |
| Node $ComputerName { |
| # Step 1 Install xPSDesiredStateConfiguration | |
| Install-Module -Name xPSDesiredStateConfiguration | |
| # Step 2 | |
| # Create the Pull Server. | |
| Configuration CreatePullServer { | |
| param ( | |
| [string[]]$ComputerName = 'localhost' | |
| ) |
| # NoGo | |
| Get-Command -Module xPSDesiredStateConfiguration | |
| # NoGo | |
| xService | Get-Member | |
| # Shows all DSC Resources currently installed in PS ModulePath | |
| # Access PSModulepath | |
| # cd env: | |
| # dir | Where-Object Name -eq PSModulePath |
| # Example No Hash table or Calculated Properties | |
| Get-WmiObject -Class WIN32_volume -ComputerName localhost -Filter 'drivetype = 3' | | |
| Select-Object -Property PScomputerName, | |
| DriveLetter, | |
| Label, | |
| FreeSpace | |
| # Example using a Hash table | |
| Get-WmiObject -Class WIN32_volume -ComputerName localhost -Filter 'drivetype = 3' | | |
| Select-Object -Property PScomputerName, |
| # Selecting | |
| #Default | |
| Get-Process | |
| # All Properties | |
| Get-Process | Select-Object -Property * | Out-GridView | |
| # Sorting | |
| # Changes the default sorting order for Get-Process | |
| Get-Process | Sort-Object CPU |
| #1 | |
| Get-Service | Where-object { $_.Status -eq 'Running' -and $_.name -like 's*'} | |
| #2 | |
| Get-Service -name s*| Where-object { $_.Status -eq 'Running'} | |
| #1 | |
| Measure-Command -Expression {Get-Service | Where-object { $_.Status -eq 'Running' -and $_.name -like 's*'}} | |
| #2 | |
| Measure-Command -Expression {Get-Service -name s*| Where-object { $_.Status -eq 'Running'}} |