Author Archives: Error-Prone

Adding Email Aliases to Office 365 Groups via PowerShell

This is a “hidden” feature that can only be added via PowerShell at the moment. And web admin portal won’t reflect the changes you made via PowerShell. That means you can only view alias for Office 365 Group from the following PowerShell cmdlet.

First log into your admin account with PowerShell

Set-UnifiedGroup –Identity marketing@example.com –EmailAddresses @{Add="hi@example.com"}

Check if it works

Get-UnifiedGroup –Identity marketing@example.com | FL EmailAddresses

EmailAddresses : {smtp:hi@example.com, SPO:SPO_fa5eb50c-147e-4715-b64b-76af8be79767@SPO_f0712c15-1102-49c4-945a-7eda01ce10ff, smtp:marketing@example.onmicrosoft.com, SMTP:marketing@example.com}

Connect to Exchange Online PowerShell

Connect to Exchange Online PowerShell – Microsoft Docs

Set-ExecutionPolicy RemoteSigned # Windows only
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Remove-PSSession $Session # logout

UniFi Security Gateway (USG) Decrypt Error (Inform Error, aka “Adopting” Loop) for v4.4.28 Firmware

This is a known issue (bug) with USG 4.4.28.* firmware confirmed on official beta forum, the error would be like:

Sep 26 22:38:55 main-router mcad:  ace_reporter.process_inform_response(): Failed to get the decrypted data from custom alert response#012
Sep 26 22:38:55 main-router mcad:  ace_reporter.reporter_fail(): Decrypt Error (http://192.168.1.10:8080/inform)
Sep 26 22:39:10 main-router mcad:  mcagent_data.data_decrypt(): header too small. size=0, should be=40
Sep 26 22:39:10 main-router mcad:  ace_reporter.process_inform_response(): Failed to get the decrypted data from custom alert response#012
Sep 26 22:39:10 main-router mcad:  ace_reporter.reporter_fail(): Decrypt Error (http://192.168.1.10:8080/inform)
Sep 26 22:54:31 main-router mcad:  mcagent_data.data_decrypt(): header too small. size=0, should be=40
Sep 26 22:54:31 main-router mcad:  ace_reporter.process_inform_response(): Failed to get the decrypted data from custom alert response#012

Solutions (try them in the following order):

  • Disable period speed test
  • Reboot the controller
  • Force provision the USG
  • Try official unifi-util patch
  • Reset USG and readopt it
  • Upgrade/downgrade to a previously working version

Mine got everything back to work after resetting the USG.

Some tips:

You can run info to get some basic info what’s going on with your USG:

user@main-router:~$ info

Model:       UniFi-Gateway-4
Version:     4.4.29.5124212
MAC Address: 78:8a:20:7c:ba:1d
IP Address:  11.22.33.44
Hostname:    main-router
Uptime:      192 seconds

Status:      Connected (http://unifi:8080/inform)

How to Rebuild a RAID 1 Setup (WD My Book Duo) on macOS, the Right Way

This guide will talk about rebuilding a failed RAID 1 disk with WD My Book Duo on macOS, it should also works on Thunderbolt Duo or other RAID 1 setup.

Many other guides only tell you how to replace the whole two disks without restoring / rebuilding data for this common situation:

In a common case, your RAID 1 setup could fail with only one defective disk, while the other is online. If you see this status on your macOS:

  1. Buy a brand new disk, same size and model as your failed disk.
  2. Reboot your mac in recovery mode, this step is very important to make sure your disks are not used by macOS.
  3. In recovery boot, open Disk Utility.
  4. Rename your RAID set, for example if your RAID set is External-Raid, rename it to something like External-Raid-Rebuild or just some names different than your original, this is the most important step to make sure your RAID set wouldn’t be using after entering macOS system.
  5. Restart your system in normal mode.
  6. Login to your system, then open Disk Utility, congrats, you will see the new disk is now rebuilding.

Other notes:

  • Restraint editing/adding/removing files on your RAID set while rebuilding.
  • The rebuild process could take hours depends on your disk size (10-20 hours for a 4 TB + 4 TB RAID 1 setup).
  • After the rebuild complete, you can rename your RAID volume name back to original.

This is not the only way to rebuild your RAID with a failed disk. According to WD documentation, you can power on your My Book Duo without connecting to macOS (remove the thunderbolt cable), then the My Book Duo should rebuild it automatically. However, it’s really hard to know when the rebuild process will finish, there’s no special indicator status for this situation, so I prefer rebuilding in macOS. This could be the best method for me.

Download 4k or 1080p Videos via youtube-dl

$ youtube-dl https://youtu.be/LB_X_GgNXMM -F

Output:

youtube: LB_X_GgNXMM: Downloading webpage
youtube: LB_X_GgNXMM: Downloading video info webpage
[info] Available formats for LB_X_GgNXMM:
format code  extension  resolution note
249          webm       audio only DASH audio   56k , opus @ 50k, 201.84KiB
250          webm       audio only DASH audio   71k , opus @ 70k, 267.21KiB
140          m4a        audio only DASH audio  127k , m4a_dash container, mp4a.40.2@128k, 547.96KiB
171          webm       audio only DASH audio  131k , vorbis@128k, 547.52KiB
251          webm       audio only DASH audio  135k , opus @160k, 534.35KiB
160          mp4        256x144    144p   69k , avc1.4d400c, 24fps, video only, 221.40KiB
278          webm       256x144    144p   95k , webm container, vp9, 24fps, video only, 387.03KiB
242          webm       426x240    240p  186k , vp9, 24fps, video only, 623.64KiB
133          mp4        426x240    240p  213k , avc1.4d4015, 24fps, video only, 618.98KiB
243          webm       640x360    360p  416k , vp9, 24fps, video only, 1.29MiB
134          mp4        640x360    360p  440k , avc1.4d401e, 24fps, video only, 1.26MiB
135          mp4        854x480    480p  714k , avc1.4d401e, 24fps, video only, 2.08MiB
244          webm       854x480    480p  724k , vp9, 24fps, video only, 2.22MiB
136          mp4        1280x720   720p 1001k , avc1.4d401f, 24fps, video only, 3.06MiB
247          webm       1280x720   720p 1122k , vp9, 24fps, video only, 3.39MiB
137          mp4        1920x1080  1080p 1679k , avc1.640028, 24fps, video only, 4.86MiB
248          webm       1920x1080  1080p 1998k , vp9, 24fps, video only, 5.13MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k, 348.19KiB
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2, 962.59KiB
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 2.11MiB
43           webm       640x360    medium , vp8.0, vorbis@128k, 3.46MiB
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)
$ youtube-dl https://youtu.be/LB_X_GgNXMM -f 137+140

EdgeMAX EdgeRouter – L2TP IPSec VPN Server

Source EdgeRouter – L2TP IPsec VPN Server

Applicable to the latest EdgeOS firmware on all EdgeRouter models using CLI mode. L2TP setup is not configurable on web interface.

Enter configuration mode

configure

Configure the server authentication settings (replace with your desired passphrases).

set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret <secret>

set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username <username> password <secret>

Define the IP address pool that will be used by the VPN clients.

set vpn l2tp remote-access client-ip-pool start 192.168.100.240
set vpn l2tp remote-access client-ip-pool stop 192.168.100.249

Define the DNS server(s) that will be used by the VPN clients.

set vpn l2tp remote-access dns-servers server-1 <ip-address>
set vpn l2tp remote-access dns-servers server-2 <ip-address>

Define the WAN interface which will receive L2TP requests from clients.

Configure only one of the following statements. Decide on which command is best for your situation using these options:

(A) Your WAN interface receives an address through DHCP

set vpn l2tp remote-access dhcp-interface eth0

(B) Your WAN interface is configured with a static address

set vpn l2tp remote-access outside-address 203.0.113.1

(C) Your WAN interface receives an address through PPPoE

set vpn l2tp remote-access outside-address 0.0.0.0

Define the IPsec interface which will receive L2TP requests from clients.

set vpn ipsec ipsec-interfaces interface eth0

(Optional) Lower the MTU for L2TP traffic.

set vpn l2tp remote-access mtu <mtu-value>

Commit the changes and save the configuration.

commit ; save

You can verify the VPN settings using the following commands from operational mode:

show firewall name WAN_LOCAL statistics
show vpn remote-access
show vpn ipsec sa
show interfaces
show log | match 'xl2tpd|pppd'