Monday, December 21, 2020

How to access from local network in WSL2

add port: 

netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.20.216.249


delete port:

netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0


show port:

netsh interface portproxy show all


ex.

PS C:\Windows\system32> netsh interface portproxy show all

Listen on ipv4:             Connect to ipv4:


Address         Port        Address         Port

--------------- ----------  --------------- ----------

0.0.0.0         3000        172.20.216.249  3000

0.0.0.0         8080        172.20.216.249  8080


Monday, December 7, 2020

PowerShell Connections for Office365 Administrators

Office 365/Azure AD

Microsoft Online Services Sign-in Assistant for IT Professionals 

PS C:\>Install-Module MSOnline

PS C:\>$credential = Get-Credential

PS C:\>Connect-MsolService -Credential $Credential


Azure AD

PS C:\>Install-Module AzureAD

PS C:\>Connect-AzureAD


Exchange Online

PS C:\>$credential = Get-Credential

PS C:\>$exosession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid -Credential $credential -Authentication Basic –AllowRedirection

PS C:\>Import-PSSession $exosession


Microsoft Teams

PS C:\>Install-Module -Name MicrosoftTeams

PS C:\>Install-Module -Name MicrosoftTeams -AllowClobber

PS C:\>Connect-MicrosoftTeams


Skype for Business Online

Skype for Business Online PowerShell Module 

PS C:\>$credential = Get-Credential

PS C:\>$skypesession = New-CsOnlineSession -Credential $credential

PS C:\>Import-PSSession $skypesession


SharePoint Online

SharePoint Online Management Shell

PS C:\>$Credential = Get-Credential

PS C:\>Connect-SPOService -url https://yourtenantname-admin.sharepoint.com -Credential $credential

ex. Connect-SPOService -url https://my365-admin.sharepoint.com -Credential $credential

PS C:\>Get-Command -Noun SPO*


Security and Compliance Center

PS C:\>$credential = Get-Credential

PS C:\>$ccsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection

PS C:\>Import-PSSession $ccsession


Tuesday, November 24, 2020

Error opening specified endpoint "udp:127.0.0.1:161" (net-snmp) ALPINE LINUX

Error opening specified endpoint "udp:127.0.0.1:161" (net-snmp) ALPINE LINUX

#vi /etc/snmp/snmpd.conf

agentAddress  SERVER_IP_ADDRESS

or

#vi /etc/snmp/snmpd.conf

agentAddress  udp:161


#rc-update add snmpd default

#/etc/init.d/snmpd start


Monday, November 16, 2020

Reset GlobalProtect Agent

:stop server/agent palo

launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist

launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist


:start server/agent palo

launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist

launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist

Wednesday, October 28, 2020

GET Let's Encrypts Certificates (dns)

$sudo apt install certbot

$sudo certbot certonly \

  --server https://acme-v02.api.letsencrypt.org/directory \

  --manual --preferred-challenges dns \

  -d your.domain.com

## Add records TXT _acme-challenge.your.domain.com

$nslookup -type=TXT _acme-challenge.your.domain.com

#Certs Path

/etc/letsencrypt/live/

Tuesday, September 15, 2020

Show GIT Branch on Bash

ubuntu edit .bashrc
alpine linux .profile

show_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(show_git_branch)\[\e[00m\] $ "

Tuesday, September 1, 2020

Unable to 'apt update' my Ubuntu 19.04

sudo sed -i -re 's/([a-z]{2}\.)?th.archive.ubuntu.com|archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout