Skip to content

Instantly share code, notes, and snippets.

View janikvonrotz's full-sized avatar
:octocat:

Janik von Rotz janikvonrotz

:octocat:
View GitHub Profile
@janikvonrotz
janikvonrotz / SSH and network hardening.md
Created March 4, 2014 13:38
Ubuntu: SSH and network hardening #SSH #Ubuntu #Markdown

Requirements

  • Ubuntu server

Instructions

SSH

Change the default ssh port and disable root login

@janikvonrotz
janikvonrotz / SQL Cheat Sheet.md
Last active April 18, 2024 18:08
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types

@janikvonrotz
janikvonrotz / Delete-AllCmdKeyCredentials.ps1
Created December 6, 2013 07:39
PowerShell: Delete all cmdkey credentials #PowerShell #Windows
cmdkey /list | ForEach-Object{if($_ -like "*Ziel:*"){cmdkey /del:($_ -replace " ","" -replace "Ziel:","")}}
@janikvonrotz
janikvonrotz / Get-AllSPLists.ps1
Last active February 28, 2024 12:19
PowerShell: Get SharePoint Site Collection Objects #PowerShell #SharePoint
Get-SPsite -Limit all | %{
$_ | Get-SPWeb -Limit all | %{
$_.Lists | %{
$_
}
}
}
@janikvonrotz
janikvonrotz / Convert-DirectoryToJson.ps1
Last active February 21, 2024 21:28
Convert-DirectoryToJson #PowerShell #JSON
function Get-RandomHexString {
param($count)
$hex = '012345679ABCDEF'.ToCharArray()
$array = foreach($number in 1..$count ){ $hex | Get-Random}
return (($array) -join "").ToString().ToLower()
}
function Get-WikiType{
param($file)
@janikvonrotz
janikvonrotz / Install Nginx.md
Last active February 7, 2024 21:57
Ubuntu: Install Nginx #Nginx #Markdown

Introduction

Nginx (pronounced "engine-ex") can be used as an open source reverse proxy server, as well as a load balancer, HTTP cache, and not to forget a fast and powerful web server.

Requirements

  • Ubuntu server

Installation

@janikvonrotz
janikvonrotz / Garmin Connect Weight.md
Created April 16, 2020 18:04
Garmin Connect Weight
@janikvonrotz
janikvonrotz / Update-SPTokenLifetime.ps1
Created April 3, 2014 07:48
PowerShell: Update SharePoint Token Lifetime #SharePoint #PowerShell
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
# update SharePoint cache token lifetime
$SPContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$SPContentService.TokenTimeout = (New-TimeSpan -minutes 5)
$SPContentService.Update()
# udpate SharePoint claims token lifetime
@janikvonrotz
janikvonrotz / Send-MailReportOfUncheckedSharePointFiles.ps1
Last active October 26, 2023 07:19
PowerShell: Send Mail Report Of Unchecked SharePoint Files #SharePoint #PowerShell #EmbededPost
<#
$Metadata = @{
Title = "Send Mail Report Of Unchecked SharePoint Files"
Filename = "Send-MailReportOfUncheckedSharePointFiles.ps1"
Description = ""
Tags = ""
Project = "powershell, script, sharepoint, report, unchecked, file"
Author = "Janik von Rotz"
AuthorContact = "http://janikvonrotz.ch"
CreateDate = "2013-11-14"
@janikvonrotz
janikvonrotz / Archive-ADUserAndMailbox.ps1
Last active October 26, 2023 07:14
PowerShell: Archive ActiveDirectory and Mailbox #Exchange #ActiveDirectory #PowerShell #EmbededPost
<#
$Metadata = @{
Title = "Archive User ActiveDirectory and Mailbox"
Filename = "Archive-ADUserAndMailbox.ps1"
Description = ""
Tags = "powershell, activedirectory, archive, user, mailbox"
Project = ""
Author = "Janik von Rotz"
AuthorContact = "http://janikvonrotz.ch"
CreateDate = "2013-10-21"