Skip to content

Instantly share code, notes, and snippets.

View shgonzalez's full-sized avatar
🏠
Working from home

Sergio H. Gonzalez. shgonzalez

🏠
Working from home
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@zekefast
zekefast / move_postgres_data_to_ram.bash
Last active September 26, 2023 14:37
Move Postgres data_directory to RAM to improve IO speed and test performance. Run as root/sudo.
#!/bin/bash
# It is probably redundant if you set settings mentioned in https://gist.github.com/zekefast/42273658939724ba7c7a .
# But anyway it will not hurt anybody (sure if you are not putting your production database to RAM :)).
#
# Look for more detailed description in follow articles:
# - http://blog.vergiss-blackjack.de/2011/02/run-postgresql-in-a-ram-disk/
#
# ATTENTION:
# DO NOT apply this approach if you store important data in postgresql cluster, because that could cause
@areichman
areichman / reload_rsyslog.sh
Created August 24, 2016 15:44
Reload rsyslog configuration without restarting
# Restart rsyslog so it re-opens its file pointer (e.g. during logrotate postrotate script)
# via https://access.redhat.com/solutions/232793
kill -HUP $(cat /var/run/syslogd.pid)
@silveraid
silveraid / CentOS-Docker
Created October 27, 2017 12:09
Creating minimal CentOS docker image from scratch
# Create a folder for our new root structure
$ export centos_root='/centos_image/rootfs'
$ mkdir -p $centos_root
# initialize rpm database
$ rpm --root $centos_root --initdb
# download and install the centos-release package, it contains our repository sources
$ yum reinstall --downloadonly --downloaddir . centos-release
$ rpm --root $centos_root -ivh centos-release*.rpm
$ rpm --root $centos_root --import $centos_root/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# install yum without docs and install only the english language files during the process
@sdorsett
sdorsett / consul-a-install.txt
Last active May 14, 2024 06:17
install 3 node consul cluster on Centos 7
yum install -y epel-release
yum install -y bind-utils unzip jq
cd ~/
wget https://releases.hashicorp.com/consul/1.0.2/consul_1.0.2_linux_amd64.zip
unzip consul_1.0.2_linux_amd64.zip
mv consul /usr/local/bin/
adduser consul
mkdir /etc/consul.d
chown -R consul:consul /etc/consul.d/
mkdir /var/consul
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active April 25, 2024 17:43
Ansible variable precedence (order, hierarchy)
@vpnwall-services
vpnwall-services / ansible-delete-wildcard.yml
Last active January 22, 2022 20:21
[Ansible Delete Folders And Files Wildcard] Delete folders and files wildcard method with Ansible #script #yml #ansible #delete #wildcard
- hosts: all
tasks:
- name: Ansible delete file wildcard
find:
paths: /etc/wild_card/example
patterns: "^he.*.txt"
use_regex: true
register: wildcard_files_to_delete
- name: Ansible remove file wildcard