Is it possible to use firefox's google search bar directly from command line? - firefox

I checked through firefox's supposedly supported command line arguments and found this distinctly lacking, but I can't help but assume it must be somehow possible. Any thoughts on how? Currently running Ubuntu 11.10 if that changes anything.

If you're talking about the Developer Toolbar, it doesn't look like that has access to the built-in search. It's mainly for quick access to developer tasks (type help to see the full range of what it accesses), not for driving regular browsing tasks.

install googler using terminal in ubuntu
Step-1 : Install git(if not installed)
sudo apt-get install git
Step-2: Change the directory
cd /tmp
Step-3: Clone it from link given below using command
git clone https://github.com/jarun/googler.git
Step-4: get into googler directory
cd googler
Step-5:
sudo make install
Step-6:After that move to bash directory
cd auto-completion/bash/
Step-7:Finally copy file into etc/bash_completion.d
sudo cp googler-completion.bash /etc/bash_completion.d/
Now from terminal open googler
googler your_query
For further query refer here
use man googler for more option

Related

How to install Fly CLI to mac

I download the latest version of the Fly cli
https://concourse-ci.org/download.html
to ~/Downloads then cd to ~/Downloads
cd ~/Downloads
mv fly_darwin_amd64 fly
install fly
then I do
fly
and i get
-bash: fly: command not found
Is one of my steps wrong?
Try
cd ~/Downloads
mv fly_darwin_amd64 /usr/local/bin/fly
chmod 0700 /usr/local/bin/fly (Thanks to #Andrew Ramnikov)
For the newest mac os version, you need to allow the App to run from System Settings->Security and Privacy->General-> Allow app
fly -version
On MacOS, you can install with brew like, brew install --cask fly.
You might also want to install CredHub to manage credentials, brew install cloudfoundry/tap/credhub-cli.
Note that in the accepted answer, in Catalina and Newer the equivalent to the last step to allow the app in privacy settings is: xattr -d com.apple.quarantine /usr/local/bin/fly
And this does not require admin rights, but doing it via the GUI does.
Go to System Preferences -> Security & Privacy -> General and click allow anyway next the the fly app.
I ended up moving the fly binary to a folder in my home directory, and just added it to my path variable in ~/.bash_profile so I guess it works now.
edit
However, when I do
fly -t main login
I get
error: unknown target: main
easiest way is to run first command curl 'http://localhost:8080/api/v1/cli?arch=amd64&platform=darwin' -o fly \ && chmod +x ./fly which will create a fly binary and for the second part of command just do it manually && mv ./fly /usr/local/bin/ meaning you need to copy fly binary into /usr/local/bin

How do I install Git for Windows software to a specific directory?

I have just downloaded the latest Git for Windows installer, v2.4. It appears to want to install to the standard Windows "Program files" (with-spaces-in-name) directory.
Since I have all my development code in a folder called (simply) "/bin" -- I want to see if there's a command line option or parameter to change the install directory.
In my case, these days I use a environment variable such as GIT_HOME for important software like git; so it would be useful if there was a way to apply that to things like git commands, etc once I have the program installed.
possibly related:
How do I change the directory in Git Bash with Git for Windows?
I also came across a few questions asking: "whereis git". That's answered above, however I take that as an indicator that others may want git somewhere else too.
To start the installer with a different installation path you can open a CMD terminal in the same directory as the installer executable and pass in an option parameter of /DIR="x:\dirname"
For instance, if you have version 2.17.0 for Windows 64bit and you want to install git to D:\git, you would run:
Git-2.17.0-64-bit.exe /DIR="D:\git"
The installer will launch as usual and you need to walk through the other options, but the install location will be the path specified.
Since I just ran into this problem because my SSD is filling up, I figured I'd share the solution I came to on Windows 11 with Git v. 2.37.2.
The best way I could figure was to uninstall Git, then in CMD Prompt use the suggested command from the Git website with an appended --location/ -l flag:
winget install --id Git.Git -e --source winget --location [drive:/directory]
where [drive:/directory] is your target for the install. Had no issues and verified it worked with a project.

Mongod: Command Not Found (OS X)

I am trying to test MongoDB and I have it all downloaded and moved into the root folder. I can navigate to the folder that holds the mongod, but when I try to run it by typing "mongod" into my terminal, I get a message that says:
"mongod: command not found"
Both answers above are correct.
You can either specify the path in one of the following files: .profile, .bashrc, or .bash_profile
export PATH="$PATH:/usr/local/mongodb/bin"
then call the daemon or the shell directly
mongod
mongo
Or for the commands not in the $PATH, use ./mongo or ./mongod from the directory containing these files. This solution can be verbose has you will have to eventually append the whole path when calling these commands from another directory.
/usr/local/mongodb/bin/mongod
or
/usr/local/mongodb/bin$ ./mongod
"Mongod" isn't a stand-alone command. You need to run the command like this:
./mongodb/bin/mongod
I used this webpage to help me answer this question.
This worked for me:
brew tap mongodb/brew
brew install mongodb-community#4.2
mongod
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
For example, install 64bit MongoDB 2.6.12 on macOS Catalina.
(for newest versions you may go to https://www.mongodb.com/download-center/community for your platform).
Download, extract and move:
wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
tar xzf mongodb-osx-x86_64-2.6.12.tgz
mv mongodb-osx-x86_64-2.6.12/ /usr/local/mongodb/
Add to file ~/.zshrc this:
export PATH="$PATH:/usr/local/mongodb/bin"
PS: .bash_profile or .profile not worked in my case
Reload terminal (or close, open it):
source ~/.zshrc
Make directory for data and set rights:
mkdir -p ~/data/db
chown -R mongodb.mongodb ~/data/db
Run MongoDB:
mongod --dbpath ~/data/db
You need to add the name of the folder that contains the command mongod into your PATH so your shell knows where to find it.
So, if mongod is in /usr/bin/freddyfrog, you would edit ~/.profile and find the line that says PATH= and edit it to look like this:
export PATH=${PATH}:/usr/bin/freddyfrog
Then login again to make it take effect.
I received the same error message because I used the wrong command to run mongod (meant for M1s) for my 2019 MacBook with an Intel processor. You can skip past Homebrew updates and MongoDB installation but here's how I resolved my issue:
Download Xcode Command Line tools.
xcode-select --install
Allow Homebrew to add and access MongoDB:
brew tap mongodb/brew
Update Homebrew:
brew update
Install MongoDB Community Edition (#6.0 is the latest version at the time of this post):
brew install mongodb-community#6.0
macOS with Intel processors:
mongod --config /usr/local/etc/mongod.conf --fork
macOS with Apple M1 processors:
mongod --config /opt/homebrew/etc/mongod.conf --fork
Then open the shell:
mongosh
Or just run mongod.
Official documentation on installation here.
3 steps:
Step 1:
export PATH="$PATH:/usr/local/mongodb/bin"
OR
export PATH="$PATH:/usr/local/opt/mongodb#3.2/bin"
(replace version number with your local version)
The first step will allow you to run the command, but will get you another error: "/data/db does not exit" so you have to
Step 2 :
sudo mkdir -p /data/db
Now /data/db is read only, but it has to be writable also so
Step 3 :
sudo chown -R USERNAME /data/db
I was trying to install a previous version (3.6) using latest documentation (4.2 is already released). So, they now call it mongodb-community#3.6.
In order to update PATH for such setup, the statement should be
export PATH="$PATH:/usr/local/opt/mongodb-community#3.6/bin";
I got hint from #retroGiant 's answer
run this command, it works:
brew services start mongodb-community#4.0
I have installed mongodb-community#3.2, was facing the same issue. I followed below steps.
open bash profile in any editor (you can also try - vi ~/.bash_profile)
write this export PATH="$PATH:/usr/local/opt/mongodb-community#3.2/bin" & save.
do this . source ~/.bash_profile
In root directory
sudo mkdir data
cd data
mkdir db
then
sudo chown -R yourUsername /data/
copy path of your mongodb/bin downloaded folder (I suggest you put it in home folder not root dir)
in terminal
export PATH="paste the link here :$PATH"
now it should work but if not
In case you are using different Unix shell and
trying to execute mongod within visual studio code( for example ),
make sure to read the documentation to link PATH.
For example, if you are using zsh create .zprofile in your home directory.
touch .zprofile
copy your previously made PATH into .zprofile
Now everything should work as expected.
I was looking for the same and later I have found that now it's very straight forward to install the new MongoDB Community Edition like below:
Installing MongoDB 6.0 Community Edition
brew tap mongodb/brew
Note: If you haven't yet install brew then follow this link: https://brew.sh/#install
Update Homebrew
brew update
Install MongoDB
brew install mongodb-community#6.0
The installation includes the following binaries:
The mongod server
The mongos sharded cluster query router
The MongoDB Shell, mongosh
Run MongoDB Community Edition
To run MongoDB (i.e. the mongod process) as a macOS service, run:
brew services start mongodb-community#6.0
To stop a mongod running as a macOS service, use the following command as needed:
brew services stop mongodb-community#6.0
MongoDB 5.0 issue resolved - SEP/2022
do following steps
step 1: open a .zshrc file if it does not exist it will create by itself by following the command. For opening or creating a .zshrc file below command is the same.
vim .zshrc
step 2: insert value in it by pressing 'i'
step 3: insert the below command there or paste it there.
export PATH="$PATH:/usr/local/opt/mongodb-community#5.0/bin"
step 4: to exit click on esc key and the write :wq
step 5: Close the terminal and reopen it and type the below command
mongo
Output
MongoDB shell version v5.0.11
connecting to: mongodb://127.0.0.1:279021/?
compressors=disabled&gssapiServiceName=mongodb
Successfully integrated mongo 🎉 🎉 🎉
happy coding !!
If you use brew then check the path:
brew list
brew list mongodb-community#...
then add it to .zshrc
zsh: command not found: mongo
after that use mongosh instead of mongo
This answer is a little bit unrelated, but if you using vscode & would like to interact with mongoDB using command line, have a read.
I was looking to use mongod command as well (as i love to use command to interact with mongoDB), but after several attempts of install i completely give up. Until i found this, the mongoDB vscode extension.
The extension is loading the data pretty fast just like mongod command compare to mongo compass. It allow you to perform CRUD & aggregation in the mongoDB playground, and most importantly you able to retrieve the command on next execution by storing your command in a file with .mongodb extension.
*Update: After using it several weeks, everything is nice, just need to make sure you connecting to the right mongoDB connection (if you establish few different connection)

The git user is unable to execute bundle during GitLab installation

I am trying to install GitLab on a Debian Wheezy and experiencing an issue I don't understand.
Following the install guide for version 5.0:
step 1: was run as explained
step 2: I used rvm (multi-user install) instead (ruby-1.9.3-p392)
steps 3 to 5: were run as explained (MySQL chosen)
step 6: everything works fine until the "Install Gems" section, where I get the following error:
/home/git/gitlab$ sudo -u git -H bundle install --deployment --without development test postgres
sudo: unable to execute /usr/local/bin/bundle: No such file or directory
I run this as my normal user (in the sudo and rvm groups), and the git user is not a sudoer.
I think that the line sudo gem install bundler, in step 2, does not grant the git user to execute bundle properly, but I don't know how to fix this.
I probably did something wrong but cannot figure out what it is, as I tried to respect the standard instructions as close as possible.
Any clue about this? Thanks, I am losing hope...
For information, I have written to the GitLab mailing-list about this problem but did not get any answer. Moreover, last time I asked something similar on ServerFault, I have been advised to post on StackOverflow instead... hence this question :)
When I do $ which bundle, I get /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle.
The git user has been created with the --disabled-login flag and thus I cannot login as git to run bundle.
When I do $ sudo -u git bundle, I get
sudo: unable to execute /usr/local/bin/bundle: No such file or directory
That means git user has not /usr/local/rvm/gems/ruby-1.9.3-p392/bin in its PATH, and you cannot modify its .profile or .bashrc because of the --disabled-login flag.
It seems that running sudo -i -u git bundle instead of sudo -u git bundle does the trick
That is the safest route, and will execute the command as git, but will simulate first an initial login, using the PATH defined in .profile and .bashrc of user root.
See "How does sudo search the path for executable?" for more.
On my local machine after upgrade from 6.4 to 7.7 I had such issue.
The compilation of ruby was made under root account.
So need permissions to read compiled ruby and installed bundle.
chmod ugo+rx /usr/local/bin/bundle
chmod -R ugo+rX /usr/local/lib/ruby/
In production mode You could be more strict.

Installing Git separately from Github for Mac

I've installed Github for Mac.
I've realised that I need to get to the command line to do some stuff.
There is an option in Guthub for Mac to install a command line. All this seems to do is create an alias called Github in /usr/local/bin that points back to the Github for Mac application.
Double clicking it opens a terminal window and then Github for Mac.
Any ideas how to get Git to work in a command line?
Its a relatively clean version of Lion OS X
Git is included in the command line tools package provided by Apple that can be downloaded at https://developer.apple.com/downloads/index.action
It is also included with Xcode, which can be downloaded from either the Mac App Store or from the above link.
Assuming you'd rather not install either of these you can also obtain Git by downloading it from http://git-scm.com/downloads
Hope that helps.
https://help.github.com/articles/set-up-git#platform-mac
Should walk you though installing it.
I highly recommend installing Homebrew, which does a great job of keeping up with the latest git releases.
Once Homebrew is installed, it's as simple as:
brew install git
Note that, from May 2013, you now have with "GitHub for Mac" both:
the GUI
the CLI (Command-Line Interface)
See the blog post "Installing Git from GitHub for Mac"
you can now easily install Git for use on the command line, without needing to download any separate packages.
Even the git updates are taken care for you:
And whenever we update the version of Git included with GitHub for Mac, you'll get the changes automatically – no work required on your part!
you may notice some changes to the Preferences window.
On the newly renamed "Advanced" tab, simply click "Install Command Line Tools".
You'll be prompted for an administrator password so that Git can be installed into /usr/local/bin, and then you should very shortly see that it succeeded:
GitHub app create many links in /usr/local.
Use this command to find all link files from GitHub.
ls -l $(find /usr/local -type l) | grep GitHub.app | awk '{ print $9}'
then rm them.
PS: GitHub also created some directories that cause error when run brew link git,
e.g. /usr/local/share/git-core, /usr/local/lib/perl5/site_perl.
You should remove them carefully.

Resources