Skip to content

Instantly share code, notes, and snippets.

Janik Vonrotz janikvonrotz

Block or report user

Report or block janikvonrotz

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
@janikvonrotz
janikvonrotz / helper.js
Last active Oct 17, 2016
Helper library for js projects #JavaScript #Meteor #Node
View helper.js
function concenateToPhrase(array, connectWord) {
var length = array.length;
var phrase = "";
array.map((item) => {
var index = array.indexOf(item);
// return word if theres is only one item
if(length == 1){
phrase = item;
@janikvonrotz
janikvonrotz / Configure Lets Encrypt auto renewal for certificates.md
Last active Feb 14, 2016
Configure Lets Encrypt auto renewal for certificates #Markdown #OpenSSL
View Configure Lets Encrypt auto renewal for certificates.md

This post is part of my Your own Virtual Private Server hosting solution project.
Get the latest version of this article here: https://gist.github.com/ddce334cd8ab21a40941.

Introduction

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. So far it works well and makes it easy to obtain a free certificate. Now the created certificates will expire withing 90 days. This post will show you how you can auto renew these certificates before they expire.

Requirements

@janikvonrotz
janikvonrotz / Favorite Books.md
Last active Jun 6, 2016
List of my favorite books #JanikVonrotz
View Favorite Books.md

Frank Schätzing

  • Limit

Stephen King

  • The Dark Tower series
  • Under the Dome

Christopher Paolini

@janikvonrotz
janikvonrotz / Install-Python.md
Last active Oct 22, 2015
Ubuntu: Install Python #Ubuntu #Python
View Install-Python.md

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 Mar 13, 2017
PowerShell: Get Random Password #PowerShell
View Get-RandomPassword.ps1
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 Aug 29, 2015
Ubuntu: Restore Duplicity File Example #Ubuntu #Duplicity
View Restore-DuplicityFileExample.sh
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 Aug 31, 2015
Ubuntu: Install Koken website #Koken #Markdown
View Install Koken website.md
@janikvonrotz
janikvonrotz / Compare-ADUserGroupMembership.ps1
Last active Apr 13, 2019
Compare-ADUserGroupMembership #PowerShell #AcitveDirectory
View Compare-ADUserGroupMembership.ps1
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 Sep 22, 2019
Convert-DirectoryToJson #PowerShell #JSON
View Convert-DirectoryToJson.ps1
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)
You can’t perform that action at this time.