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 / 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 / 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)
aws ec2 delete-key-pair --key-name mykeyname --region us-west-2
@sharepointoscar
sharepointoscar / Kubernetes
Created August 24, 2017 17:01
Kubernetes Snippets
#Get all Hosts and public IP addresses on all namespaces
kubectl get ing --all-namespaces | awk {'print $3" " $4'} | column -t
@sharepointoscar
sharepointoscar / FindWordInstancesInArray
Created February 16, 2018 21:21
Find total occurrences of a word within a sentence. Output word and count.
module.exports = {
getText: function(req,res){
var _text = req.param('text');
var _splitUpWords = _text.split(' ');
var _wordCount = {};
// store all words in an object
@sharepointoscar
sharepointoscar / login-azure.ps1
Last active March 2, 2018 20:51
Login to Azure via PowerShell non-interactive
# Install required module
Install AzureRM Module
# Load Module
Import AzureRM Module
# Create a Credential Object
$clientID = <CLIENT_ID>
$key = <CLIENT_SECRET>
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force