Skip to content

Instantly share code, notes, and snippets.

:octocat:
codz

Sam Mingo slmingol

:octocat:
codz
Block or report user

Report or block slmingol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@slmingol
slmingol / Brewfile
Created Jan 12, 2020 — forked from fesnow/Brewfile
The alternate shell script of deprecated `brew bundle` command
View Brewfile
#!/bin/bash
## Install Xcode from AppStore before you execute commands below for macvim
## After that, you need to open Xcode and agree the terms and install components
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Base
brew install homebrew/cask/google-chrome
brew install homebrew/cask/google-japanese-ime
brew install homebrew/cask/google-drive
@slmingol
slmingol / verbos-argpary-example.py
Created Dec 20, 2019 — forked from ms5/verbos-argpary-example.py
manipulating log level with python argparse
View verbos-argpary-example.py
import argparse
import logging
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', action='count', default=1)
args = parser.parse_args()
args.verbose = 70 - (10*args.verbose) if args.verbose > 0 else 0
logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s',
@slmingol
slmingol / sniff.txt
Created Dec 16, 2019 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
View sniff.txt
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@slmingol
slmingol / README.md
Created Nov 14, 2019 — forked from joyrexus/README.md
curl tutorial
View README.md

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@slmingol
slmingol / IAM Permissions List.md
Created Sep 15, 2019 — forked from mechcozmo/IAM Permissions List.md
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
View IAM Permissions List.md
@slmingol
slmingol / vimdiff.md
Created Sep 6, 2019 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet
View vimdiff.md

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
@slmingol
slmingol / .gitconfig
Created Aug 13, 2019 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
View .gitconfig
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@slmingol
slmingol / npm-using-https-for-git.sh
Created Jul 25, 2019 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
View npm-using-https-for-git.sh
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
@slmingol
slmingol / ansible_ad_hoc_inventories.md
Last active Jul 11, 2019 — forked from alces/ansible_ad_hoc_inventories.md
Using Ad-hoc Inventories in Ansible
View ansible_ad_hoc_inventories.md

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

You can’t perform that action at this time.