Skip to main content

Posts

Showing posts from September, 2021

Unable to browse website or the internet

In today's digital world, browsing website is a must. And if unable to browse then it could be an issue especially if you need to get things done. You need a piece of code but unable to browse StackOverflow is quite terrifying for a person developing a simple program. Others don't care how things work, they just want to get things done and that's it. But if unable to browse a website there could be a lot of things involved. Here are some possible issues why unable to browse a site or the Internet. Of course the list below is just a small fraction of why unable to browse the Internet.   - Website or URL trying to browse is not available or server that host the website is down or offline - Website or URL is typed incorrectly on the address bar - Website is a non www URLs, example website is only http:\\thewebsite.com other than www.thewebsite.com - Website TLD or Top-Level Domain is incorrectly entered the site ends .net or .org .mil or other TLDs - Some website...

How to use regex in Linux Bash

Regex or regular expression uses a pattern that is compared to a string and will check if the pattern exists or the string matches the pattern. In Bash script a simple if then else and a regex pattern can be used to check if the pattern matches a set of input on a text file. Bash script below is a simple example on how to use regex in Bash using if then else. Script below uses this sample file "number_file.txt" with the sample text or contents shown below. a12567 b23567 c34568 12w678 23908 35107 23469 x1234 y3432 12094x 123y8 ==== #!/bin/sh patx="^[0-9]+$" while IFS= read -r line; do     echo "Text read from file: $line"     if [[ $line =~ $patx   ]]                then                  echo "Hey this one is alpahumeric --> $line."      else ...

PowerShell Ping IPV4 addresses

Ping a range of IPV4 and resolve its hostnames via PowerShell. Here’s a simple PowerShell code snippet to ping a range of an IPV4 addresses and any IP address that will reply will be shown as per the sample output below. #======================   ( 240 .. 254 | ForEach {     write $_     Test-Connection -computername "192.168.8. $_ "   -count 1 -erroraction 'silentlycontinue' | Format-Table -AutoSize   })   #====================== 240 .. 254 –- change this to a desired IP range from 1 to 254. 192.168.8. $_ -- change this IP Address on the IP Address configured or set on the network -count 1 –- ping 1 time -erroraction 'silentlycontinue' –- this will not display any errors on the screen if the IP Address can’t be found or is not set to reply to ICMP or ping protocol Format-Table -AutoSize –- if the device will reply with the hostname then the full name will be displayed on the screen and not trunca...

Office 365 Admin PowerShell basic commands

 Managing Office 365 via PowerShell CLI needs to have proper access rights or privileges.   First step is to connect to the Office 365 domain via an elevated PowerShell terminal. Connect-exchangeonline -userprincipalname email-admin@domain.com PowerShell for Office 365 is very handy. Below are just a few examples that might save some time and focus on other important task, or just simply enjoying more coffee time. Get or list aliases of a mailbox, email account or group mailboxes. Get-UnifiedGroup -Identity "Name of the Mailbox" | Select-Object DisplayName,@{Name=”EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_ -LIKE “SMTP:*”}}} | ft -wrap List the Primary Email of a group's mailbox using the group name. Get-UnifiedGroup -Identity "Name of the Mailbox"   | Select-Object DisplayName,PrimarySmtpAddress Change group primary email. Set-Unifiedgroup -identity "Group Name to change email" -primarysmtpaddress new-email@of-the...