Giter VIP home page Giter VIP logo

howdoi's Introduction

howdoi

Get quick answers to common linux related questions, right inside your terminal by typing "howdoi [your question]".

Screenshot

screenshot

Examples

Quick answer

$ howdoi extract a bz2 file

  -j, --bzip2
            filter the archive through bzip2
  tar -xvjf enginsxt.tar.bz2
  
  Source: https://askubuntu.com/questions/707861/how-to-extract-tar-bz2

Verbose output

$ howdoi -v add a program to cron

  Put a shell script in one of these folders: /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly or /etc/cron.weekly. 
  
  If these are not enough for you, you can add more specific tasks e.g. twice a month or every 5 minutes. Go to the terminal and type:
  
  crontab -e
  
 ...snip
  
  Source: https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job

Multiple results

$ howdoi -n 2 attach to a screen

 screen
 screen -S myprogramrunningunderscreen
 screen -ls

There are screens on:
    4964.myprogramrunningunderscreen    (05/31/2013 09:42:29 PM)    (Detached)
    4874.pts-1.creeper  (05/31/2013 09:39:12 PM)    (Detached)

Source: https://askubuntu.com/questions/302662/reattaching-to-an-existing-screen-session

  screen -d -r

Source: https://askubuntu.com/questions/302662/reattaching-to-an-existing-screen-session

Programming questions

$ howdoi js hex to int
  hexString = yourNumber.toString(16);
  yourNumber = parseInt(hexString, 16);
  
  Source: https://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hexadecimal-in-javascript

Usage

howdoi [-n -v -h -i] -- question

-n		Number of results (default is 1)
-v		Show full answer (otherwise shows only code)
-i		Interactive or REPL mode (useful for hotkey binding)
-h		Shows this help

Installation

Just run the following commands (requires PHP 5+).

$ mkdir -p ~/bin && wget https://raw.githubusercontent.com/san-kumar/howdoi/master/howdoi -O ~/bin/howdoi && chmod +x ~/bin/howdoi
$ sudo ln -s ~/bin/howdoi /usr/local/bin/howdoi

$ howdoi check my linux version

Interactive or Popup mode

It is possible to run this outside the terminal interactively via a hotkey binding. It can also handle simple programming related questions too.

popup

(you can ask questions in a popup too by pressing a hotkey - as described below)

Setup hotkey binding

  • Copy popup.sh in your ~/bin folder (or the folder in which you've downloaded howdoi script)
  • Run chmod +x ~/bin/popup.sh
  • Go to Settings > Keyboard > Shortcuts and add a new shortcut to ~/bin/popup.sh
  • Assign a hotkey (e.g. Ctrl+Shift+H) to your new shortcut.
  • Now press the hotkey and you should see a popup where you can type your question!

Feedback

Hopefully it will save you some time and makes your life easier. If so, please share it with your friends and give me feedback here.

Thank you everyone who encouraged me and voted for this project on Hacker news. Seeing comments like these really makes the work I've put into it worth it and now I want to make more such projects!

testimonial 1

testimonial 2

Caveats

  • It's just a quick hack to save you a few clicks. I wrote this in just a few hours, so it's not perfect.
  • Right now, it prefers Ubuntu solutions over other linux distros.
  • Just to clarify this only prints the answer, it does not run any code on your machine (in case the screenshot gives you the wrong impression).

Licence

Perl's Artistic Licence

howdoi's People

Contributors

san-kumar 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

howdoi's Issues

Not getting any output from howdoi

Hello,

I just installed howdoi and when I just type howdoi, I get the usage guide but after I type the example howdoi about extracting a tar file, I do not get any output back. Any help would be appreciated. Thanks!

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.