Giter VIP home page Giter VIP logo

quicksearch's Introduction

quicksearch: a minimalistic webservice providing search abbreviations straight from any browser's address bar

You've configured your browser to have search abbreviations for all your most-used search engines and other useful sites.
woa velocity of unladen swallow and there you are at Wolfram Alpha.

But what if you're using a friend's/colleague's browser without all that convenience?
quicksearch to the rescue: a tiny Python script that is programmable in the same way โ€” except it runs as a webserver and is thus usable from any browser anywhere. (If you've got a domain to run it on, that is.)

That query from above would become something like jjj.re/woa/velocity of unladen swallow. Not quite as convenient as your in-browser keywords, but certainly faster than typing wolframalpha.com and waiting for 3.4 MB of website to load just so you can type in your query.

Want to check out my stock version?
There is a publicly accessible instance at jjj.re.
(The site intentionally does not perform a redirect to HTTPS to save roundtrips and thus time.)

Setup

  1. Clone repo to /opt

    git clone --recursive https://github.com/n-st/quicksearch.git /opt/quicksearch
    
  2. Install requirements

    pip3 install -U flask twisted
    # Optionally, for phone number analysis:
    pip3 install -U phonenumbers
    # Optionally, for MAC/OUI lookup:
    wget -O data/oui.txt http://standards-oui.ieee.org/oui.txt
    
  3. Copy quicksearch.service to your systemd service directory

    cp /opt/quicksearch/quicksearch.service /etc/systemd/system
    
  4. Check where pip installed twistd on your system, adjust path in service file if necessary

    which twistd
    vim /etc/systemd/system/quicksearch.service
    
  5. Adapt path, port, and bindhost settings to your needs

    grep Environment= /etc/systemd/system/quicksearch.service
    vim /etc/systemd/system/quicksearch.service
    
  6. Enabled and start service

    systemctl enable --now quicksearch.service
    

Non-redirect functionality

Over time, quicksearch evolved to also contain a few additional features beyond mere search redirections:

  • /ip
    Print the IP address from which the user is connecting:

    203.0.113.89
    

    or

    2001:db8:78a3:9889:5bd1:b3e5:bb52:ed80
    
  • /mac/48-2C-6A-1E-59-3D or /oui/48-2C-6A-1E-59-3D Look up which organization this OUI is registered to.
    Also supports other formats, e.g. 48-2C-6A-1E-59-3D, 48:2C:6A:1E:59:3D, 482c6a, etc.

  • /telnum/+442072343456 or /telnum/442072343456
    Print information about the phone number's origin country, region, and type:

    +44 20 7234 3456
    London, United Kingdom - fixed-line
    
  • /ula
    Generate a Unique Local IPv6 Unicast Address (ULA) according to the algorithm in RFC 4193, section 3.2.2.
    The output is the network address (all host bits set to zero) of the ULA /48:

    fd6c:e2c3:fb9c::
    

Todos / Possible improvements

  • Show the last-updated date of the OUI file (from file modification date)
  • Support IABs in OUI lookup
  • Use netaddr for MAC parsing and (fallback) OUI lookup

quicksearch's People

Contributors

n-st avatar

Watchers

 avatar

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.