Skip to content

Instantly share code, notes, and snippets.

View geek182's full-sized avatar

Leandro Azevedo geek182

View GitHub Profile
@geek182
geek182 / error-ipv6.txt
Last active September 27, 2018 13:04
error from a connection to a ipv6 address
root@server:/opt# curl -v https://packages.cloud.google.com/apt/doc/apt-key.gpg
* Trying 172.217.28.142...
* TCP_NODELAY set
* Trying 2800:3f0:4001:815::200e...
* TCP_NODELAY set
* Immediate connect fail for 2800:3f0:4001:815::200e: Cannot assign requested address
* Trying 2800:3f0:4001:815::200e...
* TCP_NODELAY set
* Immediate connect fail for 2800:3f0:4001:815::200e: Cannot assign requested address
* Trying 2800:3f0:4001:815::200e...
@geek182
geek182 / tcpdump-survival-kit
Last active August 27, 2018 19:07
tcpdump-survival-kit
#any interface with IP and port 8080 not resolv name
tcpdump -i any host {{ IP }} and port 8080 -nn
#How to capture VLAN tags that are used by tcpdump
tcpdump -i bond0 -nn -e vlan
@geek182
geek182 / kubernetes-openshift-docs
Created July 10, 2018 19:33
useful and quick info about kubernetes and openshift.
#links from :
# https://kubernetes.io/docs/concepts/services-networking/service/
# https://kubernetes.io/docs/concepts/services-networking/service/#service-tabs-2 (AWS LOADBALANCE)
Route:
expose a service, so that external clients can reach it by name.
Service:
A Kubernetes service serves as an internal load balancer.
It identifies a set of replicated pods in order to proxy the connections it receives to them.
@geek182
geek182 / openshift-admin-survival-kit
Last active July 27, 2018 19:43
openshift-admin-survival-kit
#Create a user (depends what autentication is config)
# htpasswd -c if is first time for create a file after that just remove -c
sudo htpasswd -c /etc/origin/master/htpasswd devuser
#Create a Group /Role
oc adm groups new groupname
#Get roles bound
#To view a list of all users that are bound to the project and their roles
oc get rolebindings
@geek182
geek182 / kubernetes-survival-kit
Last active February 22, 2018 19:46
kubernetes-survival-kit
#get logs from a spefic pod and keep reading with -f flag
kubectl logs -f pod/ghost-1-wjf6m
#Connect to a pod
kubectl exec POD-NAME --stdin --tty /bin/sh
#execute a command in container, if have more than one inside pod first will be select.
kubectl exec 123456-7890 date
#Get output from running 'date' in ruby-container from pod 123456-7890
@geek182
geek182 / setup-nexus-docker
Last active February 16, 2018 18:25
Setup nexus private repo for docker
#link
https://stefanprodan.com/2016/docker-private-registry-nexus-nginx/
https://blog.sonatype.com/using-nexus-3-as-your-repository-part-3-docker-images
https://help.sonatype.com/pages/viewpage.action?pageId=5412197
#Download nexus
#Run nexus
#Configure repo(hosted) for docker
@geek182
geek182 / openshift-origin-survival-kit
Last active February 20, 2018 15:03
install openshift origin ec2 and tips
#EC2
on RHEL7 need install docker for this enable extra rpm repos
Install guide to running in docker container
https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container
--boot-docker-image.sh
#!/bin/bash
@geek182
geek182 / jenkins-survival-kit
Last active February 7, 2018 17:55
jenkins-survival-kit
## Install Jenkins plugin
java -jar jenkins-cli.jar -s http://127.0.0.1:8080/ install-plugin slack --username NAME --password PASS
##URL TO DOWNLOAD JENKINS-CLI
localhost:8080/jnlpJars/jenkins-cli.jar
@geek182
geek182 / terraform-out-subnet
Created February 2, 2018 13:01
terraform-out-subnet
###
resource "aws_subnet" "public-subnet" {
count = "${length(split(",", lookup(var.azs, var.region)))}"
vpc_id = "${aws_vpc.main.id}"
cidr_block = "${cidrsubnet(var.vpc_cidr, 3,count.index +3 )}"
availability_zone = "${element(split(",", lookup(var.azs, var.region)), count.index)}"
map_public_ip_on_launch = true
tags {
Name = "Public-Subnet"
}
@geek182
geek182 / tcpdump-survival-kit
Created February 1, 2018 10:35
tcpdump-survival-kit
#spefic interface and dont resolve name
tcpdump -n -i eth0
#only tcp
tcpdump -i eth0 tcp
#specific port
tcpdump -i eth0 port 22
#specific src