Skip to content

Instantly share code, notes, and snippets.

View krainet's full-sized avatar

Ramon Alberti Danes krainet

View GitHub Profile

Keybase proof

I hereby claim:

  • I am krainet on github.
  • I am ralberti (https://keybase.io/ralberti) on keybase.
  • I have a public key ASAmfztx7hy7_Z34xVwW0BTG6DFA3-wFIxhEGC7Qce4HOAo

To claim this, I am signing this object:

@krainet
krainet / 04-k8s-centos-install-dashboard.sh
Last active January 1, 2019 16:06
Install and setup K8S Dashboard
#!/bin/bash
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
#create service account
cat <<EOF > k8s-service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
#!/bin/bash
kubectl get nodes
cp /etc/kubernetes/admin.conf ~/.kube/config
@krainet
krainet / 02-k8s-centos-install-nodes.sh
Last active January 1, 2019 16:08
Setup K8S nodes and link with manager.
#!/bin/bash
kubeadm join 192.168.1.142:6443 --token 0gx03i.bkjfviauhce6q3ns --discovery-token-ca-cert-hash sha256:bed83e5c33b66416d8d6081b7416d8f7d25777238bcfe9efd1fa88c2ddb79974
#is you lost your join command yo can retriew with (on master):
#kubeadm token create --print-join-command
@krainet
krainet / 01-k8s-centos-install-manager.sh
Last active December 31, 2018 13:39
Setup K8S master node after initial setup
#!/bin/bash
systemctl daemon-reload
systemctl restart kubelet
kubeadm init
#if you are root
export KUBECONFIG=/etc/kubernetes/admin.conf
@krainet
krainet / 00-k8s-centos-install-allnodes.sh
Last active December 31, 2018 13:35
Initial setup for all K8S installations on centos
#!/bin/bash
swapoff -a
#vi /etc/fstab and disable swap partition
yum install -y docker
systemctl enable docker && systemctl start docker
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
@krainet
krainet / setup.md
Created October 11, 2018 08:19 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@krainet
krainet / PushApns.php
Created September 5, 2018 08:39
Send APNS push in PHP Class & Manager
<?php
class PushApns
{
private $apnsPemFile="ck.pem"; //pem file link
private $type = 'dev'; //development and distribution (dev or dis)
private $passphrase = 'yourPass';
public function SendNotification($device_token, $message, $sound = "bingbong.aiff",$debug=false)
{
//Without AngularJS
//Include socket.io library to your JS app
//Sample: <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.5.1/socket.io.js"></script>
//Instantiate global var socket.
var socket = io();
@krainet
krainet / productsService.js
Created January 18, 2016 21:58
Products Service Walladog
/*
* Api Test Módule
*/
angular.module('productsService', [])
.factory('productsService', ['$resource', '$q', '$log',
function ($resource, $q, $log) {
return {
api: function (extra_route) {
if (!extra_route) {
extra_route = '';