Skip to content

Instantly share code, notes, and snippets.

View sdaaish's full-sized avatar
😀
Spending to much time with my Emacs config.

Stig Dahl sdaaish

😀
Spending to much time with my Emacs config.
View GitHub Profile
@sdaaish
sdaaish / keybase.md
Created September 19, 2017 13:18
Keybase storage for sdaaish

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@sdaaish
sdaaish / create-dotfiles-links.ps1
Last active February 13, 2018 22:22
Create links to dotfiles
@sdaaish
sdaaish / Install-ADModule.ps1
Last active February 18, 2018 20:41
Powershell script examples
#requires -RunAsAdministrator
<#-----------------------------------------------------------------------------
Ashley McGlone, Microsoft Premier Field Engineer
http://aka.ms/goateepfe
February 2016
Install-ADModule
For Windows 10 performs the following tasks:
- Downloads and installs Windows 10 RSAT for the appropriate system architecture
- Enables the RSAT AD PowerShell feature
@sdaaish
sdaaish / 2.csv
Last active April 9, 2019 20:21
Powershell SMB examples
System Ip Type Other
dev.idg.se 1.1.1.1 Ubuntu Development
hr.dn.se 2.2.2.2 Debian Human Resources
www.gp.se 3.3.3.3 FreeBsd Front web site
@sdaaish
sdaaish / hello.py
Last active March 17, 2018 22:28
Python stuff
# Some python testing
## Checkout Corey Schafer on Youtube
print ("hello world")
message = 'Hello world'
print(message)
print(len(message))
print(message[0:5])
@sdaaish
sdaaish / Get-Systems.ps1
Last active March 26, 2018 20:58
Powershell CSV example
$csv = Import-CSV .\data.csv
$linux = $csv|where { $_.Owner -like "Linus" }
$linux
$csv
foreach ($a in $csv) {
$b += $a.Owner + ","
}
#$b
@sdaaish
sdaaish / get-mailforward.ps1
Created June 14, 2018 13:09
List email forwarding O365
$Mailboxes = Get-Mailbox -ResultSize Unlimited
ForEach ($Mailbox in $Mailboxes)
{
$MailboxWithRule = Get-InboxRule -Mailbox $Mailbox.Alias |
where
{
($_.RedirectTo -ne $null) -or ($_.ForwardTo -ne $null) -or ($_.ForwardAsAttachmentTo -ne $null)
}
if ($MailboxWithRule -ne $Null)
{
# Copy from https://raw.githubusercontent.com/drwetter/testssl.sh/2.9dev/Dockerfile
FROM alpine:latest
RUN apk update && \
apk upgrade && \
apk add bash procps drill git coreutils && \
apk add --no-cache curl
RUN addgroup testssl && \
adduser -G testssl -g "testssl user" -s /bin/bash -D testssl && \
@sdaaish
sdaaish / .gitignore
Last active April 1, 2019 13:32
testssl.sh testenvironment
!*.log
@sdaaish
sdaaish / 2.csv
Last active April 10, 2019 07:15
dev.idg.se 1.1.1.1 Ubuntu Development
hr.dn.se 2.2.2.2 Debian Human Resources
www.gp.se 3.3.3.3 FreeBsd Front web site