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 / DBA_Cookbook.sql
Last active March 20, 2016 11:16
Oracle DBA Cookbook
---------------------------------------------------------------------------------------------
-- ORACLE DBA COOKBOOK ----------------------------------------------------------------------
---------------------------------------------------------------------------------------------
-- Set wide output in rlwrap
set lines 1000 pages 1000
-- Get privileges granted for certain table/object
SELECT * FROM ALL_TAB_PRIVS WHERE TABLE_NAME='TABLE_NAME';
@miguelfito
miguelfito / add_keys.sh
Last active March 31, 2016 06:18 — forked from kacinskas/gist:4249069
LINUX : permanently add keys to ssh agent with config
cat 'IdentityFile ~/.ssh/id_rsa' > ~/.ssh/config
chmod 600 ~/.ssh/config
@miguelfito
miguelfito / put_ssh_keys_remote.txt
Last active March 31, 2016 06:27 — forked from kacinskas/gist:4249085
LINUX : put SSH keys on server
cat ~/.ssh/id_rsa.pub | ssh hostname 'cat >> ~/.ssh/authorized_keys'
-OR-
sh-copy-id -i ~/.ssh/id_rsa.pub username:password@remotehost.co.jp
@miguelfito
miguelfito / GITlog.sh
Last active April 5, 2016 09:15 — forked from kacinskas/GIT log
Git Logging
# Define a new alias for git tree, colorized and with graph
git config --global alias.tree 'log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset"'
# Then, invoke it
git tree
# Source: https://coderwall.com/p/4-itow/nice-terminal-git-tree-graph
@miguelfito
miguelfito / Puppet_cli-commands.sh
Last active December 21, 2016 07:09
Puppet Cookbook
# Start Puppet Master process in foreground (v3.x)
puppet master --no-daemonize --debug --verbose
# Start Puppet Agent test without doing any change (v3.x)
puppet agent --test --debug --noop
# Get puppet config for a parameter
puppet config print "name_of_the_parameter"
# ... or print full configuration and then filter
puppet config print | grep -i "filter"
@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
@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
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 / 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
@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