How to find out current directory and go to a directory in MySQL console? - command-line

I have the following instruction in I need to perform to run a web app I that have received:
"Go to the directory where the app is unpacked and type 'gradle jettyRun'."
Sounds simple enough, if you know the commands for finding out your current directory and changing it. The problem is, searching for these basic things only nets a huge amounts of irrelevant answers to much more advanced questions where the same terms are used with a slightly different meaning. So what do they exactly mean by what they say and how do I achieve that? It sound's so simple I'm almost embarrased to have to ask it, yet I'm still dumbfounded by the MySQL command line enough to have to.

This has nothing to do with the MySQL command line (>>>), or MySQL itself. This is simply saying:
Open your terminal or shell. In Windows, this is called Command Prompt.
Change the directory to where the files are located, you do this with the cd (change directory) command.
Next you simply type gradle jettyRun.

Related

Why i keep getting all the system paths when i startup the cmder?

I'm new to cmder so excuse me if it's a basic question.
So when I open cmder, I keep getting these PATHS as "were unexpected at this time"
An image for the paths that load on startup:
I tried to extract cmder to another folder, delete them from user/system variables and add them according to cmder-github-wiki but I kept getting the same bug/error/hint or whatever it is.
I don't know if it affect my workflow or not but I hate seeing errors before I begin anything! xD
1:
Try the following:
Check your PATH variable for syntax errors, especially near any occurance of Python related things.
Check something like an "autostart.bat" that CMDer runs at every start. The culprit may be located there, near any occurance of PATH or invoking files or directories which do not exist anymore.
Please clarify: What exactly are you invoking and in which directory, to start CMDer / to get this output? Which files did you edit and what are the contents of those files?
As last resort try uninstalling and reinstalling CMDer. The execution is probably broken since the move to another directory you described and the problem might be hard to track.

Where is the Trash directory?

The trash spec tells me that the Trash directory is here: $XDG_DATA_HOME/Trash
Looking at my environment variables on my Linux Mint system, I find a bunch of XDG stuff, but no XDG_DATA_HOME
I've done some looking, but so far I have not been able to locate the Trash directory. Where is it?
your home trash directory MUST be available and defined.
Usually it's under ~/.Trash or ~/.local/share/Trash as default
you can echo $XDG_DATA_HOME to display it, if you get nothing, you can set it by yourself.
XDG_DATA_HOME=/usr/local/share/
export XDG_DATA_HOME
and
XDG_DATA_DIRS=/usr/local/share/
export XDG_DATA_DIRS
for details see setting XDG_DATA_DIRS and XDG_DATA_HOME
and I recommend that you make trash-cli as an alternative for the rm, it's the command line interface to FreeDesktop.org Trash,
see https://pypi.python.org/pypi/trash-cli/0.12.9.14
https://github.com/andreafrancia/trash-cli
your home trash directory MUST be available and defined.
Usually it's under ~/.Trash or ~/.local/share/Trash as default
you can echo $XDG_DATA_HOME to display it, if you get nothing, you can set >it by yourself.
First it is impossible to set something you cannot find in the first place.
Secondly env | grep XDG does not return any variable XDG_DATA_HOME, so that provided no help whatsoever. Thirdly, Google search on e.g. "where is linux Trash folder stored" does indeed turn up results -- namely this page and others like it. Search engines are source referrers, not source providers. If someone hasn't already posted it somewhere, it won't show in Google or anywhere else. Suggesting a Google search as an answer is not helpful.
So indeed, find / -iname trash will find it (recommend adding 2>/dev/null to eliminate all errors that will occur for inaccessible files), but novices have a lot of trouble with find's syntax.
So yes, it is usually ~/.Trash or ~/.local/share/Trash.
As for trash-cli, yes very helpful, but the correct instructions for it are:
sudo apt install trash-cli -y
alias rm=trash-put
alias rm >> ~/.bashrc ( or >> ~/.bash_aliases)
Now, I would like to know, if I set XDG_DATA_HOME to /tmp, will trashing a file move to /tmp instead? The concept of a Trash folder is great, but I'd like a little more sophistication like an Archive folder where I can archive-put little used files that I still want to keep but keep out of my main folder stash to eliminate clutter. I'm no linux novice, but I do have limited time--so that is why we collaborate--I save you time, you save me time!! I hope. Less is more, more or less.

options "--read-only" Ipython Notebook

I can't run my ipython notebook with the --read-only option.
It says :
[NotebookApp] CRITICAL | Unrecognized flag: '--read-only'
It's weird because I've seen several blog mentionning it.
I'm running with the 1.1 version of ipython.
Do you know if this option was removed or moved elsewhere?
There is a super easy way to do what you're trying to do I think though--simply use OS security.
Do this:
When you're ready to deploy to read only, make a special folder
for your read-only work, and copy your *.ipynb files into that.
Make the *.ipynb files read-only at the Linux level: chmod 444
*.ipynb.
Run iPython Notebook from that directory. Use a different port
so that it won't conflict.
Send the URL to everyone using the URL that has the read-only
port.
They can then read it all, even run code, but they will not be
able to save changes.
They cannot navigate anywhere outside that directory. E.g. the
little home icon only brings them to the folder with your read-only
content.
Thus they have full access to the page and its functionality, but
cannot mess it up on anyone else. And all you need is a cp and a
chmod. Profit!
At least this solved my need. I have my regular port with write authority for all my development, then I copy it over, chmod it, and let people at it. Works just fine for me.
Hope this helps others!
Yes the option was removed, it might be re-introduced in another form later when nbconvert/nbviewer is refined, but you better run your own local instance of nbviewer to this effect.

pydev directory django shell

I'm using PyDev in a django project of mine.
When I start the django sheel, the os.getcwd() command returns my home folder.
This is bad, since my code points to some resources by relative paths, assuming as current directory the directory containing the manage.py.
In this post (http://stackoverflow.com/questions/2746342/pydev-and-django-pydev-breaking-django-shell) someone recommended to use absolute paths to avoid this problem.
But I think it is a very bad practice, since things will not work when other people checkout the code into their computers.
The closest hint I found here:
http://old.nabble.com/-pydev---Users--how-to-set-working-directory-for-console--td25328455.html
It seems we can use "Run/Debug Settings" to set the current directory associated to a "runnable module". However, in this way we cannot associate the setting to the django console. I have tried to associate it with the manage.py, but it did not work.
So, the question: how to define the working directory of django shell?
Thank you,
Leonardo

emacs trips over make-directory: File exists: c:/Users/USER/My Documents/.emacs.d/

I try to install/run emacs on a Win7 64-bit machine after using it for years on a WinXP 32-bit machine and run into a problem I do not find any help for in the documentation or on the web.
Symptom:
when starting runemacs.exe for the first time it creates the file
*C:\Users\USER\My Documents.emacs.d*
as one would expect (for my administrator as well as for my user account)
and comes up operational
from the second start of runemacs.exe it breaks in the startup phase,
displaying the scratch buffer, ringing the warning bell and displaying in
bottom line the error:
File exists: c:/Users/USER/My Documents/.emacs.d/
buffer messages specifies:
make-directory: File exists: c:/Users/USER/My Documents/.emacs.d/
if runemacs was called with a file to open, i.e. because the file type was
associated with it and the file was opened to edit, the file is not open
and ready to be edited, but a file can be opened via the menu File->Open File...
but my configurations in the file
C:\Users\USER\My Documents.emacs
are not loaded
My goal:
I want to regain the way I used emacs on the old WinXP 32-bit system:
click a file associated with emacs, get it opened and ready for editing, get my configurations in .emacs loaded automatically, i.e. work with emacs seamlessly.
Checks done and failed attempts to fix this:
I tried the following newly downloded versions of emacs
emacs-23.4-bin-i386.zip
emacs-23.2-bin-i386.zip (the one I used on the WinXP)
I had the emacs directory containing the directory stucture (bin, etc, ...)
located at:
C:\Program Files (x86)\emacs-23.4\ (my preferred location)
C:\Emacs\emacs-23.4\
in the download directory, where I originally extracted it
My HOME variable points to:
C:\Users\USER\My Documents (default)
C:\Users\USER\My Documents\ (tried)
My PATH variable contains:
C:\Program Files (x86)\emacs-23.4\bin (default)
or the corresponding other locations which I tried
The ownership and permissions of my C:\Users\USER\My Documents.emacs.d
look OK:
owner is the USER (administrator or standard_user)
permissions grant Full Control
Having originally installed emacs to *C:\Program Files (x86)\emacs-23.4*
using the administrator account, I also tried to use user account installation
instead (to check for some non- obvious parameter/access permission not set
right if the admin account is uses for setup)
For the runemacs.exe executable I manually set the compatibility settings to
Windows XP (Service Pack 3)
default setting after unpacking: no compatibility setting enabled
I removed the private configuration file C:\Users\USER\My Documents.emacs
(inherited from my XP installation) to check whether it produces a screw-up
All that did not change a bit of the described symptom, i.e. either I screwed up
in testing the above and missed a particular setting which should work, or I am looking into the wrong direction...
It is still unclear to me whether this has anything to do with:
W7 64-bit vs. XP 32-bit
environmental parameter screw-up
emacs configuration (.emacs, .emacs.d) screw-up
general stupidity (of me ;-)
... and why is it has emacs a problem with it in the first place, that the .emacs.d directory already exists... That should be the standard case...
Any help and wisdom much appreciated.
First of all, nice question. The details and listing of what you've already tried is helpful.
Some points:
Don't have spaces in key paths (Emacs, and %HOME%). Generally, things work
fine. But when things break it's often hard to debug and trace back to the
fact that some package author didn't take spaces properly into account.
Set a HOME environment variable to your %USER_PROFILE%. Make it
%USER_PROFILE%/home if you must, but I use the former.
Start by running emacs without any customization.
runemacs -Q
When that works, add your customizations one at a time.
n.b. This answer is not relevant to the original question (which was about Windows), but may be useful to Unix users searching for this error message
You will get this error also if emacs does not have the correct permissions on the .emacs.d directory.
Check it
ls -ld $HOME/.emacs.d
And make sure the user you are running under has rwx permissions!
I got similar problems when I installed the new version of emacs on a new installation of the ubuntu 12.10. I get the problem fixed by chmod 777 .emacs.d, that is, as the previous post pointed out, the emacs does not have the access right to .emacs.d directory. Hope this help.