Skip to content

Instantly share code, notes, and snippets.

View KennethEhmsen's full-sized avatar

Kenneth KennethEhmsen

  • Orange Design One
  • Denmark
  • X @Ehmsig
View GitHub Profile
<?php
/*
* Rename Woocommece Admin Menu
*/
add_action( 'admin_menu', 'rename_woocoomerce_wpse_100758', 999 );
function rename_woocoomerce_wpse_100758()
{
global $menu;
@KennethEhmsen
KennethEhmsen / onedrive-ubu.sh
Created October 31, 2018 12:57 — forked from glmdev/onedrive-ubu.sh
A bash script to setup OneDrive integration with GNOME on Ubuntu.
#!/bin/sh
# onedrive-ubu.sh
# A BASH script to set up OneDrive integration with GNOME on Ubuntu
# Copyright (C) 2018 Garrett Mills (garrett@glmdev.tech)
# This software is licensed under the MIT License.
# This sofware is provided without warranty or even any implied intent of purpose.
#
# OnedriveD: https://github.com/xybu/onedrived-dev
#
@KennethEhmsen
KennethEhmsen / #0_6rd.sh
Created March 27, 2019 16:48 — forked from paaland/#0_6rd.sh
Altibox w/ IPv6 on EdgeRouter PoE
#!/usr/bin/env sh
# https://kradalby.no/setting-up-6rd-on-my-linux-router.html
PREFIX=2a01:79c::
PREFIX_LENGTH=30
RELAY_PREFIX=213.167.115.92
RELAY_PREFIX_LENGTH=0
PUBLIC=$(curl http://canihazip.com/s)
ipv6calc --action 6rd_local_prefix --6rd_prefix $PREFIX/$PREFIX_LENGTH --6rd_relay_prefix $RELAY_PREFIX/$RELAY_PREFIX_LENGTH $PUBLIC
@KennethEhmsen
KennethEhmsen / codeable.io.conf
Created December 2, 2019 06:58 — forked from tomazzaman/codeable.io.conf
Codeable.io Nginx config
server {
include /home/webmaster/www/codeable.io.conf;
server_name codeable.io;
listen 443 ssl spdy default_server;
root /home/webmaster/www/codeable.io;
index index.php index.html;
error_log /var/log/nginx/codeable.io.error.log warn;
Title : "Vyos basic configuration"
Date : "25/07/2018"
Author : "Musha"
Reference : "http://soucy.org/vyos/UsingVyOSasaFirewall.pdf"
1) Configure network Interface eth0 (internet)
set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 description 'OUTSIDE'
2) Configure network interface eth1 (dmz)
#!/bin/vbash
# CONFIG
wan=dhcp
lan=10.10.10.1
lan_segment=10.10.10.0
lan_workstationip1=10.10.10.10
lan_workstationmac1=04-92-26-DA-58-A9
vpn_segment=10.10.15.0
domain=home.local
@KennethEhmsen
KennethEhmsen / Use-Impersonation.ps1
Created June 25, 2020 12:06 — forked from idavis/Use-Impersonation.ps1
Impersonate a user and execute a script block as that user
param( [ScriptBlock] $scriptBlock )
<#
.SYNOPSIS
Impersonates a user and executes a script block as that user. This is an interactive script
and a window will open in order to securely capture credentials.
.EXAMPLE
Use-Impersonation.ps1 {Get-ChildItem 'C:\' | Foreach { Write-Host $_.Name }}
This writes the contents of 'C:\' impersonating the user that is entered.
#>
@KennethEhmsen
KennethEhmsen / psCompress.ps1
Created July 8, 2020 08:51 — forked from marcgeld/psCompress.ps1
Powershell: Compress and decompress byte array
# Compress and decompress byte array
function Get-CompressedByteArray {
[CmdletBinding()]
Param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[byte[]] $byteArray = $(Throw("-byteArray is required"))
)
Process {
rm -r /etc/vmware/license.cfg
cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
/etc/init.d/vpxa restart
vim-cmd vimsvc/license --show | grep expirationDate
# see https://calvin.me/reset-esxi-evaluation-license/
#requires -Version 3.0
<#
.SYNOPSIS
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication.
.DESCRIPTION
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication. This report can be customized to report on Backup, Replication,