Skip to content

Instantly share code, notes, and snippets.

View hieuhtr's full-sized avatar
🐤
solve technical problems & make things better

Thợ máy hieuhtr

🐤
solve technical problems & make things better
View GitHub Profile
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@radimih
radimih / Dockerfile
Last active April 20, 2023 10:53
Spring Boot Actuator based Docker HEALTHCHECK
FROM openjdk:11-jre-slim
EXPOSE 8080
ENV TZ=Europe/Moscow
RUN adduser --system --group --home /opt/app appuser
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl jq \
@afloesch
afloesch / jenkins-in-docker.md
Last active May 31, 2024 18:44
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 1, 2024 08:46
set -e, -u, -o, -x pipefail explanation
@reisjr
reisjr / sqs_commands.sh
Last active March 8, 2019 16:20
AWS SQS - Working with message using bash
#!/bin/bash
#Setup
SQS_MAX_NUMBER_OF_MESSAGES=1 # Mensagens extraídas da fila por vez
SQS_WAIT_TIME_SECONDS=20 # Esperar quanto tempo por uma mensagem na fila
#Obtain queue URL
QUEUE_URL=$(aws sqs get-queue-url --queue-name "dreis-rampup-queue" --output text)
#Send message
@algotrader-dotcom
algotrader-dotcom / zabbix_agent_install.sh
Last active June 12, 2018 10:48 — forked from freeminder/zabbix_agent_install.sh
Zabbix Agent installation script
#!/bin/bash -e
if [ "$UID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Only run it if we can (ie. on Ubuntu/Debian)
if [ -x /usr/bin/apt-get ]; then
apt-get update
@chiragnayyar
chiragnayyar / cloud_sql_flags.md
Created May 27, 2017 14:29
Cloud SQL Second Generation Tuned Flags for MySQL InnoDB

Important Notice

  • ❗ All flags and settings described here are subject to change without any notice.
  • Last update: March 2017

Introduction

This document describes a set of MySQL flags that have been tuned in Google Cloud SQL (Second Generation) to make the out-of-box experience better on Google Cloud. This is for your reference only, with the hope that some of the settings might also be useful outside the Google Cloud environment.

innodb_buffer_pool_size

@0xjac
0xjac / private_fork.md
Last active June 3, 2024 13:37
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@boredzo
boredzo / colorman.zsh
Last active June 19, 2017 14:44 — forked from cocoalabs/gist:2fb7dc2199b0d4bf160364b8e557eb66
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_md=$'\e[1;36m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[1;40;92m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[1;32m' \
man "$@"
}