All Articles

Hosts File Not Working on Mac? Try This Fix

I've recently had to re-do this. This has happened too often for me, and it's just very annoying in general. There are many problems (and offered solutions) around /etc/hosts file, for chrome only as well as for the os x generally. I've noticed that the /etc/hosts file works just fine for curl, but does not work for chrome. This led me to believe that the problem was a chrome setting, but upon fixing it, I am less certain that Chrome is the culprit. My solution is below. Basically, the host file needs to be ASCII-compliant. I've had that file soft-linked and modified by a number of actors.

How to manually execute a SQL query in Ruby on Rails

I run into this just now. The wrong way: 

results = ActiveRecord::Base.connection.execute("select * from users limit 10")

The right way: 

results = ActiveRecord::Base.connection.exec_query("select * from users limit 10") 

Somehow the formet executes the query without returning a result. If you want to actually see the results of SELECT'ing something, use the latter query. (Which also means that you probably want to use the former for INSERT'ing, though I have not verified.)

Is HP Smart Tank 520 compatible with mac os?

The short answer is no. The box says, not compatible. Online on the HP website, you can download drivers that are supposedly for mac. But on my mac 12.5 Monterey, I was still unable to print from this multi-printer. 

I was able to print from a windows laptop however, using the same printer. So to me it seems that the HP 520 really isn't compatible with macs. 

Teaser Text

No.