Skip to content

Instantly share code, notes, and snippets.

@mehdichaouch
mehdichaouch / google-dorks
Created March 22, 2020 17:54 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@ScottHutchinson
ScottHutchinson / install-vsix.ps1
Last active September 14, 2024 17:01
PowerShell scripts for batch installing Visual Studio extensions
# Based on http://nuts4.net/post/automated-download-and-installation-of-visual-studio-extensions-via-powershell
param([String] $PackageName)
$ErrorActionPreference = "Stop"
$baseProtocol = "https:"
$baseHostName = "marketplace.visualstudio.com"
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=$($PackageName)"
@jdhitsolutions
jdhitsolutions / Register-PSCoreHelpTask.ps1
Created April 15, 2019 14:44
Create a PowerShell Scheduled job to update help monthly on a Windows based platform running PowerShell Core
#requires -module ScheduledTasks
#update PowerShell help via a Scheduled Task
$cred = Get-Credential "$env:USERDOMAIN\$env:USERNAME"
# for Windows PowerShell
# $action = New-ScheduledTaskAction -execute powershell.exe -argument '-noprofile -command "&{Update-Help -force}"'
$actionparams = @{
execute = 'pwsh.exe'
argument = '-nologo -noprofile -noninteractive -command "&{Update-Help -force}"'
@f3l3gy
f3l3gy / download-latest-release.ps1
Last active November 8, 2023 07:12 — forked from MarkTiedemann/download-latest-release.ps1
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name
@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
# This Sets up WinRM Remote PowerShell with delegated authentication for an existing trusted SSL cert
########################################################################
################ Do this on the Server
########################################################################
#Enable WinRM on a VM - with on-demand certificate creation
Function RemotePowerShell {
$process = 'cmd.exe'
$arguments = '/c winrm invoke restore winrm/config @{}'
@MarkTiedemann
MarkTiedemann / download-latest-release.ps1
Last active September 11, 2024 06:01
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@PurpleBooth
PurpleBooth / README-Template.md
Last active October 18, 2024 06:00
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

ESXi (Free) Management

Exploring management options for an ESXi server in a home/lab environment.

  • It's so fucking rad that ESXi free doesn't provide a web interface. /sarcasm
  • Having a dedicated Windows VM for ESXi management is suck.
  • Running vSphere Client in Wine/Crossover requires hacks to install and doesn't work correctly.
  • How much does it cost to get a license for a lab environment?
  • Can we use the DCUI (Direct Console User Interface) without a license? (Answer: YES, via a directly console, over SSH, but we can only do very basic things)
  • Can we use the CLI/SDK/API tools? (Answer: PARTIALLY, Without a license it's locked down to read-only)
  • Can we SSH to the bare-metal host and use command line tools for manaagement? (Answer: YES, but we have to enable SSH)