Skip to content

Instantly share code, notes, and snippets.

View raphaelcarlosr's full-sized avatar
👨‍💻
Focusing

raphaelcarlosr.dev raphaelcarlosr

👨‍💻
Focusing
View GitHub Profile
@raphaelcarlosr
raphaelcarlosr / a-mongodb-replica-set-docker-compose-readme.md
Created October 29, 2022 22:15 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

@raphaelcarlosr
raphaelcarlosr / anthos-hub-k3s-demo.sh
Created October 7, 2022 02:57 — forked from mikesparr/anthos-hub-k3s-demo.sh
Demonstration on how to register non-Google Kubernetes clusters with Anthos Connect Hub
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-central1" # CHANGEME (OPT)
export GCP_ZONE="us-central1-a" # CHANGEME (OPT)
export NETWORK_NAME="default"
function Get-RdpLogonEvent
{
[CmdletBinding()]
param(
[Int32] $Last = 10
)
$RdpInteractiveLogons = Get-WinEvent -FilterHashtable @{
LogName='Security'
ProviderName='Microsoft-Windows-Security-Auditing'
@raphaelcarlosr
raphaelcarlosr / docker-compose.yml
Created September 5, 2022 20:13 — forked from thomasdarimont/docker-compose.yml
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@raphaelcarlosr
raphaelcarlosr / entity.service.ts
Created July 28, 2021 21:22 — forked from tryagaintmr/entity.service.ts
Firestore generic CRUD service
import { AngularFirestore } from '@angular/fire/firestore';
import { Injectable } from '@angular/core';
import { FirestoreService } from './firebase-generic.service';
@Injectable({
providedIn: 'root'
})
export class MyEntityService extends FirestoreService<IEntity> {
@raphaelcarlosr
raphaelcarlosr / PingUrlParallel.ps1
Last active February 2, 2021 17:37 — forked from Buthrakaur/PingUrlParallel.ps1
Simple load test tool in powershell
workflow PingUrlParallel {
param(
[string]$url,
[int]$parallelCount = 10,
[int]$iterations = 10
)
foreach -parallel ($x in 1..$parallelCount) {
1..$iterations | %{
# Simple PowerShell script to load-test / test REST api with headers and cookies.
# Harald S. Fianbakken
$headers = @{
"Accept"= "application/zip";
"Accept-Encoding"= "gzip,deflate,sdch";
"My-Token-ID" = "This_is_a_test";
};
function Create-Cookie($name, $value, $domain, $path="/"){
@raphaelcarlosr
raphaelcarlosr / package.json
Created July 16, 2020 13:30 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@raphaelcarlosr
raphaelcarlosr / CustomerController.cs
Created May 21, 2020 18:04 — forked from mgroves/CustomerController.cs
Audit ActionFilter in ASP.NET MVC
public class CustomerController : Controller
{
public ViewResult Index()
{
return View();
}
public ViewResult Edit()
{
var existingCustomer = new Customer();
@raphaelcarlosr
raphaelcarlosr / plink-plonk.js
Created February 17, 2020 18:32 — forked from tomhicks/plink-plonk.js
Listen to your web pages