Skip to content

Instantly share code, notes, and snippets.

View alexandervantrijffel's full-sized avatar
💻

Alexander van Trijffel alexandervantrijffel

💻
View GitHub Profile
# skip entry point and go directly to the shell with --entrypoint
docker run -it --rm --name goalpinebuild -v $(pwd)/../src:/in -v $(pwd)/../dockerleanalpineproduction:/out -v $(pwd):/work -e BUILDARGS="-ldflags \"-extldflags '-static'\" -o /out/ps-737migration-be" --entrypoint=/bin/sh goalpinebuild
# in docker run, ALWAYS PUT THE IMAGE NAME AT THE END, arguments after the image name are discarded!
sudo docker run --network=bridge -p 80:80 gowebapp
# update a single service in a docker compose composition
docker-compose up -d --no-deps --build <service_name>
# install docker-compose.yml as container with [dcsg](https://github.com/andreaskoch/dcsg/blob/develop/installer.go)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,00,00,3a,00,00,00,00,00
Leermomenten Kubernetes + Azure:
Webapp in docker op poort 80 hosten en dan in kube onderbrengen op azure werkt niet!
Wel als je een hogere poort gebruikt, 5000 bv
Backend port van de cluster ip poort wordt door azure niet goed ingevuld bij de load balancer als je een nieuwe service aanmaakt. Je moet dan handmatig de backend poort invullen.
kubectl get nodes -o yaml
# open a shell to a container
kubectl exec -it <PODNAME> -- /bin/sh
@alexandervantrijffel
alexandervantrijffel / prevent error description for event id
Created June 24, 2017 20:30
Prevent The description for Event ID could not be found" message in log events
I got this error after creating an event source under the Application Log from the command line using "EventCreate". This command creates a new key under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
If you look at the Key that's been created (e.g. SourceTest) there will be a string value calledEventMessageFile, which for me was set to %SystemRoot%\System32\EventCreate.exe.
Change this to c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll
Delete theCustomSource and TypesSupported values.
Trackpoint + extra mouse buttons + mousepad all work with this line in /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash psmouse.proto=bare"
sudo update-grud
However.. Mouse gestures don't work anymore with this setting.
Section "InputClass"
Identifier "nathan touchpad catchall"
MatchIsTouchpad "on"
# find files of extension .go on mac os
git ls-files -- "*.go"
# diff between commits with meld
git difftool 47981fcf..49128f10 -d
# diff between branches with meld
git difftool -d OTHERBRANCH
$ git commit --fixup=a0b1c2d3 # Perform the commit to fix broken a0b1c2d3
$ git rebase -i --autosquash a0b1c2d3~1 # Now merge fixup commit into broken commit
# install
# add apt registry: https://packagecloud.io/EventStore/EventStore-OSS/install
apt install eventstore-oss
#if you need eventstore to run on a port < 1024
sudo setcap CAP_NET_BIND_SERVICE=+eip $(which eventstored)
# edit /etc/systemd/system/eventstore.service
# add `RestartSec=5` to section [Service]
namespace EventStoreClient
{
public static class EventStoreConnectionExtensions
{
static RestClient NewRestClient(IOptions<AppSettings> appSettings)
{
var set = appSettings.Value;
var client = new RestClient($"http://{set.EventStoreIPAddress}:{set.EventStoreWebAdminPort}");
client.Authenticator = new HttpBasicAuthenticator(set.EventStoreUsername, set.EventStorePassword);
return client;
#!/bin/bash
declare -i ID
ID=`xinput list | grep -Eo 'Generic Mouse\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
echo id is $ID
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
then
xinput disable $ID
@alexandervantrijffel
alexandervantrijffel / go getting started.md
Last active August 31, 2021 14:56
Getting started with Go development with VS code

Development environment configuration

  • Install the latest version of Go
  • Setup VS code
  • Go with vscode overview
  • Install vscode-go plugin
  • Install go tools. Launch VS Code Quick Open (Ctrl+SHIFT+P), run the command go: install/update tools

Recommended guides: