The following is a method for creating a keyboard shortcut on a Mac such that the shortcut will lock the screen. This method involves using the Mac’s Automator and a bit of shell script. It is also important to set certain settings. We are going to show two different shortcut options. They can be run in parallel if desired. They also may be modified within reason and remain equally effective.
From Automator choose File –> New –> Service which will open a new automation dialog
Here you have two (inclusive) options:
From the automation dialog select Utilities from the left-hand pane and then Run Shell Script
From the automation dialog select Utilities from the left-hand pane and then Start Screen Saver (pictured)
What’s the difference?
The shell script puts the system directly into the suspended state.
Suspending the system (via script) is slower but requires no additional settings.
Launching the screen saver does just that.
Launching the screen saver requires certain screen saver settings (below) and is faster.
The Automation (Two Options)
This is the line of code for you to copy and paste as below: /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Again you will follow either the Run Shell Script path or the Start Screen Saver path:
Note the “no input” and the “any application” settings in both drop-downs for both methods below.
Via Shell Script (using Suspend):
Call the Run Shell Script something clear: LockViaSuspendShortcut
This is the line of code for you to copy and paste as above: /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
You will see the argument -switchToUserID for CGSession as well. This does not lock the screen. Do not use it.)
The Shell Script method (using suspend):
Via the Screen Saver:
… or Call the Start the Screen Saver something clear: LockViaScreenSaver
The Start the Screen Saver method:
If you need to delete an Automator Workflow, you can locate them in ~/Library/Services/
It may be possible to make an automation available to all users (untested) by placing it in /Library/Application Support/Apple/Automator/
Set Up the Keyboard Shortcut(s)
Once you have created these automations, you will only need to assign a shortcut for each.
Navigate to System Preferences –> Keyboard –> Shortcuts –> Services
Since you have used clear names per the above, you will have no difficulty identifying which automation is which.
The field to the right of the name of the automation holds the key combination.
Choose what you’d like and choose wisely.
LockViaScreenSaverShortcut is set as ctrl-alt-L
LockViaSuspendShortcut is set as shift-super-L
The mouse may need to be out of a VM in order for the shortcuts to be captured by the Mac.
Additional Screen Saver Settings
Open System Preferences –> Desktop & Screen Saver –> Screen Saver
Set “Start after:” as “5 Minutes“
Open System Preferences –> Security & Privacy –> General
Set “Require password” as “5 seconds”
These fives seconds will give you a small buffer to keep your screen from locking if you are reading an article and it goes blank.
Don’t like the normal date display in Ubuntu? It can be slightly modified using the usual methods, but if you want full customization you can do so with a tool called the dconf Editor. It’s a part of the dconf-tools package:
sudo apt install dconf-tools
Once you have it installed you can then run the dconf Editor. To create your own custom display for the time and date, dig down to this location:
Com –> Canonical –> Indicator –> Datetime
Change the time-format to “custom” and enter your desired pattern. I used this:
%a %d %b %H:%M
| %a %d %b %Y | %H:%M |
| %Y-%m-%d %a | %H:%M |
Feel free to experiment with other variables. This first configuration gives me day date month 24-hour:time.
Importantly there are two kinds of pools in Horizon: automatic and manual. Automatic pools are pointed to a specific template and spawn new machines based on that template, and manual pools will accept the importation of, really, any viable virtual machine.
But what if you find that you need to move a machine from one location into an automatic pool. There is no intended functionality for doing this. However, we are humans and we are clever.
I will lay out for you the procedures I used. We have a domain and our machines are all domain joined. You may want to make adjustments for your specific situation, but the essentials here should guide you nicely.
Before you begin, let your user know that there machine will be unavailable for half an hour to an hour and that you will want them to test access once you have made the changes.
Remove the entitlement for that user from the machine and the pool.
Remove the machine from the domain and shut it down.
Delete the machine object from Active Directory.
Use the Clone to Template function in vSphere to clone the machine to a safe template location.
(You may at this point delete the original VM.)
In Horizon, point the destination pool at your newly cloned template.
Add a new machine to the automatic pool from the template you just cloned.
Point the destination pool back to its preferred template.
(You may at this point delete the cloned intermediary template.)
Power on the newly added virtual machine and add back to the domain.
(Move it to the correct OU in AD.)
Entitle the user for the destination pool and newly cloned machine.
It’s a bit of a hassle but it has worked dozens of times for me.
Today Nautilus decided it just didn’t like my mounted USB devices. At first it was a brand new 64 GB FAT32 drive, and so I figured I would just reformat it. This didn’t change anything; Nautilus (the file browser in Ubuntu 14.04) was insisting that I had read-only permissions on the drive and would not allow me to write to it.
Apparently there is a bug (not necessarily in Nautilus because I am told this will work with other file browsers) that is pretty easily fixed.
The first one moves the configuration file for Nautilus (modify if you are using a different file browser) to a backup copy. The second kills (stops, terminates) the running Nautilus session. You will need to launch a file browser window to get Nautilus (or other) running again, but that should return your USB drives to writable.
We use Clonezilla periodically. I really like to use YUMI for creating a versatile thumbdrive capable of booting into several operating environments and various utilities (Clonezilla among them).
Recently I ran into troubles with my thumbdrive but only in relation to Clonezilla. I do not know what caused the misalignment, but I was able to sort out the matter and I am placing a record of that here.
In short, I was getting a host of errors worded similar to this:
failed to load com32 file
It looks like a change was made at some point in the way syslinux functions, but I didn’t dig too deeply into that. I have a friend who is using the same basic set up and his Clonezilla was working. I checked his drive out and compared it to mine to see what I could see.
I didn’t see anything worth commenting but I did notice that these four files were in the root of the multiboot directory:
These were also located in the syslinux folder in each of my Clonezilla folders (I have 32 and 64 bit versions installed). I simply hid those files (in each Clonezilla’s syslinux folder) and it fixed the Clonezilla boot process.
Sometimes you want an application to start when you log into a machine. In most new versions of Windows you can manage this within the Task Manager, there is a Startup tab. However, in Windows 2012 R2 there is no such tab in the Task Manager. Yet you may still wish for one.
Fear not; there is a solution.
If you want to add a startup item for the currently logged-on user only, use this command:
If you’d like something to start for any user which logs in, then use this version instead:
Now normally you can simply drag while holding the Alt key and when you drop you drop a shortcut in that location. This is true even for the first version of this command above; if you drop into that folder while holding the Alt key, you drop a shortcut into that Startup folder.
However, the Common Startup folder is a dangerous and protected system folder. You will not be able to create a shortcut in that folder.
So I said Yes and then moved that into the Common Startup folder. I had to confirm I wanted to do it, but it allowed the shortcut to be placed.
Why this is even an issue is a little beyond me. It must come up often enough to get others annoyed by it. You have some piece of software that is crashing your system sufficiently that you are unable to remove it using a regular boot. So, you boot into Safe Mode. Only problem is, the installer service is disabled during Safe Mode.
Well, let’s hack the registry a bit and sort that shit.
(Don’t be scared, but do proceed with caution and at your own risk.)
So log into your Windows 10 (or whichever, this ought to work even as far back as, ugh, XP) in Safe Mode (f8 is often useful to get there). Once you get in you can open the Registry Editor from a command prompt. Holding down the Windows key and pressing R (Win-R) will open the run dialog; then just type regedit and hit Enter.
Once in the Registry Editor navigate to HKEY_LOCAL_MACHINE—> SYSTEM—> CurrentControlSet—> Control—> SafeBoot—> Minimal and right-click on Minimal. From the local menu which pops up, you’ll want to choose New —> Key. Name this new key MSIService.
(I have seen one report where the name MSIService did not work and the user used MSIServer instead. Try MSIService first and go from there.)
Within the new key, MSIService, right-click on the item called Default and choose Modify from the local menu which pops up; then in the Edit String dialog set “Value data:” to Service. Click the OK button.
Ok, that gives the system what it needs to be able to run the Windows Installer service during Safe Mode.
(Note: if you are running Safe Mode with networking, you want will to do this same work also under HKEY_LOCAL_MACHINE —> SYSTEM —> CurrentControlSet —> Control —> SafeBoot —> Network, but I haven’t test that.)
Now let’s start that service so you can run your uninstaller (or installer for that matter).
In an Explorer (file browser) window, navigate to This PC (or Computer or My Computer) —> Local Disk (your disk, probably C:) —> Windows —> SysWOW64 (earlier systems it may be in System32) —> services.msc; then right-click on services.msc and choose “Run as administrator” from the local menu which pops up.
Now locate the Windows Installer service in Services, right-click on that, and choose Start from the local menu which pops up.
I recently updated my version of Evernote on Ubuntu and noticed that the titles of the notes were now invisible in the title field of the reading pane. This made it very difficult to type or especially to change a note title. Even copying and pasting was a challenge since I couldn’t tell if I had any or all of the title selected.
Essentially there is a dll in Wine that was in need of some wrangling. A dll or Dynamic Link Library is a Windows thing. You probably don’t want to know much about them except to say they are sometimes required for applications to function as expected or perform certain tasks.
With one line of code in your terminal (don’t fear the terminal, ok?) you can fix this problem:
winetricks -q riched20
That’s it. Run that command and when you again open Evernote you should be able to see the titles. I mean, if it worked for me why wouldn’t it work for you? Go for it!
What does it do? It installs the dll (riched20.dll) into the Wine directories. I guess Evernote needs that dll to display the titles in the title field in the reading pane. (The -q just means don’t ask me any questions.)