Task Scheduler on Win11

Use case – Run the script to Enable Chrome Sync disabled by Admin on every logon.

Create this powerscript and save as ScriptName.ps1

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Google\Chrome\' -Name 'SyncDisabled' -Value '0'

To run a PowerScript in Task Scheduler :

Follow this tutorial to create the Task for Task Scheduler – https://winaero.com/run-app-or-script-at-logon-with-task-scheduler-in-windows-10/

To schedule the PowerShell script, specify the following parameters:

  • Action: Start a program
  • Programscript: powershell
  • Add arguments (optional): -File [Specify the file path to the script here]
Read more: Task Scheduler on Win11

Source:https://blog.netwrix.com/2018/07/03/how-to-automate-powershell-scripts-with-task-scheduler/

To make sure that script also runs when the PC comes out of hibernate:

This is perfectly possible. Here’s a guide for you to follow:

1) Open Task Scheduler and click on “Create a Task” to create a new task.
2) In the new panel which opens, fill the “General” tab to suit your needs.
3) Next, switch to the “Triggers” tab and choose “New”. Another Panel will open. At the top of this Panel, choose “On an event” from the drop-down menu.

4) Then choose “Custom” under Settings, and hit “New Event Filter”. Create a “Custom Event Filter” with:

Event Level: Information
Log Name: System
Source: Power-Troubleshooter
Event ID: 1
Task Scheduler Edit Events

5) That was the important part. Now switch to the Actions tab and choose the program you wish to run.
6) In Conditions tab, uncheck the option labeled “Start the task only if the computer is on AC power”.
7) Finally, save the task by clicking on OK.

Source:https://learn.microsoft.com/en-us/answers/questions/794854/run-a-program-every-time-the-computer-comes-out-of

Unable to access network’ on android

Problem:

When I try to copy a word on a webpage google chrome gives me the option to open it in a new page in the same group so it searches for this word on google, this used to work always perfectly but it doesn’t anymore. 

Chrome opens a new page but it then shows me the error ‘unable to access network’.

Does anybody how I can fix this in the latest version of android on my Samsung galaxy

Solution

Type this to the address bar: “chrome://flags”

Enable this Chrome flag: “Contextual Search new settings”

Then go to Settings –> Google Services –> Touch to Search

Here disable the “Include surrounding text in Google searches” option

Source: https://support.google.com/chrome/thread/142596507/unable-to-access-network-on-android?hl=en

Finding files in subfolders

find . -name “foo*”

find needs a starting point, and the . (dot) points to the current directory.

find will find all files that match a pattern:

find . -name “*foo”
However, if you want a picture:

tree -P “*foo”
Hope this helps!

Piping find into grep is often more convenient; it gives you the full power of regular expressions for arbitrary wildcard matching.

~$ find . -print | grep -i foo

Personally I’ve got this shell function defined:

f() { find . -name “$1“; }

Note: Above line can be pasted directly to shell or added into your user’s ~/.bashrc file.

Then I can look for any files by typing:

f some_name

Alternatively you can use a fd utility with a simple syntax, e.g. fd pattern.

The basic find command syntax is as follows:
find dir-name criteria action
Where,

  1. dir-name : – Defines the working directory such as look into /tmp/
  2. criteria : Use to select files such as “*.sh”
  3. action : The find action (what-to-do on file) such as delete the file.

You want to remove multiple files such as ‘*.jpg’ or ‘*.sh’ with one command find, try:
find . -name "FILE-TO-FIND" -exec rm -rf {} \;


Finding based on file-type

find . -type f -name “*.ext” > list

Reset Mac Password

Use Recovery Mode to reset your password

How to recover a forgotten Mac password: Use Recovery Mode to reset your password

Apple includes a tool to replace a Mac’s password. This is the best option if you have completely forgotten your password. Follow these steps:

  1. Turn off your Mac (choose Apple > Shut Down).
  2. Press the power button while holding down Command + R. The Mac will boot into Recovery (we have a separate article about how to boot a Mac in Recovery).
  3. When you see the load bar appear you can let go of the keys. It may take a few minutes to load.
  4. Select Disk Utility and press Continue.
  5. Choose Utilities > Terminal.
  6. Enter resetpassword (all one word, lower-case letters) and press Return.
  7. Select the volume containing the account (normally this will be your main hard drive).
  8. Choose the account to change with Select the User Account.
  9. Enter a new password and re-enter it into the password fields.
  10. Enter a new password hint related to the password.
  11. Click Save.
  12. A warning will appear that the password has changed, but not the Keychain Password. Click OK.
  13. Click Apple > Shut Down.

Now start up the Mac. You can log in using the new password.

4. Use Target Disk Mode

Finally, if you can’t use any of the methods above, then your best trick is to use Target Disk Mode to recover what data you can from the lost Mac. This enables you to access the hard drive on your Mac from another Mac. Follow these steps:

  1. Shut down the Mac (Apple > Shut Down).
  2. Connect the Mac to another Mac using a Thunderbolt cable (if your Mac is old enough you might be able to use Firewire cable). Uunfortunately this trick does not work with USB. 
  3. Start up your Mac and hold down the T key while it boots.

The Mac in Target Disk Mode should now appear as a hard drive in the other Mac. You can use this Mac to recover data from the Mac.

How to stop someone else resetting your Mac password

Now you know how to reset your password you may be worried that if you can use Recovery Mode to reset the password, someone else could do the same thing – and once a person has got access to your Mac, you’ve usually lost control over it. There are some steps you can take to protect your data, though.

The best way to protect your data is to turn on FileVault encryption. This encrypts the contents of your Mac, and the Password Reset utility will not show until you unlock it with Disk Utility. When you set up FileVault you receive a Recovery Key (which you should print out) and a password. If you lose both of these your data will be lost forever.

You can turn FileVault on in System Preferences > Security & Privacy > FileVault.

Source: https://www.macworld.co.uk/how-to/mac/forgotten-mac-password-3594395/

Enable shortcut to change input language

Here are Apple’s instructions for changing shortcuts found in PH21531:

  1. Choose Apple menu > System Preferences, click Keyboard, then click Shortcuts.
  2. Select the action (Input Sources in your case) in the list that you want to change.
  3. Double-click the current shortcut, then press the new key combination you want to use.

You cannot use each type of key (for example, a letter key) more than once in a key combination.

  1. Quit and restart any apps you’re using for the new keyboard shortcut to take effect.

Filebot: Adding zero-padding

Filebot is a tool that I use for renaming tv shows and movies so that the NAS Media server can detect them and organize them properly.

Episode naming format

{n} - {s.pad(2)+'x'}{e.pad(2)} - {t}
{n} - {'Season '+s}/{n} - {s.pad(2)+'x'}{e.pad(2)} - {t}
{n}/{n} - {'Season '+s} [{y}]/{n} - {s.pad(2)+'x'}{e.pad(2)} - {t}

Movie + Folder Naming format

/Base/{n.colon(' - ')} [{y}]/{n.colon(' - ')} [{y}]{' CD'+pi}{subt}