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 / Install-GitLFS.md
Created October 28, 2015 17:22
Ubuntu: Install Git LFS #git #ubuntu #Markdown
@janikvonrotz
janikvonrotz / Install-Python.md
Last active October 22, 2015 06:18
Ubuntu: Install Python #Ubuntu #Python

Introduction

Configure Python 3 and install pip. Pip allows us to easily manage any Python 3 package we would like to have.

Requirements

Installation

@janikvonrotz
janikvonrotz / Get-RandomPassword.ps1
Last active August 3, 2022 20:20
PowerShell: Get Random Password #PowerShell
function Get-RandomPassword{
$numbers = 1..9
$consonants = "b","c","d","f","g","h","k","l","m","n","p","r","s","t","v","w","x","z"
$nopeletters = "j","q","y"
$vocals = "a","e","i","o","u"
$dotsandstuff = ",",".","-"
$nopedotsandstuff = ";",":","_"
return (Get-Random $consonants).ToString().ToUpper() +
@janikvonrotz
janikvonrotz / Restore-DuplicityFileExample.sh
Last active August 29, 2015 16:15
Ubuntu: Restore Duplicity File Example #Ubuntu #Duplicity
sudo /usr/local/src/duplicity-backup/duplicity-backup.sh -c /etc/duplicity-backup/duplicity-backup.conf --restore-file etc/nginx/conf.d/sebastianvonrotz.ch.conf ~/sebastianvonrotz.ch.conf -t 2015-08-17
sudo /usr/local/src/duplicity-backup/duplicity-backup.sh -c /etc/duplicity-backup/duplicity-backup.conf --list-current-files -t 2015-08-17
@janikvonrotz
janikvonrotz / Install Koken website.md
Last active February 18, 2023 19:57
Ubuntu: Install Koken website #Koken #Markdown
@janikvonrotz
janikvonrotz / Compare-ADUserGroupMembership.ps1
Last active April 13, 2019 11:25
Compare-ADUserGroupMembership #PowerShell #AcitveDirectory
Import-Module ActiveDirectory
$user1 = "userRef"
$user2 = "userDif"
$members1 = Get-ADPrincipalGroupMembership -Identity $user1 | Select-Object name
$members2 = Get-ADPrincipalGroupMembership -Identity $user2 | Select-Object name
$result = Compare-Object -ReferenceObject $members1 -DifferenceObject $members2 -Property name
@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 / Generate CSR (Certificate Signing Request) with OpenSSL.md
Created July 25, 2015 06:59
Generate CSR (Certificate Signing Request) with OpenSSL #OpenSSL #Markdown

Define the following attributes, you have to set them in the wizard when generating the CSR.

  • Common Name (the domain name certificate should be issued for)
  • Country
  • State (or province)
  • Locality (or city)
  • Organization
  • Organizational Unit (Department)
  • E-mail address
@janikvonrotz
janikvonrotz / Install Lets Encrypt and create a free SSL certificate.md
Last active August 29, 2023 10:05
Install Let's Encrypt and create a free SSL certificate #OpenSSL #Markdown

Introduction

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. Let’s Encrypt is a service provided by the Internet Security Research Group (ISRG). This guide shows you how you can obtain a free SSL certificate.

Requirements

@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