Skip to content

Instantly share code, notes, and snippets.

View dalmosantos's full-sized avatar

Dalmo Santos dalmosantos

View GitHub Profile
@lubien
lubien / fontes-de-vagas.md
Last active January 26, 2024 13:01
Fontes de vagas (Atualizado 2024-01-18 17:41)
@willywongi
willywongi / logging_config.py
Created March 8, 2021 16:57
Python logging configuration example
import logging
import logging.config
logging.dictConfig({
'version': 1,
'disable_existing_loggers': False,
"formatters": {
"standard": {
"format": '%(asctime)s %(name)s %(levelname)s %(message)s'
}
############################################################################################################
################## #############################
################## #############################
This Gist collection contains all localstack related examples
################## #############################
################## #############################
############################################################################################################
import jenkins.model.Jenkins
import jenkins.plugins.git.GitSCMSource
import jenkins.plugins.git.traits.BranchDiscoveryTrait
import org.jenkinsci.plugins.workflow.libs.GlobalLibraries
import org.jenkinsci.plugins.workflow.libs.LibraryConfiguration
import org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever
def sharedLibraryName = "mySharedLibName"
def repository = "git@github.com:[OWNER]/[REPO].git"
@iamcryptoki
iamcryptoki / export-restore-kubernetes-mysql-database.txt
Created November 5, 2019 13:28
Export MySQL database from Kubernetes pod.
# Export dump particular database.
$ kubectl exec {{podName}} -n {{namespace}} -- mysqldump -u {{dbUser}} -p{{password}} {{DatabaseName}} > <scriptName>.sql
# Export dump all databases.
$ kubectl exec {{podName}} -n {{namespace}} -- mysqldump -u {{dbUser}} -p{{password}} --all-databases > <scriptName>.sql
# Restore a database from a dump.
$ kubectl exec -it {{podName}} -n {{namespace}} -- mysql -u {{dbUser}} -p{{password}} {{DatabaseName}} < <scriptName>.sql
@rverst
rverst / check_semver.sh
Last active April 14, 2024 04:41
Bash script for checking a semantic version
#!/usr/bin/env bash
# https://gist.github.com/rverst/1f0b97da3cbeb7d93f4986df6e8e5695
function chsv_check_version() {
if [[ $1 =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
echo "$1"
else
echo ""
fi
}
@rizkhanriaz
rizkhanriaz / compile-httpd-from-source
Last active October 23, 2023 19:16
Compile Apache from source on Centos 7
###############################################################
Apache Installation
###############################################################
# Install required tools for compilation
sudo yum install autoconf expat-devel libtool libnghttp2-devel pcre-devel -y
# Download source code
cd #switch to home dir
curl -O -L https://github.com/apache/httpd/archive/2.4.37.tar.gz #latest stable release Apache
@jrichardsz
jrichardsz / jenkins.example.com.conf
Created September 8, 2018 16:27 — forked from ofus/jenkins.example.com.conf
How To Configure Apache with SSL as a Reverse Proxy for Jenkins https
<VirtualHost *:80>
ServerName jenkins.example.com
ServerAdmin webmaster@example.com
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
@jrichardsz
jrichardsz / Jenkinsfile
Created September 7, 2018 04:39 — forked from HarshadRanganathan/Jenkinsfile
Jenkins Declarative Pipeline Example
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@crypticmind
crypticmind / README.md
Last active March 25, 2024 06:26
Setup lambda + API Gateway using localstack