Skip to content

Instantly share code, notes, and snippets.

View sergsoares's full-sized avatar

Sergio Soares sergsoares

View GitHub Profile
@lgfa29
lgfa29 / main.tf
Last active July 11, 2022 20:43 — forked from sergsoares/main.tf
Snippet for use variables as a map
# variables.tf
variable "myapp_conf" {
type = map
}
# terraform.tfvars
myapp_conf = {
REPLICAS = 0
LIMIT_CPU = "50m"
LIMIT_MEMORY = "96Mi"
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo vim /etc/systemd/logind.conf
# Replace whatever values of following to "ignore"
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
@nickjj
nickjj / 01-image-slugs.sh
Last active July 11, 2023 19:04
List of DigitalOcean slugs for images, sizes and regions.
# Listed generated on 2021-08-07 at 3:45am EST
curl -s -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer ${DIGITALOCEAN_ACCESS_TOKEN}" \
"https://api.digitalocean.com/v2/images?page=1&per_page=100&type=distribution" \
| jq '.images[].slug' | sort
"centos-7-x64"
"centos-8-x64"
"centos-stream-8-x64"
"debian-10-x64"
@vtrifonov-esfiddle
vtrifonov-esfiddle / cloud-init.yaml
Last active January 5, 2024 17:42
cloud-init config for ubuntu host with docker & docker-compose
#cloud-config
groups:
- docker
users:
- default
# the docker service account
- name: docker-service
groups: docker
package_upgrade: true
packages:
const assert = require('assert')
const BLUEBIRD = require('bluebird')

const nameAsync1 = async (name) => name
const nameAsync2 = (name) => Promise.resolve(name)
const nameAsync3 = (name) => BLUEBIRD.resolve(name)
const nameSync = (name) => name

const isPromise1 = (value) => Promise.resolve(value) === value
@csswizardry
csswizardry / README.md
Last active April 2, 2024 20:17
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@denji
denji / README.md
Last active April 24, 2024 17:20 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@pierre-b
pierre-b / config.fish
Created March 6, 2017 10:03
golang fish shell config
# config file
# vim ~/.config/fish/config.fish
# reload the config
# source ~/.config/fish/config.fish
# set the workspace path
set -x GOPATH /users/my-username/go
# add the go bin path to be able to execute our programs
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites