Skip to content

Instantly share code, notes, and snippets.

View alexandervantrijffel's full-sized avatar
💻

Alexander van Trijffel alexandervantrijffel

💻
View GitHub Profile
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;
# 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]
# 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
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"
@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.
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
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
# 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)

De looptijd van integratietesten die b.v. het aanmaken van een database of het publiceren van events testen kan flink uiteenlopen afhankelijk van het aantal testen dat parallel uitgevoerd wordt of de snelheid van de (build) machine. Met Polly kan je heel elegant op een circuit breaker achtige wijze de asserts uitvoeren.

Voorbeeld:

[TestCase("T001")]  
[TestCase("ImportedDataSummary")]  
public void Has_created_tables(string tableName)  
{  
 // Check if T001 table and retry for up to 26 seconds with different intervals 
# allow for remote connections
remove bind 127.0.0.1 from /etc/myssql/mysql.conf.d
create users as 'myuser'@'%'
#setup .mylogin.cnf for auto login
mysql_config_editor set --host=localhost --user=lexremote --port=3306 --password
#dump database
mysqldump DATABASENAME > FILENAME.sql -p