Skip to content

Instantly share code, notes, and snippets.

View miguelfito's full-sized avatar
💻
Working from home

Miguel Ángel Melón Pérez miguelfito

💻
Working from home
View GitHub Profile
@miguelfito
miguelfito / keybase.md
Created July 12, 2019 11:53
Keybase.io verification

Keybase proof

I hereby claim:

  • I am miguelfito on github.
  • I am mmelon (https://keybase.io/mmelon) on keybase.
  • I have a public key whose fingerprint is 335E 956A 3B6F 8AFD 6F32 FF9D 92D2 3759 2EF5 867C

To claim this, I am signing this object:

@miguelfito
miguelfito / sshify.py
Created September 5, 2018 08:37 — forked from toolness/sshify.py
A script to run a command within an ssh-agent session.
#! /usr/bin/env python3
"""
This utility will execute the given command (by default, your shell)
in a subshell, with an ssh-agent process running and your
private key added to it. When the subshell exits, the ssh-agent
process is killed.
"""
# This code was written by Atul Varma in February 2017. It requires
@miguelfito
miguelfito / download_bitbucket_repos.sh
Last active April 25, 2022 09:05
Clone all project's git repos from Bitbucket
#!/usr/bin/env bash
# Define your bitbucket server URL
BITBUCKET_SERVER=bitbucket.organization.com
# Define your credentials
USERNAME=your_login
PASSWORD=your_password
# Save current dir
root_folder=$PWD

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@miguelfito
miguelfito / gcsettings.sh
Created April 10, 2018 14:17 — forked from svanoort/gcsettings.sh
Blessed GC settings for big servers
# Base settings and GC logging
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed.
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine)
-XX:+UseG1GC
-XX:+UseStringDeduplication
@miguelfito
miguelfito / ansible-summary.md
Created February 24, 2018 16:45 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@miguelfito
miguelfito / deleteJenkinsJobs.groovy
Last active February 7, 2018 12:00 — forked from nextrevision/deleteJenkinsJobs.groovy
[Jenkins] Groovy script to delete all jenkins jobs that match a regex pattern
import jenkins.model.*
i = 1
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /my_regex_here/
}
matchedJobs.each { job ->
println i++ + " >> This job will be deleted: " + job.name
minikube start --kubernetes-version=v1.7.0 --extra-config=apiserver.Authorization.Mode=RBAC
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
minikube dashboard
@miguelfito
miguelfito / update_git_repos.sh
Last active February 1, 2018 15:31 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo -e "\n\033[1mFetching in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@miguelfito
miguelfito / tmux-cheatsheet.markdown
Created October 25, 2017 13:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname