Skip to content

Instantly share code, notes, and snippets.

View CallMarl's full-sized avatar
🏠
Working from home

Paul PRIKAZSKY CallMarl

🏠
Working from home
View GitHub Profile
@CallMarl
CallMarl / create_nat_interface.ps1
Last active September 26, 2020 14:16
Powershell Network Management
# Run powershell as administrator
# Create powershell internal interface. This is to create the first VMs Cluster Gateway
New-VMSwitch –SwitchName “Cluster_VMs_1” –SwitchType Internal –Verbose
# Find the new interface index (it's the value in the ifindex column)
Get-NetAdapter -Name "vEthernet (Cluster_VMs_1)"
# Set up the ip address of the interface, this address will be the gateway of the nat network. (192.168.2.0/24)
# In my case the interface index value is 45.
New-NetIPAddress –IPAddress 192.168.2.1 -PrefixLength 24 -InterfaceIndex 45 –Verbose
@CallMarl
CallMarl / choco.ps1
Last active April 2, 2020 07:12
Powershell package manager
# Greate tools to work with on powershell
# Yo can download link: https://chocolatey.org/
# Be very carrefull about security from this package manager.
# Display the current installed package
choco list --local-only
# Update specifique package (run as administator)
choco update "package-name"
@CallMarl
CallMarl / usual_tools.ps1
Last active April 16, 2020 16:23
Powershell Usual tools
# Documentation link:
# https://docs.microsoft.com/fr-fr/powershell/
# Update the help dictionnary (run as administator)
Update-Help
# Display helpping information about the commande.
Get-Help commande
# Import downloaded module
@CallMarl
CallMarl / README.md
Last active April 16, 2020 13:05
Setup linux routeur (debian)

File location

  • /usr/local/src/firewall.sh
  • /usr/local/src/forward.sh
  • /etc/networking/interfaces
  • /etc/networking/interfaces.d/eth0
  • /etc/networking/interfaces.d/eth1
  • /etc/resolv.conf

You should create symlink between for script tools

@CallMarl
CallMarl / arp.sh
Last active April 16, 2020 14:20
Linux networking command (debian)
# Display all know device with hostname if it's know
arp
# Display all entry about revelant hostname or ip
arp -a hostname
arp -a ipaddr
@CallMarl
CallMarl / 1README.md
Last active October 3, 2020 16:08
Setup linux dhcp serveur (debian)

file location :

  • /etc/dhcp/dhcpd.conf
  • /etc/default/isc-dhcp-server
  • /etc/rsyslog.d/50-default.conf

Administation tool

dhcp-admin

Documentation :

@CallMarl
CallMarl / .gitconfig
Last active April 14, 2020 09:39
Git usual command
[user]
email = PaHaGeek@gmail.com
name = CallMarl
[alias]
lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[core]
autocrlf = false
@CallMarl
CallMarl / apt.sh
Last active April 16, 2020 14:23
Linux usual command (Debian)
# Check for update
apt-get update
# Apply update
apt-get upgrade -y
# Install package
apt-get install package name
# List installed package
@CallMarl
CallMarl / README.md
Created April 1, 2020 17:56
Setup linux firewall (debian)

file location :

  • /usr/local/src/firewall.sh
chown root /usr/local/src/firewall.sh
chgrp root /usr/local/src/firewall.sh

ln -sf /usr/local/src/firewall.sh /usr/local/sbin/firewall
@CallMarl
CallMarl / docker.sh
Last active April 3, 2020 08:43
Docker usual command
# Pull image on local area
docker pull image_name
# Run image (not persistent)
docker run image_name
# Display volume
docker volume ls
# Create volume