Skip to content

Instantly share code, notes, and snippets.

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

Gustavo Barron cicloid

🏠
Working from home
View GitHub Profile
@Yetangitu
Yetangitu / random_name_generator.bash.cgi
Created March 1, 2018 14:11
Random domain name generator
#!/bin/bash
declare -a ADJECTIVE
declare -a CRITTER
ADJECTIVE=(white red blue pink green brown dark light big small tiny earth glass air)
# or, for more variation, feed it a list of adjectives from a file, one word per line.
# the same could be done for the CRITTER array
#ADJECTIVE=($(cat /home/frank/adjectives))
CRITTER=(frog hound fish lizard gator moose monkey whale hippo fox bird weasel owl cow pig hog donkey duck executive manager lawyer accountant)
@sahilsk
sahilsk / kafka-rebalancing.md
Last active March 11, 2023 12:41
Kafka-rebalancing

Lets say i want to rebalance my-sample-topic topic on my kafka cluster

Create topcis.json

{
  "version": 1,
  "topics": [
 { "topic": "my-sample-topic" 
@deric
deric / check_nvme
Created March 1, 2017 13:09
nagios/icinga check script for NVMe disk
#!/bin/bash
set -o errexit -o nounset -o pipefail
export LC_ALL=C
# Checks for NVMe disks. nmve-cli must be installed.
#
# Author: Tomas Barton
# Requirements:
# nvme-cli - git clone https://github.com/linux-nvme/nvme-cli
#
# Usage:
@maxivak
maxivak / __readme.md
Last active February 19, 2021 19:30
Provisioning Remote server accessible by SSH with Chef and knife-zero

Provisioning remote server accessible by SSH with Chef and knife-zero.

We have a server(node) accessible by SSH. We want to provision using Chef recipes stored on our local chef repo.

We will use gem knife-zero.

Find an example of Chef repo here.

knife-zero

@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@that0n3guy
that0n3guy / gist:905c812c0f65e7ffb5ec
Last active December 20, 2023 11:13
Mautic nginx config
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active April 12, 2024 18:15
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@pixeltrix
pixeltrix / time_vs_datatime.md
Last active February 18, 2024 19:20
When should you use DateTime and when should you use Time?

When should you use DateTime and when should you use Time?

It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:

>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}