Skip to content

Instantly share code, notes, and snippets.

@doppiomacchiatto
doppiomacchiatto / podman_comands.sh
Created March 13, 2024 23:29 — forked from juanje/podman_comands.sh
Run Redis with Podman. As a Systemd service and as a Pod.
# This is a simple example of how to run a basic service inside a container with Podman
# Podman
## Pull the Docker image
podman pull docker.io/redis
## Run the container as you would do with Docker
podman run -d --name redis_server -p 6379:6379 redis
# But Podman facilitate some extra ways:
@doppiomacchiatto
doppiomacchiatto / TestUtility.cls
Created January 2, 2024 22:55 — forked from scottmcclung/TestUtility.cls
Apex method to generate fake record ids in tests.
/**
* Apex method to generate fake record ids in tests
* Created by Stephen Willcock
* https://foobarforce.com/2013/08/15/apex-method-of-the-day-string-repeat/
*/
public class TestUtility
{
static Integer s_num = 1;
public static String getFakeId(Schema.SObjectType sot)
@doppiomacchiatto
doppiomacchiatto / installScala_Docker.txt
Last active August 28, 2023 15:00 — forked from mohnoor94/installScala.txt
Install Scala and SBT using apt on Ubuntu or any Debian derivative using apt
## Install Java
RUN apt update
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME #New Docker feature, we are copying the SDK from another Docker Image
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Install Scala
RUN apt remove scala-library scala
RUN wget --no-verbose -O http://scala-lang.org/files/archive/scala-2.13.1.deb
RUN dpkg -i scala-2.13.1.deb
@doppiomacchiatto
doppiomacchiatto / Dockerfile
Created August 6, 2023 20:56 — forked from gyndav/Dockerfile
install Scala and sbt on Alpine Linux
FROM openjdk:8u151-jre-alpine
ENV SCALA_VERSION=2.12.4 \
SCALA_HOME=/usr/share/scala
# NOTE: bash is used by scala/scalac scripts, and it cannot be easily replaced with ash.
RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
apk add --no-cache bash curl jq && \
cd "/tmp" && \
wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doppiomacchiatto
doppiomacchiatto / gist:37c6c69dcd17ae4e9f8175ca03636e19
Created November 7, 2022 15:06 — forked from rolandinsh/gist:3259141
Bitbucket create/init and add remote
$ mkdir /path/to/your/project
$ cd /path/to/your/project
$ git init
$ git remote add origin https://[email protected]/USERNAME/project.git
Create a new repository on the command line
touch README.md
git init
@doppiomacchiatto
doppiomacchiatto / Jenkinsfile
Created September 22, 2022 23:05 — forked from nickforce/Jenkinsfile
Sample Jenkinsfile with Parameter based SFDX Deployment
#!groovy
pipeline {
agent any
options {
timeout(time: 5, unit: 'MINUTES') // timeout all agents on pipeline if not complete in 5 minutes or less.
}
parameters {
@doppiomacchiatto
doppiomacchiatto / gist:c82ceb06bad0a0d67eb15278f755a600
Created April 15, 2022 13:02 — forked from manute/gist:5451435
my zsh config with oh-my-zsh
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
#JAVA_HOME
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
#MAVEN
export M2_HOME=/usr/local/maven-3.0.5
export MAVEN_OPTS=-Xmx1024m

ref

https://rancher.com/docs/k3s/latest/en/installation/kube-dashboard/

install

Deploying the Kubernetes Dashboard

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
@doppiomacchiatto
doppiomacchiatto / LettuceRedisClientConnectionPooling.java
Created August 31, 2021 16:17 — forked from riteshmodi/LettuceRedisClientConnectionPooling.java
Lettuce Redis Connection pooling through Spring RedisTemplate
import org.apache.commons.pool.impl.GenericObjectPool.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.lettuce.DefaultLettucePool;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
@Component
public class LettuceRedisClientConnectionPooling {