Hotspot on startup, armbian

Issue:
Use armbian-config to create a hotspot. The hotspot is well created, however, doesn’t start on next reboot. Have to go back to armbian-config and manage hotspot to start it again.

Solution:

/lib/systemd/systemd-sysv-install enable hostapd

Access Registry with PowerShell

Working with Registry is very similar to working with files and folders with PowerShell.
Set-Location cmdlet can set the current working location to registry.

PS C:\Windows\system32> Set-Location Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER
PS Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER>

The registry provider’s full name is Microsoft.PowerShell.Core\Registry, but this can be shortened to just Registry.

PS C:\Windows\system32> Set-Location Registry::HKEY_CURRENT_USER
PS Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER>

In addation, PowerShell has two pre-defined registry ‘drives’:
HKLM for HKEY_LOCAL_MACHINE
HKCU for HKEY_CURRENT_USER

PS C:\Windows\system32> Set-Location HKCU:
PS HKCU:\>

However, other registry roots are not defined.

PS HKLM:\> Set-Location HKCR:
Set-Location : 드라이브를 찾을 수 없습니다. 이름이 'HKCR'인 드라이브가 없습니다.
위치 줄:1 문자:1
+ Set-Location HKCR:
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (HKCR:String) [Set-Location], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

PS HKLM:\>

You can define other roots by yourself with New-PSDrive cmdlet.

PS HKLM:\> New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Name      Used (GB)      Free (GB)    Provider    Root    CurrentLocation
----      ---------      ---------    --------    ----    ---------------
HKCR                                            Registry  HKEY_CLASSES_ROOT

PS HKLM:\> Set-Location HKCR:
PS HKCR:\>

Modify File Time Stamps using PowerShell

Usages:
(Get-Item [filename]).CreationTime = [date/time]
(Get-Item [filename]).LastAccessTime = [date/time]
(Get-Item [filename]).LastWriteTime = [date/time]

PS C:\> (Get-Item .\test.txt).LastAccessTime = Get-Date
→ This command converts 'last access time' of 'test.txt' to current date and time

PS C:\> (Get-Item .\christmas.tree).LastWriteTime = '2016-12-25 AM0:00'
→ This command converts 'last write time' of 'christmas.tree' to specific date and time
Batch Processing with ForEach:
Get-ChildItem | ForEach-Object { $_.LastWriteTime = Get-Date }

PS C:\> Get-ChildItem | ForEach-Object { $_.LastWriteTime = Get-Date }
→ This command converts 'last write time' to current date and time of all files in working directory

PS C:\> $i = 0; Get-ChildItem | ForEach-Object { $_.LastWriteTime = (Get-Date).AddDays(-1).AddMinutes($i++) }
→ This command converts 'last write time' to yesterday with increasing minutes

How to prevent resizing terminal when using screen

# Long time I had this in my private screenrc file. But many people
# seem to want it (jw):
# we do not want the width to change to 80 characters on startup:
# on suns, /etc/termcap has :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:
#termcap xterm ‘is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l’
#terminfo xterm ‘is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l’

in /etc/screenrc