locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file.

Overview

locdev 🛠️

Crates.io GitHub Actions GitHub Releases

locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file. You no longer need to deal with manual and error-prone editing. Now, it's as simple as running a command.

Features

  • Add entries to the hosts file
  • Remove entries from the hosts file
  • Print the current entries in the hosts file

Installation

Download Compiled Binaries

You can download the compiled binaries for locdev from the GitHub Releases page. Choose the binary that corresponds to your operating system and architecture, and place it in a directory included in your system's PATH environment variable.

Install with Cargo

To install locdev using Cargo, you'll need to have Rust installed on your system. Once Rust is installed, you can install locdev with Cargo:

cargo install locdev

Usage

locdev [COMMAND]

Commands

  • add <ip> <hostname>: Add an entry to the hosts file with the specified IP and hostname
  • remove <ip> <hostname>: Remove the entry with the specified IP and hostname from the hosts file
  • list: Print the current entries in the hosts file

Examples

Add an entry to the hosts file:

sudo locdev add 127.0.0.1 dev.local

Remove an entry from the hosts file:

sudo locdev remove 127.0.0.1 dev.local

Print the current entries in the hosts file:

locdev list

Note

You need to use sudo to execute the add and remove commands, as the hosts file requires administrator privileges to modify its contents.

License

This project is available under the MIT License.

You might also like...
1 library and 2 binary crates to run SSH/SCP commands on a
1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel

massh 1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel. The binary crates are CLI and GUI "frontends" for the li

Kubernetes operator for declaratively deploying wasmCloud applications (via wadm) and hosts on Kubernetes.

wasmcloud-operator An operator for managing a set of wasmCloud hosts running on Kubernetes and manage wasmCloud applications using wadm. The goal is t

rewrite of hosts-creator in rust

hc-rs - hosts-creator-rust fetch and merge multiple hosts files this is a WIP whats done fetching hosts files merging hosts files removing duplicate

A micro crate that simplifies a bit the use of the std macro thread_local!.

with-thread-local A micro crate that simplifies a bit the use of the std macro thread_local!. extern crate regex; use with_thread_local::with_thread_

A CLI tool which can help you automatically kill process of your choice. Useful for freeing up memory and CPU usage!
A CLI tool which can help you automatically kill process of your choice. Useful for freeing up memory and CPU usage!

Quickiller There are always programs such as chrome that keep eating up your resources even when closed! The only way to prevent this is to kill all o

Rust-powered CLI tool designed to simplify and streamline the release process with help of ChatGPT
Rust-powered CLI tool designed to simplify and streamline the release process with help of ChatGPT

$ releasecraftsman 👷🏻‍♂️🛠 Automate Your Release Process with Precision and Ease. 🎁 Features Generate well-crafted release notes using GPT-3.5 and

A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

KAIVM is a multiplatform Command Line Interface (CLI) designed to simplify the process of downloading, managing, configuring, and running different versions of Shinkai Node
KAIVM is a multiplatform Command Line Interface (CLI) designed to simplify the process of downloading, managing, configuring, and running different versions of Shinkai Node

KAIVM - Shinkai Version Manager KAIVM is a multiplatform Command Line Interface (CLI) designed to simplify the process of downloading, managing, confi

A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.)

FS Dir Cache A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.) When working on build s

Comments
  • Switch away from std::process::exit

    Switch away from std::process::exit

    Made a more idiomatic solution using result enums. The <(). ()> are placeholders for this merge request, but they can be swapped for more useful types.

    opened by Slushee-a 1
  • Bump clap from 4.3.0 to 4.3.1

    Bump clap from 4.3.0 to 4.3.1

    Bumps clap from 4.3.0 to 4.3.1.

    Changelog

    Sourced from clap's changelog.

    [4.3.1] - 2023-06-02

    Performance

    • (derive) Reduce the amount of generated code
    Commits
    • 50f0e6b chore: Release
    • 1471457 docs: Update changelog
    • 7ead9ab Merge pull request #4947 from klensy/formatless-error
    • df5d901 perf(derive): Reduce amount of generated code
    • e8a3568 Merge pull request #4944 from clap-rs/renovate/criterion-0.x
    • a4f8391 Merge pull request #4943 from clap-rs/renovate/compatible-(dev)
    • 4eb03ea chore(deps): update rust crate criterion to 0.5.1
    • 534be34 chore(deps): update compatible (dev)
    • 78bb48b chore: Release
    • 3430d62 Merge pull request #4935 from epage/nu
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump tokio from 1.28.1 to 1.28.2

    Bump tokio from 1.28.1 to 1.28.2

    Bumps tokio from 1.28.1 to 1.28.2.

    Release notes

    Sourced from tokio's releases.

    Tokio v1.28.2

    1.28.2 (May 28, 2023)

    Forward ports 1.18.6 changes.

    Fixed

    • deps: disable default features for mio (#5728)

    #5728: tokio-rs/tokio#5728

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump clap from 4.3.1 to 4.3.3

    Bump clap from 4.3.1 to 4.3.3

    Bumps clap from 4.3.1 to 4.3.3.

    Release notes

    Sourced from clap's releases.

    v4.3.3

    [4.3.3] - 2023-06-09

    Features

    • Command::defer for delayed initialization of subcommands to reduce startup times of large applications like deno

    v4.3.2

    [4.3.2] - 2023-06-05

    Fixes

    • (derive) Don't produce unused_equalifications warnings when someone brings a clap type into scope
    Changelog

    Sourced from clap's changelog.

    [4.3.3] - 2023-06-09

    Features

    • Command::defer for delayed initialization of subcommands to reduce startup times of large applications like deno

    [4.3.2] - 2023-06-05

    Fixes

    • (derive) Don't produce unused_equalifications warnings when someone brings a clap type into scope
    Commits
    • a87fba2 chore: Release
    • 4b9ec6f docs: Update changelog
    • 13534b6 Merge pull request #4792 from epage/defer
    • d10938d feat: Allow deferred initialization of subcommands
    • 475e254 chore: Release
    • 75e2060 docs: Update changelog
    • 468ab55 Merge pull request #4952 from epage/derive
    • 103ae5c fix(derive): Don't warn when people bring types into scope
    • 5661b6b style: Remove unused mut
    • e7729d1 fix(derive): Mark all impls as automatically derived
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Owner
Nick Rempel
Nick Rempel
Dechrome is a tool written in Rust for batch removing Chromium-based browsers.

Dechrome Dechrome is a tool written in Rust for batch removing Chromium-based browsers and installing Firefox as a replacement. Warning The script is

Ryze 7 Aug 29, 2023
A tool for adding new lines to files, skipping duplicates and write in Rust!

anew A tool for adding new lines to files written in Rust. The tool aids in appending lines from stdin to a file, but only if they don't already appea

z3r0yu 4 Nov 16, 2023
🐙 Loads config and hosts for gh CLI in Rust.

gh-config-rs Loads config and hosts for gh CLI in Rust. Getting started [dependencies] gh-config = "0.2" Usage use std::error::Error; use gh_config::*

Naoki Ikeguchi 2 Jul 23, 2022
A handy way to handle sh/bash cli parameters

Argc A handy way to handle sh/bash cli parameters. How Argc works To write a command line program with Argc, we only need to do two things: Describe t

null 398 Jan 3, 2023
Tool for mass import of hosts into Zabbix (and other API functions)

zabbix-tools A CLI tool for interacting with Zabbix API built in Rust. Designed for Zabbix 6.0. Functions added to test API and add hosts manually or

null 1 Apr 21, 2022
fd is a program to find entries in your filesystem. It is a simple, fast and user-friendly alternative to find

fd is a program to find entries in your filesystem. It is a simple, fast and user-friendly alternative to find. While it does not aim to support all of find's powerful functionality, it provides sensible (opinionated) defaults for a majority of use cases.

David Peter 25.9k Jan 9, 2023
Quickly find all blackhole directories with a huge amount of filesystem entries in a flat structure

findlargedir About Findlargedir is a tool specifically written to help quickly identify "black hole" directories on an any filesystem having more than

Dinko Korunic 24 Jan 1, 2023
A small program which makes a rofi game launcher menu possible by creating .desktop entries for games

rofi-games A small program which makes a `rofi` game launcher menu possible by creating `.desktop` entries for games Installation Manual Clone repo: g

Rolv Apneseth 20 May 4, 2023
A Rust on-site channel benchmarking helper. Inter-Process (async / busy) & Intra-Process (async single threaded / async multi threaded)

On-Site Rust Channel Benchmarking Helper Deploy on server to determine which public crates are the fastest for communicating in different architecture

null 23 Jul 9, 2024
🤖 just is a handy way to save and run project-specific commands.

just just is a handy way to save and run project-specific commands. (非官方中文文档,这里,快看过来!) Commands, called recipes, are stored in a file called justfile

Casey Rodarmor 8.2k Jan 5, 2023