Jetson Nano SUB version booting not correctly - linux-kernel

Accidentally changed the root=/dev/mmcblk0p1 to root=/dev/sda1 on the extlinux.conf file on a Jetson Nano SUB version board and now I am stuck on a page which shows bash-4.4# when I boot the board, bash-4.4# ls, #bin dev etc init lib mnt proc root sbin sys tmp usr var , everytime that I boot the board. How can I try to change back the extlinux.conf file to add the root back to root=/dev/mmcblk0p1? I found this file after I went to cd /boot/extlinux/ and sudo cp extlinux.conf extlinux.conf.boot_emmc_backup then entered the vim extlinux.conf to modify it but now when I boot the system at bash-4.4# the command cd /boot/extlinux/ does not exists and I do not know how to get back to the previous boot loading screen.

Related

Unable to set "mongod" PATH

I'm having issues trying to run mongod upon terminal start up.
OS
OSX 10.11.4
Steps so far:
Download OS X 10.7+ 64-bit
Uncompress mongodb-osx-x86_64-3.2.5.tgz
Rename mongodb-osx-x86_64-3.2.5 to mongodb
Moved /mongodb to [Desktop/development]
Add /data/db to Desktop/development/mongodb/bin
Changed permissions to /data/db using chmod 777 /data/db
Within Desktop/development/mongod/bin typing ./mongod everything is working as expected and I can access the the mongo shell. Now I would like to just be able to type mongod upon terminal startup and run both mongo and mongod
PATH for mongod
Open bash file vi ~/.bashrc
While in insert mode: export PATH=Desktop/development/mongodb/bin:$PATH I've also tried export PATH=$Home/Desktop/development/mongodb/bin:$PATH
What am I missing or doing wrong?
Thanks
EDIT
As per suggestions I've moved all the mongo files into a more appropriate locations.
Mongo location: $HOME/mongodb/bin
Mongo DB location: $HOME/mongoData
Data/db location: $HOME/mongoData/data/db
Bash command: export PATH=$HOME/mongodb/bin:$PATH
I'm thinking this is correct, but still unable to run mongod is there something missing in the bash command? Like mongo = PATH=...?
Desktop is actually $HOME/Desktop as it's in your home directory, so you need:
export PATH=$HOME/Desktop/development/mongodb/bin:$PATH
Desktop is not the place to put stuff as it's nothing much more than a convenience area that you can add to and remove from at a whim. It's also too visible as you will see the folder icons.
You should have installed all that stuff into your home directory (or /usr/local if you want it available to all users).
Also "Add /data/db to Desktop/development/mongodb/bin" doesn't look right to me as data and executables are different.
If I was adding mongodb for development then I would have installed it via Macports with:
$ sudo port install mongodb
and would be up and working in less than 2 minutes.

wkhtmltopdf opens an application on OSX and doesn't finish its job till I focus this application

As far as I read wkhtmltopdf is using a patched version of Qt so that it can be executed WITHOUT using a graphical server such as Xorg, etc but when I run it in my OSX, it opens an application, it's visible in dock and when I press Command-Tab it's visible in list of applications shown, the icon of this app is a text "exec" in a black background. As soon as I focus this app it gets closed and wkhtmltopdf finishes its job but if I don't focus it, it doesn't finish its job at all.
Any ideas what can I do? I want it to run in background and respond automatically, I can't sit behind the system and Command-Tab each time a request is sent.
Update:
I tried it with an Ubuntu Server and it raises this error:
wkhtmltopdf: cannot connect to X server localhost:10.0
when I try to run wkhtmltopdf directly in command line. Isn't it against to whole purpose of patching Qt so that it doesn't need an X server?
It got solved after I faced the problem in Ubuntu, by searching the error raised in Ubuntu I could find this post wkhtmltopdf: cannot connect to X server which seems led me to install the package from sourceforge (both in OSX and Ubuntu) and it solved my problem (both in OSX and Ubuntu)
You must copy it into directory : /usr/local/bin, make sur it's executable and add symlink of wkhtmltopdf.sh like :
1- the command :
brew cask install wkhtmltopdf
2 - insert the binary in directory /usr/bin so the browser can't have permission to execute in this directory.
You must copy the wkhtmltopdf.sh to directory /usr/local/bin cause the browser have permission in this directory like:
sudo cp /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf.sh
3 - After make sur the binary have permission of execution like :
sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh
4 - so now you can test, it's work like:
/usr/local/bin/wkhtmltopdf.sh http://www.google.com google.pdf
it make download the pdf in the current directory in your terminal
5 - Optional
now you can add symlink in your directory /usr/local/bin like
ln -s /usr/local/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
6 - copy to the /usr/bin/wkhtmltoimage into /usr/local/bin/wkhtmltoimage like:
sudo cp usr/local/wkhtmltoimage usr/local/bin/wkhtmltoimage
8- make sur this is executable too:
sudo chmod a+x /usr/local/bin/wkhtmltoimage
I Hope it's help you

How do I ensure that Mongo binaries are in my PATH - in my shell' rc (~/.bashrc) on a Mac

I am learning mongoDb.
I did the following: I understand this.
mkdir -p mongodb
cp -R -n mongodb-osx-x86_64-2.6.7/ mongodb
These next ** instructions are not crystal clear to me.
**
Ensure the location of the binaries is in the PATH variable.
The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH.
For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):
export PATH=<mongodb-install-directory>/bin:$PATH
Replace with the path to the extracted MongoDB archive.
End of the instructions.
From terminal on my Mac
$which bash
/bin/bash
The bin directory has a bunch of commands: bash, chmod, ln, pid, mkdir.
I cannot find the directory where I should include the PATH code above.
Thanks
Abhay's instructions worked !
Sorry that the following is long but I believe it is necessary because you were so clear last time and I want you to see my file structure.
If email is easier let me know but this will more likely than not help others :)
I really want to understand my file structure so if you do not mind a bit of further clarification.
Thanks again for your expertise.
1.
But why are all of the binaries (the executables) listed individually in this bin folder ? Are they the 'only' files that should 'live' in this folder ?
Perhaps when I was installing bower grunt etc. I should installed those (bower grunt etc) into a different location.
I am trying to keep my file structures logical and clean.
Here is what I have.
MacBookPro:usr regina$ cd ..
MacBookPro:/ regina$ ls
Applications bin net
CoreSyncInstall.log cores private
Library data sbin
Network dev tmp
System etc usr
Users home var
Volumes mach_kernel
MacBookPro:/ regina$ cd usr/local/bin
MacBookPro:bin regina$ ls
bower grunt mongod mongorestore npm
browserify gulp mongodump mongos statsd
bsondump http-server mongoexport mongosniff yo
cake karma mongofiles mongostat
coffee lessc mongoimport mongotop
cordova mkdirp mongooplog node
express mongo mongoperf nodemon
MacBookPro:bin regina$
2.
Also, I wanted to look at my .bashrc file. I do not have one. I am on osx 10.8.5 I want to 'view' my $PATH variable. I believe I found it somewhere months ago. I was using nano to open a bunch of files because I was curious. Was it listed as an environmental variable ?
MacBookPro:/ regina$ ls
Applications bin net
CoreSyncInstall.log cores private
Library data sbin
Network dev tmp
System etc usr
Users home var
Volumes mach_kernel
MacBookPro:/ regina$ cd home
MacBookPro:home regina$ ls -la
total 2
dr-xr-xr-x 2 root wheel 1 Feb 3 08:29 .
drwxr-xr-x 33 root wheel 1190 Jan 25 17:21 ..
MacBookPro:home regina$
I start the mongo shell like this. I am not showing all of the lines output in terminal.
Look at my file structure. I originally followed a cp command but it did not explain 'where' to copy the archived (desktop) mongodb-osx-x84.... folder so look where I copied it to. Now I have these files in 2 locations - yes ?
And I have a mongodb folder inside of a higher level mongodb folder.
Why ? How did I manage this ? It seems illogical. I have been indented 4 spaces but the below will not format so I just added line breaks. sorry.
MacBookPro:home regina$ cd ..
MacBookPro:/ regina$ ls
Applications bin net
CoreSyncInstall.log cores private
Library data sbin
Network dev tmp
System etc usr
Users home var
Volumes mach_kernel
MacBookPro:/ regina$ cd data
MacBookPro:data regina$ ls
db mongodb
MacBookPro:data regina$ cd mongodb
MacBookPro:mongodb regina$ ls
mongodb
MacBookPro:mongodb regina$ cd mongodb
MacBookPro:mongodb regina$ ls
GNU-AGPL-3.0 THIRD-PARTY-NOTICES
README bin
MacBookPro:mongodb regina$ cd bin
MacBookPro:bin regina$ ls
bsondump mongodump mongoimport mongorestore mongostat
mongo mongoexport mongooplog mongos mongotop
mongod mongofiles mongoperf mongosniff
This is what happens when I try and type 'mongo' as another forum suggested.
MacBookPro:bin regina$ mongo
MongoDB shell version: 2.6.7
connecting to: test
2015-02-03T08:36:54.157-0500 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
So I typed this which still failed.
MacBookPro:bin regina$ ./mongo
MongoDB shell version: 2.6.7
connecting to: test
2015-02-03T08:37:03.599-0500 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
Then I tried this which connected - opened port 27017 - and is listening. Why did I need the daemon command ?
MacBookPro:bin regina$ ./mongod
./mongod --help for help and startup options
2015-02-03T08:37:08.712-0500 [initandlisten] MongoDB starting : pid=487 port=27017 dbpath=/data/db 64-bit host=macbookpro.home
more lines of code
2015-02-03T08:37:09.018-0500 [initandlisten] waiting for connections on port 27017
When you download MongoDB for Mac, you get an archive file. First thing you need to is uncompress the archive. To do that you just double click on the archive. The uncompressed folder will have the binaries in the bin folder, like mongodb-osx-x86_64-2.6.7/bin. What you need to do next is to make sure these binaries are accessible. So, for this you can do either of the two things -
Copy the binaries to /usr/local/bin folder. As /usr/local/bin is always in PATH, so you don't have to add it to the PATH.
This is pretty simple. Run cp mongodb-osx-x86_64-2.6.7/bin/* /usr/local/bin/. That's it. You are all done.
Add the binary folder's path to your $PATH variable.
Open the .bashrc file, which is located in your home folder, and put export PATH=$HOME/mongodb/bin:$PATH line in the end. I am assuming that mongodb uncompressed in downloads.
If going by the second method, make sure you don't accidently delete the mongodb folder that is added in the PATH.
Once you have finished doing this, close the terminal, open a new terminal window and run:
mongo --version
If you get the mongodb info with version, then good.
If you still get something like command mongo not found, then make sure you followed above instructions right. Also make sure you are not using any other shell, like zsh. If you are, then you have to add the export statement in the respective shell file. For zsh the file name is .zshrc.
Okay! So as you have updated the initial question with some more questions. So here goes the explanation point by point:
The files you see in /usr/local/bin folder are binaries. In simple language, they are executable programs. These executable binaries live there though you can run them from anywhere in the command line.
The .bashrc file is found in user's home directory. On Mac it's /Users/username. In your case, it should be /Users/regina because your name is Regina.
mongo is the client application. It is used to interact with the mongodb database. And, mongod is the database deamon that stores the data. So first you have to run mongod, and then only you can connect to it using the client mongo and start querying.

Removing GRUB from sda from Mac Internet Recovery

I tried to make a bootable Ubuntu DVD on my MAC. This lead to messing up my bootloader which I have been unable to fix.
https://discussions.apple.com/thread/3109456?tstart=0
One person states
Boot OSX and in the terminal write:
mkdir mnt ; sudo mount -t msdos /dev/disk0s1 mnt
Will show a new drive EFI
Open this drive and open the folder EFI
Inside you will have the folders APPLE and UBUNTU
Just delete the UBUNTU folder
So I keep reading and see
When in -Recovery From Internet- it is impossible to use mkdir, but
you can "cd /tmp" and mount it there.
So I haven't been able to figure out how to mount disk0s1 in the /tmp. If someone could please show me the commands to get into the EFI Folder so I can delete the Ubuntu folder.
I assume the link means you can do something like:
mount -t msdos /dev/disk0s1 /tmp/
then
cd /tmp
and you should see the APPLE and UBUNTU directories. I am not in Recovery Mode now so I can't try that, but deleting UBUNTU from there may help you.
This page:
http://www.rodsbooks.com/refind/getting.html
is what I use when I want to install Linux on a Mac, and has a lot of useful explanation about EFI booting on Mac machines. I have had good luck with SuperGrub2 when I've gotten in trouble:
http://www.supergrubdisk.org/category/download/supergrub2diskdownload/super-grub2-disk-stable/

Unable to map path to postresql after installation of Postgres 9.3 to mac

After installing Postgresql by dragging folder into my applications folder I am unable to get commands to work in the terminal and unable to add the path so that is shows up using the command $ echo $PATH.
Postgres starts in the terminal using the elephant icon on the system tray and selecting "open psql" so I believe it installed correctly.
I tried adding all different combinations of the following lines to my .bash_profile
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
then
PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
then
export PATH=$PATH:/Applications/Postgres93.app/Contents/MacOS/bin
and finally
export PATH=$PATH:/Applications/Postgres93.app/Contents/MacOS/bin
after each attempt I ran $ source $HOME/.bash_profile and then checked path and/or tried $psql $ which psql to no avail.
Also tried adding lines to .bashrc , .profile and .zshrc without luck.
The path to the executable commands bin folder in the app (psql, createdb, createlang, etc..) is
$ /Applications/Postgres93.app/Contents/MacOS/bin
Any help would be greatly appreciated!
running OSX 10.9.1
https://superuser.com/questions/707222/unable-to-get-postgresql-commands-to-work-in-terminal
answered at the link above by zelanix https://superuser.com/users/293259/zelanix

Resources