Skip to content

Instantly share code, notes, and snippets.

View travelhawk's full-sized avatar

Michael Falk travelhawk

  • Humatects GmbH
  • Oldenburg
View GitHub Profile
@travelhawk
travelhawk / nginx-domain-proxy.md
Last active November 21, 2023 13:25
Nginx proxy based on domains

Redirecting Based on Host Name

Let say you want to host example1.com, example2.com, and example3.com on your machine, respectively to localhost:8080, localhost:8181, and localhost:8282.

Note: Since you don't have access to a DNS server, you should add domain name entries to your /etc/hosts (you can't do this on CDF machines):

... 127.0.0.1 example1.com example2.com example3.com ... To proxy eaxmple1.com we can't use the location part of the default server. Instead we need to add another server section with a server_name set to our virtual host (e.g., example1.com, ...), and then a simple location section that tells nginx how to proxy the requests:

@travelhawk
travelhawk / README.md
Last active October 18, 2023 14:55
Use vagrant and ansible on Windows (WSL2)

Use vagrant and ansible on Windows (WSL2)

Making vagrant and ansible work together with virtualbox as a provider is not well documented across the documentations. Ansible's control node doesn't work on Windows. However, it works on WSL which make the installation of ansible and vagrant on WSL necessary and the access from WSL to virtualbox which is still running under the Windows host.

Requirements

  • Windows 10
  • Virtualbox
  • WSL2
@travelhawk
travelhawk / old-gulpfile.js
Created February 24, 2023 13:13 — forked from RichardBray/old-gulpfile.js
Old Gulpfile for article/tutorial moving from Gulp to Webpack
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-ruby-sass'),
minifyCSS = require('gulp-minify-css'),
concat = require('gulp-concat'),
webserver = require('gulp-webserver'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
minifyHTML = require('gulp-minify-html'),
imagemin = require('gulp-imagemin'),
@travelhawk
travelhawk / DenyDisruptingAWS
Created November 14, 2022 14:29
Service Control Policy (SCP) to restrict important services and configurations, e.g. CloudTrail etc.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"organizations:LeaveOrganization",
"guardduty:DeleteDetector",
"guardduty:DisassociateFromMasterAccount",
"guardduty:UpdateDetector",

Enable USB Debugging with custom ROM

Bypassing USB Debugging off and FRP Google Account lock enabled on a Samsung XCover4.

Model: Samsung XCover4

Tools

@travelhawk
travelhawk / code_conventions.md
Last active May 9, 2022 09:36
Code Convention for Unity using C#

Code Conventions C#

Formating

Namespaces & Classes

Casing: PascalCase

public namespace Company.Product.Module
{
 public class SomeClass : MonoBehaviour

Merging Unity3D scenes

Unity3D scenes and prefabs cannot not be merged automatically by default. Working on one scene / prefab at the same time can cause issues when a merge conflict happens. Usually that means that one version needs to be discarded or the files need to be merged manually (which isn't easy).

However, Unity provides the UnityYAMLMerge tool with each Unity installation to merge scenes and prefabs semantically for manual setup. This is also called Smart Merge. The tool can be accessed from the command line and is also available to third-party version control software like Git, etc. To setup the smart merge for Git, follow the following steps.

How to Setup

@travelhawk
travelhawk / microsoft365_tweaks.md
Last active September 21, 2022 10:20
Microsoft 365 tweaks

Microsoft 365

Outlook

Change Filesize Limit

The default file size limit for Outlook data file (.ost) is 50GB. To change file size limit to 100 GB, add following keys to the registry usind cmd or regedit.

REG ADD HKCU\Software\Microsoft\Office\16.0\Outlook\PST /v WarnLargeFileSize /t REG_DWORD /d 102400 /f
REG ADD HKCU\Software\Microsoft\Office\16.0\Outlook\PST /v MaxLargeFileSize /t REG_DWORD /d 107520 /f
@travelhawk
travelhawk / gitlab-ci.yml
Created March 4, 2022 18:03
Build, publish and deploy docker images
stages:
- publish
- deploy
variables:
TAG_LATEST: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:latest
TAG_COMMIT: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA
publish:
image: docker:latest
@travelhawk
travelhawk / #powershell_aliases.md
Last active February 28, 2022 11:59
Aliases for Powershell Terminal on Windows

Powershell Aliases

Add Aliases in Windows

  1. Open Windows Terminal
  2. Type notepad $profile
    • If doesn't exists, creates file in ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
  3. Add Aliases in file
    • Set-Alias <Name> <Command>