Skip to content

Instantly share code, notes, and snippets.

View Stanislasss's full-sized avatar
🐺

Thomas Wolf Stanislasss

🐺
View GitHub Profile
@Stanislasss
Stanislasss / README.md
Created January 21, 2022 08:17 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@Stanislasss
Stanislasss / verbose-grpc-csharp.txt
Created November 11, 2020 16:17
how to get proper debug level for GRPC on Csharp
Environment.SetEnvironmentVariable("GRPC_VERBOSITY", "DEBUG");
Environment.SetEnvironmentVariable("GRPC_TRACE", "connectivity_state");
@Stanislasss
Stanislasss / daemonset-docker-login.yaml
Created October 29, 2020 16:57
daemonset-docker-login from K8S
apiVersion: apps/v1
kind: Daemonset
metadata:
name: docker-init
spec:
replicas: 1
template:
metadata:
name: worker
labels:
@Stanislasss
Stanislasss / tpc-chat-server-client.go
Created October 16, 2020 08:54
tiny example of a chat server and client code in Go. (Need to check why not 4096 bytes messages somehow break on windows)
package main
import (
"bufio"
"flag"
"fmt"
"net"
"os"
"strings"
)
@Stanislasss
Stanislasss / get-ec2-publicip-all-region-parallel.go
Created October 8, 2020 12:26
Get list of publicip for ec2 instances for all region with parallel scraping for all regions
// Get list of instance with filter running in parallel for each region
package main
import (
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"net/url"
"runtime"
"sync"
"github.com/aws/aws-sdk-go/aws"
@Stanislasss
Stanislasss / aws-sdk-assume-role.go
Created October 2, 2020 11:55
To save yourself an hour of search on figuring how to assume a role
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sts"
"math/rand"
)
$NodesList = [Environment]::GetEnvironmentVariable('NODES_LIST', 'User').Split(",")
$NodesList | ForEach-Object {
# Generate cached credentials for RDP session
cmdkey.exe /generic:$_ /user:MYDOMAIN\MYUSER /pass:"MYPASSWORD"
write-Output "Activating node $_ through RDP session..."
$app = Start-Process -FilePath C:\Windows\System32\mstsc.exe -ArgumentList "/v:$_" -PassThru
Start-Sleep -s 60
# Deleting cached credentials for security purpose
cmdkey.exe /del:$_
$app | Stop-Process
@Stanislasss
Stanislasss / ipa.tf
Created September 18, 2018 15:48 — forked from justmiles/ipa.tf
Deploy FreeIPA in AWS using Terraform
# Notes:
# You'll need to update any references to 'module.vpc' with your VPC's info (subnets, security groups, etc)
# If you define your subnets as a map, this will deploy different replicas across availabity zones. Note
# that the master and first replica will be in the same AZ.
#
# Look through the 'connection' fields and update with your bastion_host/key combos
#
# Number of IPA Replica(s) to deploy
variable "ipa_replicas" {