Skip to content

Instantly share code, notes, and snippets.

View sharepointoscar's full-sized avatar
💭
Winter is coming...

Oscar Medina sharepointoscar

💭
Winter is coming...
  • Using tech to support my lifestyle.
  • California
  • X @DevOpsOscar
View GitHub Profile
@sharepointoscar
sharepointoscar / Stop remove all docker containers
Last active July 30, 2018 07:35
Docker - Stop and remove all containers
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
@sharepointoscar
sharepointoscar / KillProcessess
Created March 24, 2017 01:34
Kill all processes running on port 80
sudo lsof -t -i tcp:80 -s tcp:listen | sudo xargs kill
@sharepointoscar
sharepointoscar / deletewinservice
Created March 24, 2017 15:49
Deletes a Windows Service by name
(gwmi win32_service -filter "name='service_name'").delete()
@sharepointoscar
sharepointoscar / inspect all
Last active March 28, 2017 22:45
List Docker Container IP Address
# docker ip
docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
@sharepointoscar
sharepointoscar / modifydefaultserviceaccount
Created March 31, 2017 03:05
Add Docker Hub Registry to default service account in Kubernetes/MiniKube
# The yaml file
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: 2017-03-30T04:36:20Z
name: default
namespace: default
selfLink: /api/v1/namespaces/default/serviceaccounts/default
uid: 6bd2e599-1502-11e7-9a0e-080027e762a7
secrets:
@sharepointoscar
sharepointoscar / minikubedelete
Last active November 25, 2023 18:47
Minikube - Delete all pods from default namespace
# delete all pods
kubectl delete --all pods --namespace=default
# deete all deployments
kubectl delete --all deployments --namespace=default
# delete all services
kubectl delete --all services --namespace=default
@sharepointoscar
sharepointoscar / scaffold_ansible.sh
Created April 23, 2017 14:11 — forked from StalkingKillah/scaffold_ansible.sh
Scaffold Ansible project
#!/usr/bin/env bash
padding () {
local char=" "
if [ "$#" -gt "1" ]; then
local char=${1:-$char}
local count=${2:-"1"}
elif [ "$#" -eq "1" ]; then
local count=${1:-"1"}
fi
@sharepointoscar
sharepointoscar / partitions
Created May 31, 2017 22:27
List Partition Labels for Unix Box
sudo lsblk -o name,mountpoint,label,size,uuid

Keybase proof

I hereby claim:

  • I am sharepointoscar on github.
  • I am sharepointoscar (https://keybase.io/sharepointoscar) on keybase.
  • I have a public key ASAH0NpuBw9WPHx6rVbQmtvcNxI6BImjZM1nW7P0LcYHsQo

To claim this, I am signing this object:

@sharepointoscar
sharepointoscar / DockerUsefulCommands
Last active June 12, 2017 18:30
Useful Docker Commands to clean up your environment.
# remove images based on a pattern
docker images | grep "pattern" | awk '{print $1}' | xargs docker rm
# remove all images
docker rmi $(docker images -a -q)