Git Product home page Git Product logo

gasmask's Introduction

Gas Mask

Build Status

Gas Mask is simple hosts file manager for macOS. It allows editing of host files and switching between them.

System requirements

Runs on Lion, Mountain Lion, Mavericks, Yosemite, El Capitan, Sierra, High Sierra and Mojave.

Download

Download latest version (0.8.6)

Installation

Drag the application from Downloads into Applications folder. The first time you launch it, it will ask for your password, because it needs escalated privilege to modify your /etc/hosts file.

How it works

Gas Mask monitors /etc/hosts system file and updates it with your activated hosts file.

Gas Mask stores your custom hosts files in ~/Library/Gas Mask directory.

Application log can be found in ~/Library/Logs/Gas Mask.log. Its worth having a look for errors in there when posting an issue.

User Guide

Gas Mask usually operates in the background. It adds a tray icon, where you can access the main editor window and quickly switch between hosts files.

The main editor consists of three parts: Toolbar, a list of your hosts files on the left, and file editor on the right. Initially you will have a single file called Original file under Local, which is a copy of your original /etc/hosts file.

To add new files, click Create(+) button in the toolbar and select the type of file (Local, Remote or Combined).

To remove a file, select it and press the Remove button in toolbar.

To activate a file, select it and press Activate button in toolbar, or select it from tray icon when the editor is hidden. Gas Mask will update the /etc/hosts file with the currently activated file. The active file is marked with a check in the editor list, and can also be displayed next to Gas Mask tray icon (Preferences > Show Host File Name in Status Bar)

Local files

These are ordinary local files that you can edit.

Remote files

These are files that Gas Mask downloads and synchronizes from remote URLs. You can adjust how often they sould update in Preferences, or force an update from tray icon. You cannot edit these files, as they are be overwriten by update.

  • NOTE the current version has a bug that allows remote files only from http:// sources (no https://)

Combined files

This is where Gas Mask shines compared to other hosts managers for MacOS. A combined file doesn't contain hosts entries, but a list of local and remote files.

Where to find hosts files

A great source of curated hosts files can be found at https://github.com/StevenBlack/hosts

Building Gas Mask

Gas Mask can be built with XCode 10.1

gasmask's People

Contributors

2ndalpha avatar alistairmcmillan avatar amuraco avatar dannycork avatar fjh658 avatar jvanoostveen avatar nkantar avatar receptor avatar softwarebouwer avatar traderstf avatar trevershick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gasmask's Issues

Icon in red if host file is less than # lines

Sometimes when you temporally 'disable' by using the 'default' 4 lines, you forgot to switch back to the full host file with all your blocked domains.

It would be nice to be able to add a red dot/icon... if the current host file selected is less than # lines.

The number # can be set in the Preferences.

Thanks a lot.

Mavericks single localhost entry issue

Does this project handle the slow DNS resolution issue described here: http://stackoverflow.com/a/10200111/79201

In short you can only have one localhost entry. Except some people experience the opposite issue/solution.

Example:

127.0.0.1 localhost example1.dev example2.dev .... exampleN.dev

vs

127.0.0.1 localhost
127.0.0.1 example1.dev
127.0.0.1 example2.dev
# ....
127.0.0.1 exampleN.dev

Requires support for GateKeeper on Mountain Lion

What steps will reproduce the problem?

  1. Try to install on Mountain Lion 10.8.2
  2. GateKeeper prevents installation

What is the expected output? What do you see instead?
Expected to be able to install gasmask with standard security settings.

What version of the product are you using? On what operating system?
Gas Mask 0.6 on OSX 10.8.2

Please provide any additional information below.
Please refer to http://support.apple.com/kb/HT5290
It suggests contacting vendors and ask them to consider obtaining a supported Developer ID.

There is of course a work around detailed in the referenced article to reduce the security level or by ^+click > open.

Do not show a file at open

Some host files are huge and takes quite long to display.
By not showing/selecting any file at opening, this allow to quickly edit any file.
Thanks a lot.

File - Remove - Shortcut

The shortcut to the menu File - Remove should be more complex than simply the delete key.

It is too dangerous.

CMD-SHIFT-DELETE probably better, must other similar applications.

Is "Remove" the good word, is it not rather delete?

Confirm removing a file

Feedback from email:
"In a flurry and just accidentally deleted one of my configs .. might be an idea to a) move the 'remove' button away from the 'save' button or b) Add a 'delete confirm' dialogue."

Sidebar display bug

The maximum allowed width of the sidebar is not wide enough to prevent scrolling horizontally. The blue "changed" indicator is only half visible:

screen shot 2014-02-12 at 9 31 03

Scrolling to the right reveals the rest of it:

screen shot 2014-02-12 at 9 31 09

Additionally, narrowing the sidebar hides more of the contents, as if the contents have a fixed width.

Expected behavior: The contents of the sidebar do not scroll horizontally. The blue "changed" indicator sticks to the right edge of the sidebar as it is resized.

Hardware: Mid-2010 MacBook Pro 17"
OS: Mavericks 10.9.1

Application or Icon - Quit to ask stop confirmation

If you Quit the Application, with the menu or the shortcut, GM is no more active.

It is "dangerous", you might not notice it when you thought you will just quit the Editor, but not stop Gas Mask.

Both quit, application and icon, should ask a confirmation to be sure that's the user really want stop GM and not just close the editor.

Prevent Accidental Deletion

I switched windows to the editor and hit the delete key (mac) with the intention of deleting some test in the edit pane. Instead, I ended up deleting one of my hosts files that I had been incrementally updating for months. There was no way to recover it.

It would be nice to have the files go directly to the trash can and not allow deletion of hosts files via the delete key,forcing the user to right-click delete or explicitly hit remove button, so the intention is explicit.

cannot highlight with shift+arrow

I can highlight a row via shift+down-arrow-key but I cannot select text via shift+left-arrow-key or shift+right-arrow-key which makes it kind of annoying at times. It's a minor one but would improve usability.

Rename Menu "Create * " by "New * "

Unusual menu name are used

" Create " is " New "
" Create From URL" is "New from URL..." (or Import from URL)

" Create Combined File " is "New Group "
because the fileS are not combined (into one) it is just a Group made by links to other individual files.
Edit (and save) a file and the Group is also updated.

I suggest closing all the menu, rename... issues and make one "Menu 2015" and clear and organize all of them, by thinking a little bit also to future new features.

Boss, what do you say ?

Unable to have Gas Mask open at login in Lion 10.7.5

What steps will reproduce the problem?

  1. Change setting in Gas Mask to "Open at Login"
  2. Restart computer
  3. Check to see if Gas Mask is running.

What is the expected output? What do you see instead?
Expect Gas Mask to be running. Instead, nothing in the menu bar, and nothing in the Activity Monitor

What version of the product are you using? On what operating system?
OS X 10.7.5, Gas Mask v0.7

Please provide any additional information below.
I also tried manually adding Gas Mask to the login items for my user, still didn't work.

http://code.google.com/p/gmask/issues/detail?id=76

Multiple check hosts

Gas
Local

  • Original File
  • Prepublish Hosts
  • Another chekced hosts file
  • A hosts not checked.

Remote

  • A chekced remote hosts file
  • Unchecked

Show Editor Window

Preferences


Quit Gas Mask

Why don't you post a compiled binary?

Love this app. Its right up my street. Any chance you could post a compiled binary for those of us who couldn't compile an app to save our lives?

I'm presuming 0.8 is more or less ready from this #14

Thanks

Highlight color of selected host not from System Preference

Just FYI.

When you select/click on a Host file in the left vertical bar, the color is Blue.
In System Preferences - General - ~Highlight Color is Orange, my setting.

I don't know what Apple GUI specs says...
Take a look at Apple Mail, some are grey, blue or orange in different part of the app.

On that matter, if blue is ~hardcoded, it would be better to use dark-grey for the highlight color, like in Mail, to better see the check mark when the Activated Host File is selected.

Dark mode in 10.10

On latest build of Yosemite, Gas Mask icon is simply invisible when using Dark mode.
dark_mode

Hosts File Restored

osx 10.9
few minutes it will appear in notice center
External application has changed the hosts file

Accelerate and Reduce Host File Sizes

I have read several articles about reducing the host file, here is a summary.

Using 0 is

  • smaller than 127.0.0.1, it is 1 character instead of 9.
  • faster because 0.0.0.0 or 0 block the connection immediately. Where as 127.0.0.1 tries to connect first, and then must go through the loopback.

An additional way to reduce the host file size is by grouping several hostnames on one single line.

Obviously, removing duplicate hostnames, empty lines, useless spaces or tabs, and comments will also help.

An example:

127.0.0.1         localhost
255.255.255.255   broadcasthost
::1               localhost
fe80::1%lo0       localhost

# Comment here
127.0.0.1      host1
127.0.0.1      host2
127.0.0.1 host3
127.0.0.1 host4
192.168.2.7    testa#test for john
192.168.2.7  testserverb
0 adstat.com # naughty tracker
0 mk1.adstat.com
0 mk2.adstat.com
0 mk3.adstat.com
0 mk4.adstat.com
0 mk5.adstat.com
0 mk6.adstat.com
127.0.0.1      host2 #look a duplicate

This host file becomes, by using all these technics including the 9 limit:

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
0 host1 host2 host3 host4 adstat.com mk1.adstat.com mk2.adstat.com mk3.adstat.com mk4.adstat.com
0 mk5.adstat.com mk6.adstat.com
192.168.2.7 testa testserverb

The first file is reduced by almost 55 %.

When you have a host file of 2617 KB, that makes a huge difference, it is reduced by ~44 %.
For a huge host file, take a look at http://sourceforge.net/projects/adzhosts/

WARNING

  • On some OS or OS specific versions:
    • a maximum of 9 hosts on one line are recognized, the following hosts on the line are ignored.
    • a single 0 does not work, use 0.0.0.0 instead, and some do not even support 0.0.0.0 and multiple hostnames on a line.
  • 127.0.0.1 must be kept for "localhost", don't use 0.0.0.0 or 0 or some programs might encounter problems!

Have a nice day.

Strings "From/For" changed into lowercase

In menu
"GM - Check For Updates..."
"File - Create From URL..."

For and From must be "for" and "from"

I report all the details I saw... so they are listed, don't shoot me!

keyboard text selection issues

trying to select text using common keyboard shortcuts is buggy. Alt+shift+left/right does not work. Alt+left/right works but if you want to select a word of text you are out of luck. ctrl+shift+left/right has the same effect as cmd+shift+left/right.

Must show a Save confirmation dialog

If you edit one or more files, GM must ask if the edited file(S) must be saved.

It can happen when you:

  • Close the editor window
  • File - Quit
  • Menu Shortcut CMD-Q
    but also if while the editor is opened, you use the
  • Quit menu from the Icon in the menu bar!

The problem can be to manage several modified files at the same time.

What would be the best...?

  1. to show immediately the dialog when you "leave" the current file, either by any type of quit or by selecting another one.
  2. to show, one after another, a dialog for EACH modified file only when any type of quit occurs.
  3. to show a dialog to save ALL modified file at once.

The second I think is better, if you copy-paste a lot between few files, being obliged to save each time is

Dead Project?

Is this project dead? Is it ever going to be revved to work/compile using Xcode 5?

Normalize line endings

  1. Copy host entries from document with different types of line endings
  2. Paste into Gas Mask
  3. Host file doesn't work properly

I would expect the host file to work

Version 0.6
Mac OS X 10.7.5

Background:
I set someone up to use Gas Mask. Someone on a Windows box emailed them host file entries. They opened the email in Outlook Mac 2011, copy & pasted the entires over. The entires would not work. Then I opened the host file in a text editor (Coda) and got a warning about line endings. I converted them all to LF and then the host file worked fine.

http://code.google.com/p/gmask/issues/detail?id=68

the combined host file can't reduce.

What steps will reproduce the problem?

  1. create a combined host file.
  2. add some local (maybe remote) file in this file.
  3. delete some one host in the combined file.

What is the expected output? What do you see instead?
It should could be deleted, but only can add, can't delete any one line.

What version of the product are you using? On what operating system?
version 0.7
OS X 10.8.4

line break

when i put a lot of domains in one line, there is no automatic line break at the end of the gas mask window, so i can't see what i'm writing.

Hack to change 127.0.0.1 into 0

Hello,

Is it possible to quickly hack/change/hex edit 127.0.0.1 into 0?
To use 0 instead of 127 on each line.

Only the first 4 lines perhaps needs 127 I think.

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

Just that new compilation would be great.

So the editor does not highlight 0, see my other post about rather using 0.

Reorder the list

I would very much like to reorder the listing in the menu and in the app itself, however I seem to keep getting blank host files from using combinedhosts.
Is there something that depends on the hosts being in a particular order?
I am just trying to have:
Combined
Local
Remote
instead of the current:
local
remote
combined

Sync Gas Mask hosts

Firstly, Gas Mask is brill.

Secondly, it would be even more brill if we could sync the hosts files, as I have an iMac and Macbook. Perhaps store the settings files in Dropbox or something.

Thanks!

Option to show/hide the locals/combined in menu list

As developer I create a local host file for every domain and combine it with a 'defauls' local file, so I don't need to add all default hosts to all my files (having myself from some work when a default host changes).

When having about 30 items in your local and combined list the menu dropdown will be very long. Having an option to hide the locals from this list (so it will only show the combined files) would be nice.

Delete Gasmask

I cannot delete Gas Mask from my machine. When I try I get the dialog message that Gas Mask is open, but in Force Quit Applications windows it is not listed, it does not show up in my dock as open as well.

Automatically add www. - hide 127.0.0.1 and 3 Local+Broadcast

This will no more display the 'real' file but a cleaned version.

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

127.0.0.1       thisone.com
127.0.0.1       another.org
127.0.0.1       www.thisone.com
127.0.0.1       www.another.org

All the lines above would be shown as

thisone.com
another.org

As 127... = locahost, no need to shown 127... in front of each line.

The 3 local+broadcast can be in GM preferences, if one setting is enough for everyone.
Or as a 'header' file that will be added to all others files, automatically combined.

Adding automatically the www. would create few useless lines but it's simple and will avoid to forget some.
Thanks,

Better remote hosts file name

Gas Mask is awesome, thanks for making it. I do have a feature request though: for remote host files, either parse the file for the name or take the name from the file. That way, if you're adding multiple from the same domain, you know which is which without editing the name.

System password prompt

Hey all,

Not sure if it's just me but I get a password prompt everytime I first used Gas mask on Yosemite 10.10.3

My Console logs show:

4/22/15 4:31:04.582 AM Gas Mask[5043]: *** WARNING: Method userSpaceScaleFactor in class NSWindow is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.

4/22/15 4:31:09.546 AM Gas Mask[5043]: Failed to connect (mainSplitView) outlet from (EditorController) to (NSSplitView): missing setter or instance variable

4/22/15 4:31:09.546 AM Gas Mask[5043]: Failed to connect (scrollView) outlet from (CombinedHostsPredicateController) to (NSScrollView): missing setter or instance variable

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.