Monday, March 20, 2023

Disable Windows 10 Web Search

 I had a need to disable the web search results in Windows 10 for a limited user. These two links were helpful:

Adding the Registry key in HKEY_CURRENT_USER works for the current user:

  1. Open regedit.exe.
  2. Navigate to HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer (create the Explorer key if it doesn't already exist).
  3. Create a DWORD value named DisableSearchBoxSuggestions and set it to 1.
  4. Restart your computer (or kill and restart all Explorer.exe process instances).
However, a limited user does not have permission to add registry keys. So, while logged in as an administrator, use this to show the SID for each user on the machine:

C:\>wmic useraccount get name,sid

That will give you the SID of each user. You can then look in HKEY_USERS to find their hive and create the key; however, they will only show up in HKEY_USERS if they are currently logged in to the computer. So switch to that limited user and login, then switch back to the administrator user and go into HKEY_USERS and find their SID, then create the DisableSearchBoxSuggestions as shown above.

Wednesday, March 10, 2021

What is reality and truth?

The societal tide is surging around the globe, with a myriad of opinions, persuasions, and perceived realities. Each of us navigates mortality based on what learn from our own personal experience and information we consume from a variety of sources. We are wise to develop and maintain an informed perspective of our world, yet we must also recognize that some of our interpretations may be incomplete or incorrect. True success and joy comes from growing our perception of truth and reality through humble awareness and study, nourishing our perception through personal prayer and revelation, and then pruning our perception based on divine guidance from the living prophet.

While serving as a counselor in the First Presidency, President Harold B. Lee explained the value of heeding the prophet’s counsel, even when our own views may differ from that counsel: “The only safety we have as members of this church is to do exactly what the Lord said to the Church in that day when the Church was organized. We must learn to give heed to the words and commandments that the Lord shall give through his prophet, ‘as he receiveth them, walking in all holiness before me; … as if from mine own mouth, in all patience and faith.’ (D&C 21:4–5) There will be some things that take patience and faith. You may not like what comes from the authority of the Church. It may contradict your political views. It may contradict your social views. It may interfere with some of your social life. But if you listen to these things, as if from the mouth of the Lord himself, with patience and faith, the promise is that ‘the gates of hell shall not prevail against you; yea, and the Lord God will disperse the powers of darkness from before you, and cause the heavens to shake for your good, and his name’s glory.’ (D&C 21:6)” (in Conference Report, Oct. 1970)

Tuesday, September 29, 2020

Learning from nature - light and darkness



Nature is an eloquent teacher, imparting profound truths through living parables. Many natural phenomena can be scientifically explained by the laws of physics. These same phenomena, when seen through spiritual eyes, can yield layer upon layer of insight that builds our faith and strengthens our understanding. One such living parable is the seemingly simple contrast between light and darkness. Darkness has no physical properties - it is solely the absence of light. Light always dispels darkness - emanating from its source in all directions as it pushes away the darkness. The brighter the source of the light, the stronger and farther it pushes into the darkness. Light and darkness cannot coexist in the same space at the same time - either light exists without darkness, or light is absent, leaving a void filled with darkness. While light may be dimmed or stopped by various barriers, it cannot be completely absorbed or depleted. A single source of light shines with the same brightness and intensity regardless of who, what, or how many witness that light.

So it is with us. As spiritual offspring of heavenly parents, our lives are a continuum of light and darkness. The more goodness and hope we bring into our lives, the less room there is for darkness and despair. A simple act of kindness, whether given or received, can quickly disperse a disproportionate degree of darkness. Our greatest example of a bright and radiant life is the source of light Himself, for "God is light, and in him is no darkness at all" (1 John 1:5). As we strive to continually fill our lives with light, we will increase our joy and fulfillment - and will bring light into the lives of others.

This coming weekend, we all have a wonderful opportunity to feast upon light (https://newsroom.churchofjesuschrist.org/event/october-2020-general-conference). Women and men with decades of inspired living will share encouragement, advice, and spiritual nourishment. If we choose to ignore them, whether it be through apathy, inconvenience, or negligence, we willingly forfeit significant spiritual warmth and sustenance. If we do avail ourselves to this source of goodness and inspiration, regardless of our present circumstances, our faith and hope will increase, our joy will be stronger, and our lives will be brighter.

Sunday, January 5, 2020

Book of Mormon

The dawn of a new year is often a time of reflection and commitment. Each of us enters this new year with a personal, prophetic invitation to study the Book of Mormon. In addition to the gospel truths taught from its pages, the Book of Mormon itself stands as the foundation of a testimony of the restored gospel of Jesus Christ. Whomever or wherever you are, I implore you to take seventeen minutes and listen to Elder Jeffrey R. Holland testify of the Book of Mormon during general conference in October 2009 (go to http://bit.ly/jrhbom).  During this apostolic testimony, Elder Holland said:

"For 179 years this book has been examined and attacked, denied and deconstructed, targeted and torn apart like perhaps no other book in modern religious history—perhaps like no other book in any religious history. And still it stands. Failed theories about its origins have been born and parroted and have died—from Ethan Smith to Solomon Spaulding to deranged paranoid to cunning genius. None of these frankly pathetic answers for this book has ever withstood examination because there is no other answer than the one Joseph gave as its young unlearned translator. In this I stand with my own great-grandfather, who said simply enough, 'No wicked man could write such a book as this; and no good man would write it, unless it were true and he were commanded of God to do so.'

If anyone is foolish enough or misled enough to reject 531 pages of a heretofore unknown text teeming with literary and Semitic complexity without honestly attempting to account for the origin of those pages—especially without accounting for their powerful witness of Jesus Christ and the profound spiritual impact that witness has had on what is now tens of millions of readers—if that is the case, then such a person, elect or otherwise, has been deceived; and if he or she leaves this Church, it must be done by crawling over or under or around the Book of Mormon to make that exit."

No one can deny that the Book of Mormon exists. Some may disregard, discredit, or disparage the book - but they cannot deny that it exists. Naysayers may contrive a myriad of theories regarding the origin and authorship of the book - but they cannot deny that its pages teach and testify of Jesus Christ. As stated by one of its prophetic authors, Nephi, Christ himself will testify of the authenticity of the Book of Mormon:

“And if they are not the words of Christ, judge ye—for Christ will show unto you, with power and great glory, that they are his words, at the last day;” - 2 Nephi 33:11

Given the divinity of the Book of Mormon and its power to bless our lives, it is up to each of us to define and refine our relationship with the book and its teachings.

Do we join the large and spacious throngs and ridicule the book, its origin, or religion in general? Do we let doubts or unanswered questions cloud our perception of the book and its purpose? Do we ignore or disregard the book because we are too busy or content to need its power in our lives? Do we admire the book and speak highly of it in occasional conversations? Do we spend a few minutes reading the book when it is convenient and circumstances permit? Do we make time to regularly and diligently study and ponder the book and its teachings? Do we share its peace and power with others as we might share our favorite pin, post, or podcast? If someone was watching our daily lives, how might they describe our relationship to and with the Book of Mormon?

Elder Holland and a countless host of others have witnessed to the truth and divinity of the Book of Mormon. I add my humble testimony to theirs - the Book of Mormon is, undoubtedly and unequivocally, another testament of Jesus Christ. Abiding by its precepts will bring peace and purpose to our lives.

Wednesday, May 8, 2019

Manually modifying a SQL Server *.bacpac file prior to importing

I encountered a situation where I needed to export a data-tier application (i.e. *.bacpac) from an Azure SQL Database and import it into a local instance of SQL Server. The *.bacpac created just fine; however, during import, it failed with a collation error. For various reasons, I did not want to modify the Azure SQL database and regenerate the *.bacpac. Instead, I found this helpful post:

http://inworksllc.com/editing-sql-database-azure-bacpac-files/

Those instructions utilize a file called dacchksum.exe that is available at:

https://github.com/gertd/dac/tree/master/drop/debug

Here is the process that I used:

  • Unzip the *.bacpac file (I use 7-zip, but any normal zip tool should work)
  • Open the model.xml file
  • Find the offending stored procedure, comment the body of the procedure, and add a return statement
  • Save and close model.xml
  • Zip all of the content into a new *.zip
  • Rename the new *.zip into a *.bacpac (e.g. newfile.bacpac)
  • Run the following command:
    dacchksum.exe /i:newfile.bacpac
  • Mark and copy the new checksum value
  • Open Origin.xml (from the unzipped folder)
  • Find the checksum (towards the bottom of the file) and replace it with the new checksum
  • Save and close Origin.xml
  • Zip all of the content into a new *.zip
  • Rename the new *.zip into a *.bacpac (e.g. newfile2.bacpac)
  • Import the new *.bacpac (using SQL Server Management Studio)
This process was successful ... except that importing a *.bacpac fails on the first error (it does not report all errors on the first run). After I fixed the first import error, it failed a second time on a different error, so I had to repeat the process multiple times. In my case, the *.bacpac was over 750 MB, so zipping everything multiple times was taking several seconds each time. I wondered if there was a more efficient process (where I did not need to zip, compute checksum, alter checksum, then zip again). I opened dacchksum.exe with ILSpy and found that the checksum is just a SHA256 checksum. Conveniently, PowerShell has a Get-FileHash cmdlet that does exactly that. Using Get-FileHash instead of dacchksum.exe, the revised steps are as follows:

  • Unzip the *.bacpac file
  • Open the model.xml file
  • Find the offending stored procedure, comment the body of the procedure, and add a return statement
  • Save and close model.xml
  • Run the following PowerShell command:
  • Get-FileHash fullpathto\model.xml | Format-List
  • Copy the new checksum value
  • Open Origin.xml
  • Find the checksum (towards the bottom of the file) and replace it with the new checksum
  • Save and close Origin.xml
  • Zip all of the content into a new *.zip
  • Rename the new *.zip into a *.bacpac (e.g. newfile2.bacpac)
  • Import the new *.bacpac (using SQL Server Management Studio)

This process was also successful, and was quicker because I only had to zip the content once.

Saturday, March 3, 2018

Printer friendly blogger posts

In a different blog, I had the need to print individual posts without all of the extra content (navigation, header, sidebar, comments, etc.). I found this post and adapted it as follows:


<style media='print' type='text/css'>
#header-wrapper, #header, .header, #sidebar-wrapper, .sidebar, #footer-wrapper, #footer, .post-meta-data, .comment-link, .comment-footer, #blog-pager, #backlinks-container, #navbar-section, .subscribe_notice, .noprint, .fauxcolumn-right-outer, .column-right-outer, .comments, #comments, .post-footer, .feed-links, .foot {display: none;}
#main-wrapper {width: 95%}
  .column-center-outer { width: 940px !important }
  /*.post-body {font-size:125% !important}*/
</style>

With the current version of Blogger, you need to edit your Theme and put this in the HTML <head> section.

Saturday, January 27, 2018

Synchronizing Photos between two Google Accounts

I have an interesting situation where I need to copy photos and videos from one Google Drive account (not Google Photos) into a separate Google Photos account. Without going into the contextual details of why I need to do this, here are the primary objectives:

  • Photos and videos are initially uploaded into Google Drive folders of account someone@domainA.com
  • Photos and videos need to end up in Google Photos of account someone@domainB.com
  • This is an ongoing activity (not a one-time activity)
  • I would prefer not to keep multiple copies of all files on my local machine
From what I have been able to tell, Google does not provide a simple way to accomplish the above objectives. The only way to accomplish these objectives is to download from one account and upload into the other account. However, I do not really want to do that manually on an ongoing basis. 

The solution is based on Google's Backup and Sync application. The application already allows you to add multiple accounts - but they must target different folders on your machine. With that limitation, I would need to manually copy all files from one synced folder to the other synced folder (and that would violate the objective of not keeping multiple copies of the files on my local machine). The solution is to use two different Windows accounts on your computer. The Backup and Sync application does not run as a Windows service at the operating system level; instead, it runs as a startup script for the Windows profile (e.g. it is only running while you are logged in). 

Setup steps:
  1. Make sure you have two different Windows accounts on your computer (e.g. one for each of the Google accounts that you want to sync.
  2. Create a file system folder that is outside of your Windows profile; perhaps you might call it C:\GoogleDriveAndPhotos
  3. Login to Windows as the first user (e.g. someone@domainA.com)
  4. Install Google Backup and Sync
  5. Add the someone@domainA.com account
  6. On step 2 of account configuration, add the folder that you created in step 2 (that is where you want all of your My Drive files downloaded to).
  7. On step 3 of account configuration, uncheck all options (you are not trying to upload anything from your computer into this Google Drive account)
  8. Complete the configuration and let the sync process complete (may take a while, if you have a lot of files/photos)
  9. Login to Windows as the second user (e.g. someone@domainB.com)
  10. Install Google Backup and Sync
  11. Add the someone@domainB.com account
  12. On step 2 of account configuration, uncheck all of the folders (you are not trying to download anything from this account to your computer)
  13. On step 3 of account configuration, choose the folder that you created in step 2 (that is where all of the photos/videos will be downloaded from the other account)
  14. Choose the option to only upload photos/videos (not all files). (I also chose the option to upload as "High Quality", not "Original")
  15. Complete the configuration and let the sync process complete (may take even longer, as upload speeds are often slower than download speeds)
Ongoing use:
  1. Periodically login to the first Windows account and let the sync process download new photos/videos
  2. Periodically login to the second Windows account and let the sync process upload new photos/videos