update timezone on Windows RDS server

run “cmd” with Administrator permission

list current timezone on local machine

C:\Windows\system32>tzutil /g
Pacific Standard Time
C:\Windows\system32>

List all available timezone

C:\Windows\system32>tzutil /l
(UTC-12:00) International Date Line West
Dateline Standard Time

(UTC-11:00) Coordinated Universal Time-11
UTC-11

(UTC-10:00) Aleutian Islands
Aleutian Standard Time

update timezone to correct only

C:\Windows\system32>tzutil /s “AUS Eastern Standard Time”

C:\Windows\system32>

verify the change

C:\Windows\system32>tzutil /g
AUS Eastern Standard Time
C:\Windows\system32>

auto map network drive via powershell script

create a .ps1 script file with entry

“New-PSDrive -Name “S” -Root “\192.168.1.7\scan” -Persist -PSProvider “FileSystem”

setup task schedule to run this mapping script

in Actions tab, create new Action

1: start a program

2: Program/script: powershell

3: Add arguments (optional): -File C:\Users\li_s\Desktop\MapNetworkDrive.ps1

netflix-proxy github repo install 

git hub address: https://github.com/ab77/netflix-proxy

it has issue to install on Ubuntu machine, due to python issue, init will fail as well

run following commands in sequence

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
#sudo apt-get install python3.6 - no need run this one
sudo install passlib   #install passlib
apt-get update\
  && apt-get -y install vim dnsutils curl sudo\
  && curl -fsSL https://get.docker.com/ | sh || apt-get -y install docker.io\
  && mkdir -p ~/netflix-proxy\
  && cd ~/netflix-proxy\
  && curl -fsSL https://github.com/ab77/netflix-proxy/archive/latest.tar.gz | gunzip - | tar x --strip-components=1\
  && ./build.sh

after done, need manual update the password to enable you login

root@VM-16-6-ubuntu:~/netflix-proxy/auth# . admin-reset.sh
Please enter a new admin password:
~/netflix-proxy/auth ~/netflix-proxy/auth
~/netflix-proxy/auth
rc=0
root@VM-16-6-ubuntu:~/netflix-proxy/auth#

web management portal

http://xxx.xxx.xxx.xxx:8080/

Add IP

free up port 53 on ubuntu 20.04

It’s worth noting that you can free up port 53 by simply uncommenting DNSStubListener and setting it to no in /etc/systemd/resolved.conf. The other steps are for enabling a DNS server – without it, your system will not be able to resolve any domain names, so you won’t be able to visit websites in web browser, etc.

1. Edit /etc/systemd/resolved.conf with a text editor (as root), e.g. open it with Nano console text editor:

sudo nano /etc/systemd/resolved.conf

https://2944662652a498294082227cb31af4a2.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
And uncomment (remove # from the front of the line) the DNS= line and the DNSStubListener= line. Next, change the DNS= value in this file to the DNS server you want to use (e.g. 127.0.0.1 to use a local proxy, 1.1.1.1 to use the Cloudflare DNS, etc.), and also change the DNSStubListener= value from yes to no.

This is how the file should look after you’ve made these changes (I’m using 1.1.1.1 as the DNS server here, which is the Cloudflare DNS):

[Resolve]
DNS=1.1.1.1
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=no
DNSStubListener=no
#ReadEtcHosts=yes

To save the file using Nano text editor, press Ctrl + x, then type y and press Enter.

2. Create a symbolic link for /run/systemd/resolve/resolv.conf with /etc/resolv.conf as the destination:

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Here, -s is for creating a symbolic and not hard link, and -f is for removing any existing destination files (so it removes /etc/resolv.conf if it exists).

3. Reboot your system.

Port 53 should now be free on your Ubuntu system, and you shouldn’t be getting errors like “listen tcp 127.0.0.1:53: bind: address already in use” anymore.

You can check to see if port 53 is in use or not by running sudo lsof -i :53 – if port 53 is not in use, this command shouldn’t show any output.

You might like:

https://2944662652a498294082227cb31af4a2.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html

How to undo the changes

Do you want to undo the changes made by following the instructions in this article? This is what you must do.

1. Start by editing /etc/systemd/resolved.conf with a text editor (as root), e.g. open it with Nano console text editor:

sudo nano /etc/systemd/resolved.conf

And comment out (add # in front of the line) DNS= and DNSStubListener=no, then save the file. To save the file using Nano text editor, press Ctrl + x, then type y and press Enter.

2. Remove the /etc/resolv.conf symbolic link:

sudo rm /etc/resolv.conf

3. Reboot your system.

refer: https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html

Customize your Bash prompt

The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here is how to:

General 

Information 

  • \u: current username
  • \h: hostname up to the first ., \H: full hostname
  • \w: current working directory, \W: same, but only the basename
  • $(__git_ps1 "%s"): your current git branch if you’re in a git directory, otherwise nothing
  • \$: if the effective UID is 0#, otherwise $
  • \d: the date in “Weekday Month Date” format (e.g., “Tue May 26”)
  • \t: the current time in 24-hour HH:MM:SS format, \T: same, but 12-hour format, @: same, but in 12-hour am/pm format
  • \n: newline
  • \r: carriage return
  • \\: backslash

Colors & Styles 

  • colors have to be escaped (see General), color codes should be followed by an m
  • put \[\e[‹code›m\] and \[\e[0m\] around the part of your prompt you want to style
  • where ‹code› is a ;-chain of:
    • x: attribute of the text
    • 3y: foreground color
    • 4y: background color
  • x:
    • 0: normal
    • 1: bold
    • 4: underline
    • 7: reverse
  • y is the color:
    • 0 black
    • 1 red
    • 2 green
    • 3 yellow
    • 4 blue
    • 5 magenta
    • 6 cyan
    • 7 white
  • example: \[\e[0;33m\]prompt:\[\e[0m\]

Save your settings by writing export PS1='...' to your .bashrc or .profile.

Examples 

COPYexport PS1='\h \w$(__git_ps1 "(%s)") \$ '
=> mycomputer ~/apps/chess/tmp(master) $ _

export PS1='\[\e[33m\]\h\[\e[0m\]:\W\[\e[33m\]$(__git_ps1 "(%s)")\[\e[0m\] \u\$ '
=> mycomputer:tmp(master) tom$ _

# Henning's awesome TRON prompt 2.0.2 with current Git branch and success state of the last command (the syntax coloring here does not do it justice):
export PS1='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;30m\]\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;30m\]>\[\033[00m\] '
=> ✔ mycomputer ~/projects/platforms master > _

# Arne's epic timestamped prompt with return status indicator and status-colored (green if fresh, or red if unstaged, or yellow if staged) git branch:
export PS1='\[\e[01;30m\]\t`if [ $? = 0 ]; then echo "\[\e[32m\] ✔ "; else echo "\[\e[31m\] ✘ "; fi`\[\e[00;37m\]\u\[\e[01;37m\]:`[[ $(git status 2> /dev/null) =~ Changes\ to\ be\ committed: ]] && echo "\[\e[33m\]" || echo "\[\e[31m\]"``[[ ! $(git status 2> /dev/null) =~ nothing\ to\ commit,\ working\ .+\ clean ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\]\$ '
=> 03:13:37 ✔ arne:(master)~/projects/geordi$ _

# Arne's danger prompt for root use. No git information and alarming red and yellow (which you can't see here):
export PS1='\[\e[01;30m\]\t \[\e[31m\]\u\[\e[37m\]:\[\e[33m\]\w\[\e[31m\]\$\[\033[00m\] '
=> 03:13:37 root:/tmp/foo# _

# Kim's mix of those above with small changes. TRON promt with timestamp, return status indicator, hostname, git informations and working directory (but all non-bold).
export PS1='\[\033[01;30m\]\t `if [ $? = 0 ]; then echo "\[\033[01;32m\]ツ"; else echo "\[\033[01;31m\]✗"; fi` \[\033[00;32m\]\h\[\033[00;37m\]:\[\033[31m\]$(__git_ps1 "(%s)\[\033[01m\]")\[\033[00;34m\]\w\[\033[00m\] >'
=> 03:13:37 ツ mycomputer:(master)~/code/foo >_

# Kim's root prompt (the same as above without git and the hostname is red)
export PS1='\[\033[01;30m\]\t `if [ $? = 0 ]; then echo "\[\033[01;32m\]ツ"; else echo "\[\033[01;31m\]✗"; fi` \[\033[00;31m\]\h\[\033[00;37m\]:\[\033[00;34m\]\w\[\033[00m\] >'
=> 03:13:37 ツ mycomputer:~/code/foo >_

# Martin's prompt
export PS1='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;30m\]\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;31m\]\n>\[\033[00m\] '
=> ✔ mycomputer ~/code/foo master 
   > _

# Henning's danger prompt for root 2.1
export PS1='${debian_chroot:+($debian_chroot)}\[\033[43;30m\]\u@\h\[\033[00m\] \[\033[01;33m\]\w\[\033[00m\] \[\033[01;31m\]>\[\033[00m\] '
=> user@mycomputer ~/code/foo > _

# Klaus' modular prompt with git stash indicator
git_stash_size() {
  n=$( (git stash list 2> /dev/null || :) | wc -l )
  if [ $n -gt 0 ]; then
    echo -n " $n☰ "
  fi
}

normal='\[\033[00m\]'
red='\[\033[31m\]'
bright_yellow='\[\033[93m\]'
blue='\[\033[34m\]'
cyan='\[\033[36m\]'

status='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✗"; fi`'"$normal"
user_and_host="$blue"'`if [ $(whoami)="klaus" ]; then echo "k"; else echo "\u"; fi`@`if [ $(hostname)="Wheatley" ]; then echo "w"; else echo "\h"; fi`'"$normal"
branch="$red"'$(__git_ps1 "(%s)\[\033[01m\]")'"$normal"
directory="$cyan"'\w'"$normal"
stash="$bright_yellow"'$(git_stash_size)'"$normal"

export PS1="$status $user_and_host:$branch$directory$stash \$ "

# Niklas Hasselmeyer's warning if the ruby version has been changed via `rbenv shell`
if [ $RBENV_VERSION ]; then echo -n "\[\e[31m\][Ruby $RBENV_VERSION] \[\e[00m\]"; fi

See the attached screenshot for colorful examples of the above prompt settings (the user is arne on machine happycat in directory ~/code/geordi on the master branch).

Bash prompt examples.
Bash prompt with git stash indicator

refer: https://makandracards.com/makandra/1090-customize-your-bash-prompt

colour code

# Foreground colors
90   Dark gray  
91   Light red  
92   Light green    
93   Light yellow   
94   Light blue 
95   Light magenta  
96   Light cyan  

# Background colors
100  Dark gray  
101  Light red  
102  Light green    
103  Light yellow   
104  Light blue 
105  Light magenta  
106  Light cyan 


txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
bldblk='\e[1;30m' # Black - Bold
bldred='\e[1;31m' # Red
bldgrn='\e[1;32m' # Green
bldylw='\e[1;33m' # Yellow
bldblu='\e[1;34m' # Blue
bldpur='\e[1;35m' # Purple
bldcyn='\e[1;36m' # Cyan
bldwht='\e[1;37m' # White
unkblk='\e[4;30m' # Black - Underline
undred='\e[4;31m' # Red
undgrn='\e[4;32m' # Green
undylw='\e[4;33m' # Yellow
undblu='\e[4;34m' # Blue
undpur='\e[4;35m' # Purple
undcyn='\e[4;36m' # Cyan
undwht='\e[4;37m' # White
bakblk='\e[40m'   # Black - Background
bakred='\e[41m'   # Red
bakgrn='\e[42m'   # Green
bakylw='\e[43m'   # Yellow
bakblu='\e[44m'   # Blue
bakpur='\e[45m'   # Purple
bakcyn='\e[46m'   # Cyan
bakwht='\e[47m'   # White
txtrst='\e[0m'    # Text Reset

How to Turn Auto Suggest On or Off in Run and Windows Explorer

This shows you the steps on Windows 11 machine

In regedit, navigate to the location below. (see screenshot below)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete

create a string and type “no” to disable it, or “yes” to enable it

refer: https://www.sevenforums.com/tutorials/130778-windows-explorer-auto-suggest-turn-off.html

How to delete a protected EFI system partition with Windows 10, 8, or 7

As you probably know, in order to be able to store files on a hard drive, it needs to be prepared just right: it needs to be initialized, partitioned, and formatted just the right way. If you’ve bought an external drive in a store, the preparation has probably been already done by the drive manufacturer. However, what if you want the drive to be prepared differently? For example, you may want to re-format the drive, or change the partitions that it has. The way to do such tasks in Windows is to use the Disk Management tool that comes preinstalled with Windows.

To get to the Disk Management tool, click on the Start button, right-click on Computer, and choose Manage from the menu:

Opening Windows Computer Management console from Start menu

If you use Windows 10, right-click on the Start button, and choose Disk Management from the menu instead.

Before you continue, first things first: Disk Management is a very powerful tool, and with great power comes great responsibility! If you are not very experienced with computers, you can look, but better not touch and let someone more knowledgeable to do the job. Because with Disk Management it’s very easy to destroy your partitions and lose your files, if you don’t know what you are doing.

Windows Disk Management console

Encrypt and password-protect external drives with USBCrypt encryption software for Windows 10,8,7, and XP.

User rating:  4.7/5

Purchase or download a free trial. Read more…

The most important thing when using the Disk Management tool is to make sure you can identify the disk you want to manage in the list. Usually you can do it by the total size of the disk displayed, although it may be confusing. For example, in this example, a hard drive that’s described as a 60 GB drive by the manufacturer, is shown to have only 55.89 GB by Windows. (Apparently, the disk manufacturers and Windows have a different understanding of what a “gigabyte” is.) Also, if you have several disks of the same size attached, it may get even more confusing. If in doubt, better unplug all external drives except for the one you actually want to work with, to make sure you are not accidentally erasing data on a wrong disk!

In our case, the 60 GB disk (shown as 55.89 GB disk in the list) is Disk 4 (let’s remember this number, we will need it a bit later.) It has two partitions, one is a 200MB EFI partition that has no drive letter assigned, and another NTFS partition of the size 55.69 GB, that has the label test and the drive letter F:. Although these two partitions looks similar, they are treated very differently by Windows. If you right-click on the normal NTFS partition, you should see the normal menu that lets you perform various tasks on that partition, including the Delete Volume command:

Context menu for the regular disk partitions

However, if we right-click on the first EFI partition, the menu we get is completely disabled:

Context menu for the EFI disk partition is disabled

As you can see, the system partition is protected in such a way that even the powerful Disk Management tool cannot do anything to it. Note that it’s not because the partition is EFI, it’s because the tool that created that partition had marked it in a way that prohibits other tools to tamper with it. However, what if we want to delete the EFI system partition and re-initialize the disk from scratch?

While the Disk Management tool is helpless in this situation, fortunately Windows offers yet another tool, DISKPART, that can do things to the disks that Disk Management can’t. The tricky part is, that DISKPART is a command-line tool, that requires us to type commands into its command prompt to make it do what we want.

To get access to the DISKPART tool, first let’s open the Windows command prompt in the “administrator” mode. We can do that by clicking the Start button and entering cmd in the search box:

Locating the command line prompt using the Start menu

(If you use Windows 8 that has no Start Menu, you can get our StartFinity utility to get the Start Menu back.)

Make sure that cmd is highlighted on the menu above, but do not press the Enter key yet! Instead, press the Ctrl and Shift keys together, and while keeping them depressed, press Enter. The Ctrl+Shift combination makes the command prompt to open in the “administrator” mode. To start the DISKPART tool, enter the diskpart command into the command prompt window:

Starting the DISKPART command from the command prompt

This should display the DISKPART command prompt. The first command we should use is list disk that should display the list of the disks currently connected to the computer:

Listing the disks with the DISKPART command

Password-protect and hide personal files and folders with Folder Guard for Windows 10,8,7, and XP.

User rating:  4.6/5

Purchase or download a free trial. Read more…

Again, it’s very important to properly identify the disk we want to work with in the list. Our 60 GB disk is still listed as Disk 4 with the capacity 55 GB. Once we are sure that this is the disk we want to re-initialize, we need to select it, by entering the command select disk 4 (yes, that’s how selection is usually done when using the command line tools!). Then, let’s use the list disk command again, to confirm that the disk in question is indeed now selected:

Selecting the disk with the DISKPART command

After double-checking that Disk 4 is now selected (it should have the star character * in front of its label), it’s time to finally issue the command that will erase everything on the disk 4, including the protected partition. The command that does that is clean. Note that this command erases everything on the selected disk, all partitions, protected or not. If you still have files on other partitions of disk 4 that you want to keep, you should exit now and backup those files, because after using the clean command all such files will be erased without a trace!

Erasing the disk with the DISKPART clean command

After the clean command is done (it should take no more than a few seconds), we get a fresh disk with all partitions erased. We can exit the DISKPART command prompt (by typing exit into its command line), and go back to the Disk Management tool (see above how to open it.) When it starts, it automatically detects the presence of the clean disk and prompts us to initialize it:

Initializing the clean disk with the Disk Management tool

Press OK and the newly cleaned disk will appear in the list. The difference is, the protected EFI partition is gone! (The normal NTFS partition that used to be on the disk 4, is gone, too.) The disk is now ready for you to start creating partitions, formatting them, and do other things as needed:

Working with the clean disk with the Disk Management tool

Note that if you are trying to erase the system disk that hosts the C: drive where Windows itself is installed and running, then even the powerful DISKPART command can’t work: Windows simply refuses to erase the drive from which it is running. To erase such a disk, you need to physically remove it from the computer, attach it to another computer as an external drive, and then use DISKPART on that computer to erase the disk.

Happy disk managing!

Ref: https://www.winability.com/delete-protected-efi-disk-partition/