Sunday, June 2, 2024

Ansible - Setup on Linux ( +cisco devices )

 

Ansible Installation

On the ubuntu shell run:

sudo apt update
sudo apt upgrade -y

 

# PYTHON

sudo apt-get install python3

sudo apt install python3-pip

 

# ANSIBLE

sudo apt install -y software-properties-common

sudo apt install -y ansible

 

# ANSIBLE COMMON MODULES / LIBRARIES (OPTIONAL)

ansible-galaxy collection install cisco.ios

sudo apt-get install python3-dnspython

sudo pip install ansible-pylibssh

sudo pip install pexpect

sudo pip install paramiko

sudo apt-get install sshpass


SSH Host Key Checking

If you want to avoid issues on connecting via SSH because the the keys are not added, go to:  

sudo nano /etc/ansible/ansible.cfg

and uncoment the "host_key_checking" line:

[defaults]
host_key_checking = False

Verification

WSL

Win+r ubuntu

 

PYTHON

python3

 

ANSIBLE

ansible-playbook --version


Wednesday, May 18, 2022

Ansible - Setup on Windows WSL ( +cisco devices )

Enable Windows Features for WSL (Windows Subsistem for Linux - aka Linux on Windows)

Run on powershell

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

 

Download and Install WSL2 Patch

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Set Default Version to Version 2

Run on powershell

wsl --set-default-version 2

Ubuntu WSL Download - Without Using Windows Store - Online Method

Open windows CMD and run:

wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'.

NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
openSUSE-42 openSUSE Leap 42
SLES-12 SUSE Linux Enterprise Server v12
Ubuntu-16.04 Ubuntu 16.04 LTS
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS


wsl --install --distribution Ubuntu

Ubuntu WSL Download - Without Using Windows Store - Offline Method

Open windows powershell and run:

Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx

Add-AppxPackage .\Ubuntu.appx


First Run and Installation

Win+r Ubuntu

Set WSL DNS to Google DNS (default is a Windows generated, which doesn't always work)

Change the DNS to Google's DNS

sudo nano /etc/resolv.conf


# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 8.8.8.8

Avoid windows from changing the DNS server again:

sudo nano /etc/wsl.conf 


[network]
generateResolvConf = false

Ansible Installation

On the ubuntu shell run:

sudo apt update
sudo apt upgrade -y

 

# PYTHON

sudo apt-get install python3

sudo apt install python3-pip

 

# ANSIBLE

sudo apt install -y software-properties-common

sudo apt install -y ansible

 

# ANSIBLE COMMON MODULES / LIBRARIES (OPTIONAL)

ansible-galaxy collection install cisco.ios

sudo apt-get install python3-dnspython

sudo pip install ansible-pylibssh

sudo pip install pexpect

sudo pip install paramiko

sudo apt-get install sshpass


SSH Host Key Checking

If you want to avoid issues on connecting via SSH because the the keys are not added, go to:  

sudo nano /etc/ansible/ansible.cfg

and uncoment the "host_key_checking" line:

[defaults]
host_key_checking = False

Extra - Convert Install Machines to WSL2

If you already had WSL installed and some distros and want to convert then, first check your distros and versions:

wsl --list -v
NAME STATE VERSION
Ubuntu Running 1

then change it to version two and windows will start the conversion:

wsl --set-version Ubuntu 2

Verification

WSL

Win+r ubuntu

 

PYTHON

python3

 

ANSIBLE

ansible-playbook --version


Monday, October 8, 2018

Nvidia Shield - NAS Server (SMBv1)


Configuring The Nvidia Shield (v8.0.0)

Go to Settings > Storage & reset > Transfer files over network, to turn this feature on.

clip_image002

You'll be presented with a

  • User name - the Nvidia Shield generates it but you can change it
  • Password - the Nvidia Shield generates the password not you

that you can use on a networked PC to access SHIELD folders.

clip_image004

Make sure your PC is on the same network as your SHIELD.


Activate SMB1 Client on Windows 10

This is a legacy protocol and it´s client is disabled by default, to enable it:

  1. Open Control Panel.
  2. Click on Programs.
  3. Click on Turn Windows features on or off link.

clip_image006

  1. Expand the SMB 1.0/CIFS File Sharing Support option.
  2. Check the SMB 1.0/CIFS Client option.

clip_image007

  1. Click the OK button.
  2. Click the Restart now button.

After completing these steps, you'll once again be able to see and connect to network devices running the old protocol on your local network from your Windows 10 computer.


Accessing The Nvidia Shield Shared Folder

On windows start menu run the following command:

image

You can also permanently map your SHIELD as a network drive by right-clicking on "Network" in File Explorer and selecting "Map Network Drive". Select an unused Drive letter.

clip_image011


Based On:

https://nvidia.custhelp.com/app/answers/detail/a_id/4172/~/how-do-i-share-shield-tv-folders-with-a-pc