Skip to content

Instantly share code, notes, and snippets.

View pedroamador's full-sized avatar
💭
Happy

Pedro Amador Rodríguez pedroamador

💭
Happy
View GitHub Profile
@pedroamador
pedroamador / README.md
Created April 5, 2020 15:16 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@pedroamador
pedroamador / del_cluster.sh
Created November 20, 2019 07:08 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
# edit through sqlite, check, delete, verify
@pedroamador
pedroamador / proxmox_lxc_nfs_server.md
Created October 13, 2019 18:03 — forked from rwenz3l/proxmox_lxc_nfs_server.md
Install a NFS Server inside a LXC Container on Proxmox 5.1

Installing NFS inside LXC Container on Proxmox 5.1

Host Setup:

Create LXC Container as usual, but do not start it yet.

# Install NFS-Kernel on Host
apt install nfs-kernel-server
@pedroamador
pedroamador / upload.php
Created April 24, 2019 04:44 — forked from taterbase/upload.php
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
@pedroamador
pedroamador / Jenkinsfile
Last active March 1, 2019 14:56
Jenkins Declarative Pipeline Deploy Combo
#!groovy
@Library('github.com/red-panda-ci/jenkins-pipeline-library@v2.6.2') _
// Initialize global config
cfg = jplConfig('testproject', 'backend' ,'', [hipchat: '', slack: '', email: 'pedroamador.rodriguez+testproject@gmail.com'])
pipeline {
agent any
@pedroamador
pedroamador / wait_for_http_200.sh
Created November 21, 2018 15:46 — forked from rgl/wait_for_http_200.sh
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76

I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (saharacluster.com).

A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.

And it was a dream!

All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.

And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go

@pedroamador
pedroamador / 100.conf
Created August 2, 2018 06:10
Docker in LXC using Proxmox
arch: amd64
cores: 4
hostname: test
memory: 4096
net0: name=eth0,bridge=vmbr1,gw=10.0.0.1,hwaddr=E6:D9:99:73:38:81,ip=10.0.0.100/24,type=veth
ostype: ubuntu
rootfs: local:100/vm-100-disk-1.raw,size=100G
swap: 4096
# Docker
@pedroamador
pedroamador / install-latest-compose.sh
Created August 2, 2018 04:41 — forked from deviantony/install-latest-compose.sh
Install latest version of Docker Compose
#!/bin/bash
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
# Install docker-compose
sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
Network Block Device(nbd):
In Linux, a network block device is a device node whose content is provided by a remote machine. Typically, network block devices are used to access a storage device that does not physically reside in the local machine but on a remote one. As an example, the local machine can access a fixed disk that is attached to another computer.
1.start nbd-server to export a qcow2 image with absolute path on the NBD server host.
# nbd-server 12345 /home/my-data-disk.qcow2
2.launch a KVM guest with this exported image as a data disk.
# qemu-img info nbd:10.66.83.171:12345
image:
file format: qcow2
virtual size: 10G (10737418240 bytes)