Category: Little Tips

Apple TroubleshootingLittle Tipsmacbook

How to Show Hidden Files on Mac

To show hidden files and folders on Mac,

  • Launch Terminal
  • Type the following command then press Enter:
defaults write com.apple.finder AppleShowAllFiles YES

To hide the hidden files again, just type the same command but replace YES with NO as follows

defaults write com.apple.finder AppleShowAllFiles NO
  • After typing the appropriate command, look for your Finder icon (most likely on your Dock), then right-mouse click on it while holding the Option/Alt key of your keyboard. This will display a contextual menu from which you click Relaunch, to relaunch the Finder browser with your new visibility settings applied.

Now, if all you are looking for is how to display your Library folder in your user home folder, we have the steps in this short guide.

Advertisements
Apple TroubleshootingLittle Tipsmacbook

How to Show (Unhide) the Library Folder on Mac

To display your Library folder in your user home folder,

  • In Finder, go to your user’s home folder (usually similar to your username on the computer), then while you have that open in Finder,
    • go to the View menu in your menu bar,
    • click on Show View Options, then
    • in the new window that comes up, check the box next to Show Library Folder

That should make your Library folder visible among the other folders inside your user home folder.

Little TipsPythonWeb Development

Python, AttributeError: ‘module’ object has no attribute ‘config’

Four years ago, when I first started learning Python, I came across a problem that would later on become a “Famous Question” on StackOverflow. You may be reading this article because you encountered the same problem.

Traceback (most recent call last): File “C:\Users\myname\documents\visual studio 2010\Projects\PythonApplication 1\PythonApplication1\RunSikuliOnVM.py”, line 97, in logging.config.dictConfig(LOG_DICT_CONFIG_OnVM) AttributeError: ‘module’ object has no attribute ‘config’ Press any key to continue . . .

So, I will quickly suggest you check what turned out to be my problem.

I had imported a module into my code and later on made reference to that module by calling a specific attribute, but there was no such attribute in the module. Or at least so thought my Python interpreter. The quick fix for the error that I had gotten turned out to clear the cache of my interpreter. An example of how to do that with an interpreter is in the documentation for PyCharm.

This seems to be what is meant by the Python 3 documentation when it warns that “multiple evaluations of the same attribute reference may yield different objects.” I extrapolate and conclude that the error I am observing is somewhat of a “different” result I am getting.

Now for those interested in understanding the AttributeError for its own sake, another part of the Python documentation describes the exception in these terms:

exception AttributeError :Raised when an attribute reference (see Attribute references) or assignment fails. (When an object does not support attribute references or attribute assignments at all, TypeError is raised.)

 

The problem with the case at hand is that the config module does have a config attribute. This is why I posit that it is the caching issue that is the problem here since the interpreter may be referring to a totally different module than the logging module your code may be calling in this instance.

Note: This article is still in development even though it has been published to offer some beginning of a solution to those dealing with the AttributeError: ‘module’ object has no attribute ‘config’ exception.

Little TipsWindows 10 TipsWindows PC

How to Record and Capture Every Step You Take and Click in Windows – Problem Steps Recorder

Have you ever wondered how to record all the steps that you went through to get to an error in a program you are using on Windows? There is an app for that! Like, literally, though! Microsoft shares the following guide on their support page.

Pro-Tip: What is cool is that you can use this application to record the steps on how to use a new piece of software to your friend or family member who asks. And if you are in enterprise, this is a handy tool for designing a Standard Operating Procedure manual.

To record and save steps on your computer

  1. To open Steps Recorder, select the Startbutton, and then select Windows Accessories > Steps Recorder (in Windows 10), or Accessories > Problem Steps Recorder (in Windows 7 or Windows 8.1).
  2. Select Start Record.
  3. Go through the steps to reproduce the problem you’re trying to diagnose. You can pause and resume the recording at any time.
  4. (Optional) As you record, select Add Comment, use your mouse to select the part of the screen that you want to comment on, type your comment, and then select OK.
  5. When you’re done, select Stop Record.
  6. Review the record of the steps you followed to make sure it shows what you want it to show. Select Save, name the .zip file, choose where to save it, and then select Save. Now you can attach and send this .zip file to the person helping you troubleshoot the problem on your PC. It can be viewed in any web browser.

To adjust settings

  1. In Steps Recorder, select the down arrow next to the Help button, and then select Settings.
  2. You can change the following:
    • Output location.If you don’t want to be prompted for a location and file name every time you save a file, select Browse to set a default location and file name.
    • Enable screen capture.Select No if you don’t want to capture screen shots—for example, if the screen might reveal personal information that you don’t want to share. The app will still record a text description of your steps.
    • Number of recent screen captures to store.The default is 25 screens, so if you need to record more than that, increase this number.

Please note that this application will not record text that you type in fields, some programs will not work with this app if they fill up the screen, the settings you make for your new recording will not be permanent. When you close the Steps Recorder or Problem Steps Recorder app, the settings you made for the session will be lost.

If your Windows System does not have this app or if there are functionalities you need, the site alternative to suggests some options.

Little TipsmacbookWindows PC

How To Re-Open the Tab You Just Closed on Chrome, Firefox, or Internet Explorer

Did you just accidentally close the web browser tab you meant to keep open? You can get it back with a quick shortcut.

On Windows: Ctrl-Shift-T.

On Mac: Command-Shift-T

Bonus: Ctrl-T Opens a new tab that will just sit there waiting for you to do something with it.

That’s it for today! Unless you are interested in exploring more Mac or Windows Keyboard Shortcuts.

Apple TroubleshootingBackupLittle Tips

Macbook Won’t Boot Past Gray Screen With Apple Logo

You probably just want to jump straight to the solution. So, here it is:

  1. Unplug all peripheral devices from your computer.
  2. While holding Option + Command + R + P, Power Up the computer, listen for 1st chime, then 2nd chime, then immediately release all the keys you were holding and watch the computer come to life.*
  3. Proceed to backing up your data onto an external hard drive or other solution you have at hand for backup and remember to backup on a regular basis.
  4. You are good to go!

Now, What Does Command + Option + R + P Do?

Glad you asked! I did not know either. But I looked  That key combination helps reset the NVRAM, sometimes called PRAM, on your Mac. The PRAM is a type of Non-Volatile RAM on your computer that stores some important parameters about your computer’s peripheral devices. This is why you are to unplug all peripheral devices as a first step of this troubleshooting.

According to Apple, “If you experience issues with sleep, wake, power, charging your Mac notebook battery, or other power-related symptoms, you might need to reset the SMC (System Management Controller),” which involves a different set of keys.

Lessons Learned From This Case of Mac Troubleshooting

Lesson Numero Uno: Always backup your computers! It is an investment worth it considering that most external hard drives cost way less than the price of a brand new computer. So, get on the Internet and look up best ways to backup your type of computer and go ahead and do it. You can also just ask your trusted and proven tech-savvy rafiki (translate “friend”) how it is done.

Finally, I want to mention that, as you would quickly notice by glancing on the keyboard nearest to you, the key combination that brings your Mac back to life requires some dexterity you could get from some practice with a keyboard or piano. So, lesson learned, find a piano class and start the lessons as soon as you can.

References:

320px-Apple-Wireless-Keyboard-German from Wikipedia
———–
* The only time this would not work is if the problem is totally unrelated to the solution I am offering. Haha! Smart! I figured that one out by myself!

RafikiTechnology regular expression cheatsheet
Little TipsWeb Development

Regular Expression

This is more of a note-to-self type of post.

You know that series of symbols and characters in a chain following each other? Sometimes you will find them with a find, replace, or find and replace function.

Examples:

  • This processes a URL:
  • somefunction.replace(/^http[s]{0,1}:\/\/[^\/]*\/?/, '/')
  • From WordPress: The following example removes all HTML comments in the first pattern, and causes a favicon (with any filename extension) to be loaded from another domain in the second pattern:
    #<!--.*?-->#s =>
    #\bsrc="/(favicon\..*)"# => src="http://mycdn.somewhere.com/$1"

Well, they are called regular expressions and you can learn more about them at some of these sites:

Any comments, suggestions, or questions? Please drop a note.