Skip to content

Instantly share code, notes, and snippets.

View nullx5's full-sized avatar
:octocat:
🎯 Keep Calm and Code in Python! 🐍

Blessed nullx5

:octocat:
🎯 Keep Calm and Code in Python! 🐍
View GitHub Profile
@nullx5
nullx5 / .bash_aliases
Created July 8, 2019 20:22 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@nullx5
nullx5 / challenge-catwalk.html
Created March 9, 2020 22:52
Challenge Catwalk | khanacademy
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Challenge: Catwalk</title>
<style>
#cat {
position: absolute;
left: 0px;
#No modifiques commits publicos
#NUNCA RESCRIBIR LA HISTORIA DE RAMAS PUBLICAS(push) - SOLO HACERLO EN RAMAS LOCALES (git rebase | git commit --amend)
#HEAD es normalmente el ultimo commit del repositorio(master o main), si no te has movido a otro lado
#Los commits normales tienen un solo padre, un merge tiene 2 padres.
https://www.youtube.com/watch?v=Uszj_k0DGsg
https://www.freecodecamp.org/news/git-sim/
https://learngitbranching.js.org/
https://runestone.academy/ns/books/published/opensource/sec_git_branching.html?mode=browsing
herramientas visuales:
@nullx5
nullx5 / .gitconfig
Last active October 28, 2021 11:44
git alias ~/.gitconfig
[alias]
a = add # Add file contents to the index
ai = add --interactive # Add modified contents in the working tree interactively to the index.
##############
b = branch
ba = branch --all # List both remote-tracking branches and local branches.
bav = branch --all --verbose # When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any)
bd = branch --delete # Delete a branch. The branch must be fully merged in its upstream branch, or in HEAD if no upstream was set with --track or --set-upstream-to.
bdd = branch -D # Shortcut for --delete --force.
bm = branch --move # Move/rename a branch and the corresponding reflog.
Dockerfile -> build -> IMAGEN -> run -> CONTENEDOR
sudo apt install docker.io docker-compose
Acceso a internet dentro de los contenedores basados en debian/ubuntu, ejemplo mariadb imagen:
sudo apt update; sudo apt upgrade -y
sudo apt install iputils-ping
sudo apt install iproute2
####################################################################
dive: A tool for exploring each layer in a docker image https://blogs.cisco.com/developer/container-image-layers-1
$ dive stage0:latest
VAGRANT terminos:
Box (recomendadas: hashicorp, debian*)
Vagrantfile (define el tipo de máquina, cómo configurarla y aprovisionarla)
Provider (virtualbox, vmware, hyper-v, qemu)
Provisioner (permite instalar y configurar software dentro de la VM, shell, chef, puppet, ansible)
VAGRANT Comandos Basicos:
vagrant version
vagrant --help
@nullx5
nullx5 / DHCP Router Cisco.txt
Last active July 22, 2022 04:44
Configurar DHCP router cisco multiples interfaces
## Configurar DHCP router cisco multiples interfaces
### Comandos
enable
conf t
int g0/0
ip address 192.168.1.1 255.255.255.0
no shut
exit
@nullx5
nullx5 / Configurar SSH Switch CISCO.txt
Last active June 28, 2024 20:29
Configurar Acceso Remoto SSH Switch Cisco entre distintos segmentos de red
## Habilitar acceso remoto SSH a switch cisco
enable
conf t
hostname SW-1
enable secret class
line console 0
password cisco
Configurando HTTPS letsencrypt con cerbot en apache
###########################################################
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache
###########################################################
REDIRECIONAR HTTP A HTTPS
/etc/apache2/sites-available/000-default-le-ssl.conf
NameVirtualHost *:80
#CREAR NUEVO USUARIO Y AGREGARLO AL GRUPO SUDO:
sudo adduser [USER]
sudo usermod -aG sudo [USER]
id [USER]
#GENERAR LLAVES SSH EN LOCAL Y ENVIARLAS AL SERVER:
ssh-keygen -b 4096 -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub [USER]@[IP]
#VERIFICAR QUE SE SUBIO LA LLAVE: