Skip to content

Instantly share code, notes, and snippets.

View giovannicandido's full-sized avatar

Giovanni Silva giovannicandido

View GitHub Profile
@giovannicandido
giovannicandido / Dockerfile
Created March 16, 2023 13:17
Dockerfile for rust project multiarch build
FROM registry.access.redhat.com/ubi9/ubi-micro
ARG TARGETARCH
ARG EXECUTABLENAME
FROM registry.access.redhat.com/ubi9/ubi-micro
ARG TARGETARCH
ARG EXECUTABLENAME
COPY docker/passwd /etc/passwd
COPY docker/group /etc/group
RUN chmod 644 /etc/passwd && \
@giovannicandido
giovannicandido / build.gradle.kts
Last active March 16, 2023 13:13
Gradle build multi arch rust release and build a image
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/8.0.2/samples
* This project uses @Incubating APIs which are subject to change.
*/
val isReleaseString: String = properties["release"].toString() ?: System.getenv("RELEASE") ?: ""
val isRelease = "true".equals(isReleaseString, ignoreCase = true)
#!/bin/bash
CURRENT_VERSION=`cat ./gradle.properties | grep ^version= | cut -d= -f2`
echo "Current version $CURRENT_VERSION"
CURRENT_BUILD=`echo $CURRENT_VERSION | cut -d. -f4 | cut -d- -f2`
NEXT_BUILD=$((CURRENT_BUILD+1))
#!/bin/bash
upgrade() {
# Initial updates
apt update
apt upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt install -y jq
apt install -y ipcalc
@giovannicandido
giovannicandido / changeNetworks.ps1
Created December 24, 2018 19:18
Change default network on windows to bypass proxy in cable company
param (
[Parameter(Mandatory=$true)]
[boolean]$wifiPrimary
)
# Get-NetIPInterface
$wifiIndex = 12
$cableIndex = 10
$primaryMetric = 10
$secondaryMetric = 35

Keybase proof

I hereby claim:

  • I am giovannicandido on github.
  • I am gcsilva (https://keybase.io/gcsilva) on keybase.
  • I have a public key ASB1uIItEe97QEmRKrFmH1BHbzoxcVvBRPr2NyJJvBTO2go

To claim this, I am signing this object:

sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.0.0 --server https://rancher.internal.atende.info --token 7ffhdq4mlbwkxhzb97tcmwbdhrl4kckxzlnqh76ghk65ggdpwm7swq --ca-checksum 99b4b3d05bbaf9de4bef5758ff6040b8f4d0290216461ce558dcdacedf92eeb3 --etcd --controlplane
@giovannicandido
giovannicandido / module.xml
Created March 16, 2018 19:31
Wildfly Keycloak Config
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
<resources>
<resource-root path="postgresql-42.2.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
New-VMSwitch –SwitchName "Internal-Switch" –SwitchType Internal –Verbose
Get-NetAdapter
Write-Host "I going to create a IPAddress in the Internal-Switch"
$InterfaceIndex = Read-Host -Prompt 'What Interface Index?'
New-NetIPAddress –IPAddress 192.168.50.1 -PrefixLength 24 -InterfaceIndex $InterfaceIndex –Verbose
New-NetNat –Name InternalNATNetwork –InternalIPInterfaceAddressPrefix 192.168.50.0/24 –Verbose
Write-Host "Add VM to the Internal-Switch. Router is 192.168.50.1"
efibootmgr --create --label CentOS --disk /dev/sda1 --loader "/EFI/centos/shim.efi"