Skip to content

Instantly share code, notes, and snippets.

View macielti's full-sized avatar
⌨️
Always coding

Bruno do Nascimento Maciel macielti

⌨️
Always coding
View GitHub Profile
@macielti
macielti / backup.clj
Created August 13, 2023 15:19
Backup routine Datalevin Babashka script
(require '[clojure.java.shell :refer [sh]])
(sh "docker" "exec" "global_datalevin" "dtlv" "-d" "/data/data" "copy" "/tmp/global_datalevin_backup")
(def timestamp (quot (System/currentTimeMillis) 1000))
(let [[save-backup-to-file-path] *command-line-args*]
(when (or (empty? save-backup-to-file-path))
(println "Usage: <save-backup-to-file-path>")
(System/exit 1))
@macielti
macielti / docker-compose.yml
Last active August 6, 2023 17:36
Datalevin Docker Compose file example
version: "3"
volumes:
datalevin:
services:
datalevin:
image: huahaiy/datalevin
container_name: global_datalevin
restart: always
@macielti
macielti / docker-compose.yml
Last active August 3, 2023 11:25
Example of deployment for RabbitMQ in production environiment
version: "3"
volumes:
rabbitmq:
services:
rabbitmq:
image: rabbitmq:3-management
container_name: global-rabbitmq
restart: always
import mysql.connector
try:
connection = mysql.connector.connect(host='foo.bar.com.br', database='foobar', user='foo', password='foobar2020')
# The string that you want to search.
seeked_value = "%8439742464%" # Like syntax
if connection.is_connected():
db_Info = connection.get_server_info()