Skip to content

Instantly share code, notes, and snippets.

View lennartvdd's full-sized avatar

Lennart van den Dool lennartvdd

  • Circular IT Group, DigitalDeploy
  • Utrecht
View GitHub Profile
@lennartvdd
lennartvdd / poeditor-pull-fix-commit.sh
Created August 17, 2018 13:26
POEditor fix escaped characters
#!/bin/bash
#
# Copyright (c) Lennies.IT 2018
#
info() {
echo "--- $1 ---"
}
@lennartvdd
lennartvdd / create-certs.sh
Created August 18, 2017 07:31
Easily create CA, Client and Server certifcates
#!/usr/bin/env bash
# Copyright: Lennart van den Dool <lennartvdd at gmail dot com>
# All rights reserved.
# License: FreeBSD
# Settings
# ----
@lennartvdd
lennartvdd / enable_rdp.bat
Created July 25, 2017 08:43
Remotely Enable RDP
@echo off
SET computer=\\COMPUTERNAME
REM sc %computer% config remoteregistry start= manual
REM sc %computer% start remoteregistry
REM psexec %computer% net start RemoteRegistry
psexec %computer% reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0
psexec %computer% netsh advfirewall firewall set service remoteadmin enable
psexec %computer% netsh advfirewall firewall set service remotedesktop enable
@lennartvdd
lennartvdd / sqlbuilder_dimension_categories.php
Last active April 28, 2017 11:51
Simple Stand-alone SQL Query Builder written in PHP to help categorize objects by their dimensions
<?php
/*
Author: Lennart van den Dool
Date: 2017-03-10
Purpose: Query Builder categorize objects by dimension (assuming cubiods)
If you run this script in the command line it will output some SQL that might help you get what you want.
This assumes the cuboid rotation is limited to the 6 permutations of l x b x h .
@lennartvdd
lennartvdd / example-asana-api.php
Last active April 28, 2017 11:49
Asana Api usage example (for beginners)
<?php
//config
$accessToken = "";
$url = "https://app.asana.com/api/1.0/users/me";
//script
$headers = [
"Authorization: Bearer $accessToken",
];
@lennartvdd
lennartvdd / randomize_files.ps1
Created August 18, 2016 08:52
Randomize Filenames - Useful for randomly presenting images using the default slideshow applications available in Windows
#Modify variables as required
$srcFolder = "in"
$destFolder = "out"
Get-ChildItem -File $srcFolder | ForEach-Object {
$newFile = $destFolder + "\$(Get-Random)-$($_.Name).jpg"
Copy-Item $_.FullName $newFile
}
@lennartvdd
lennartvdd / iscsi_start_automatic.sh
Created February 2, 2016 08:56
Linux iSCSI: Change startup type from manual to automatic on all nodes, AND the default config
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user to run this script." 2>&1
exit 1
fi
find /etc/iscsi/ -type f | xargs grep -l "startup\s*=\s*manual" | xargs sed -i 's/\(startup\s*=\s*\)manual/\1automatic/'
@lennartvdd
lennartvdd / ubuntu-nginx-installer.sh
Last active January 1, 2021 11:11
Ubuntu Nginx installer (Static files only)
#!/bin/bash
# This script does the following things
# - update apt respositories
# - Install:
# - nginx
# - git
# - Create a GIT User
# - Set up GIT bare repo
# - Set up GIT working directories for nginx
@lennartvdd
lennartvdd / .bashrc
Created October 16, 2015 15:01
.bashrc file for GIT bash on Windows
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@lennartvdd
lennartvdd / NAV Config Mode.bat
Created August 19, 2015 10:11
Microsoft Dynamics NAV - Configuration Mode
@echo off
setlocal
set /p profile_id=Enter the User Profile to configure:%=%
cd C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client
Microsoft.Dynamics.Nav.Client.exe -configure -profile:%profile_id%
endlocal