Skip to content

Instantly share code, notes, and snippets.

Nick Vissari nickadam

  • Elkridge, MD
Block or report user

Report or block nickadam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nickadam
nickadam / install_docker-ce.sh
Created Jul 31, 2019
Install docker-ce Ubuntu
View install_docker-ce.sh
#!/bin/bash
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
View List-Acls.ps1
function List-Acls {
param (
$Path,
$Depth
)
$Depth = $Depth - 1
Get-ChildItem $Path | ForEach-Object{
$FullName = $_.FullName
$FilePath = $_.FullName -replace "^[^$]+\$\\"
$FileOrFolder = "File"
@nickadam
nickadam / copy_docker_secret.sh
Created Jun 12, 2019
Copy a docker swarm secret between two clusters
View copy_docker_secret.sh
#!/usr/bin/env bash
SRC="$1"
DST="$2"
SECRET="$3"
SLEEP=3
secret=$(ssh $1 "docker service create --restart-condition=none --name copy_secret --secret $3 -d alpine cat /run/secrets/$3 >/dev/null; sleep $SLEEP; docker service logs --raw copy_secret; docker service rm copy_secret>/dev/null")
# https://stackoverflow.com/questions/1251999/how-can-i-replace-a-newline-n-using-sed
secret=$(echo "$secret" | sed ':a;N;$!ba;s/\n/\\n/g' | sed ':a;N;$!ba;s/ /\\ /g')
@nickadam
nickadam / my-minio.yml
Last active Jul 22, 2019
minio cluster
View my-minio.yml
version: '3.5'
services:
minio1:
image: minio/minio:RELEASE.2019-07-17T22-54-12Z
hostname: minio1
volumes:
- minio1-data:/export
ports:
- target: 9000
published: 9009
@nickadam
nickadam / Remove-MFA-ps1
Created Apr 8, 2019
Remove MFA from UPN
View Remove-MFA-ps1
Connect-MsolService
Set-MsolUser -UserPrincipalName {upn} -StrongAuthenticationRequirements @()
@nickadam
nickadam / Change-MACAddress.ps1
Created Apr 2, 2019
Change MAC Address Windows
View Change-MACAddress.ps1
# credit to http://www.isolation.se/change-mac-address-with-powershell-of-a-wireless-adapter/
function random-mac {
$mac = "02"
while ($mac.length -lt 12)
{
$mac += "{0:X}" -f $(get-random -min 0 -max 16)
}
$Delimiter = "-"
for ($i = 0 ; $i -le 10 ; $i += 2)
@nickadam
nickadam / Change_MAC_Address.md
Last active Apr 2, 2019
Change MAC Address macOS
View Change_MAC_Address.md

generate random mac

openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'

apply it

sudo ifconfig en0 ether 34:f1:77:82:ce:be

@nickadam
nickadam / docker-compose.yml
Last active Mar 25, 2019
Active-Passive Redis Cluster
View docker-compose.yml
version: '3.5'
services:
master:
image: redis:5
command: ["redis-server", "--appendonly", "yes"]
volumes:
- db:/data
ports:
- target: 6379
published: 6379
@nickadam
nickadam / Get-ForwardRules.ps1
Last active Apr 8, 2019
Get all users forwardto or redirectto inbox rules
View Get-ForwardRules.ps1
# evidently there is an entirely different area in o365 where you can do the same thing as an inbox rule but it's not an inbox rule
# Get-Mailbox -ResultSize Unlimited | select WindowsEmailAddress,AccountDisabled,DeliverToMailboxAndForward,ForwardingAddress,ForwardingSmtpAddress | Export-Csv -NoTypeInformation Forward.csv
# get msol creds for reconnecting
$creds = Get-Credential
# First get a list of all users from on prem AD so it doesn't time out
Get-ADUser -Properties emailaddress -Filter {(Enabled -eq $True) -and (ProxyAddresses -like 'SMTP*')} | Export-Csv -NoTypeInformation Users.csv
# write the header
View keybase.md

Keybase proof

I hereby claim:

  • I am nickadam on github.
  • I am nickadam (https://keybase.io/nickadam) on keybase.
  • I have a public key ASDWDGJwwBh6pkFBalte_kaTbu5k6yTgBUTDVxe8hn44gAo

To claim this, I am signing this object:

You can’t perform that action at this time.