Skip to content

Instantly share code, notes, and snippets.

View rogeriopradoj's full-sized avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@jsonberry
jsonberry / purge_branches.sh
Last active August 8, 2022 14:42
Mass remove local git branches and prune remote tracking
// List all remotely tracked branches that do not exist in the remote repo
git remote prune origin --dry-run
// Prune all remotely tracked branches that do not exist in the remote repo
git remote prune origin
// List all local branches that were merged into master, explicitly exclude master from that list
git branch --merged master | grep -v 'master'
/*
@squeedee
squeedee / 1.Readme.MD
Last active May 12, 2023 19:46
Adding your ssh key to lastpass

Setup

  1. Install lpass, the last pass command line tool
brew install lastpass-cli --with-pinentry
  1. Create a passphrase encrypted key and make sure you put the public key where you need it, eg: github
@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@evanwill
evanwill / gitBash_windows.md
Last active April 22, 2024 12:46
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@helderco
helderco / db-open
Created October 6, 2015 14:51
Script to open a mysql database in Sequel Pro from a service in docker-compose.
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.
@ashee
ashee / mac-oui.text
Last active March 17, 2024 04:09
Common mac address prefix/oui
QEMU - 52:54:00
VMWare - 00:50:56
Xen Source - 00:16:3E
Xen - 00:ca:fe
Microsoft - 00:15:5D
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 22, 2024 11:45
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

@scalopus
scalopus / common-config.sh
Created February 27, 2015 09:00
php-build-common-config
#!/bin/bash
# Copy this file to ./php-build/share/php-build/after-install.d
# This file is to keep all minors version use the same configuration file.
# This will required you to install the base version.
# Ex.
# 5.4.10 use 5.4.0 as configuration
# you have to install 5.4.0 at first.
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites