How to move directory into subdirectory in Linux [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I finished creating the tree, just need help on how to move sample_dir1 (which is a sub directory of the home directory) into sample_dir using relative pathname. Viewing the tree below will make the question much easier to understand:
$
ULI101 Assignment 2.3: Practice Specifying Path Names Page 3/15
--------------------------------------------------------------------------------
sample_dir1
`-- sample_dir
|-- admin
|-- cambridge
| |-- cafeteria
| |-- library
| `-- security
| |-- annex
| |-- building
| `-- parking
|-- faculty
|-- history.exe
|-- markham
| |-- annex
| |-- building1
| `-- parking
|-- oxford
| |-- outline.doc
| |-- programming
| | `-- report.pdf
| `-- security
`-- stenton
|-- gen_ed
`-- lib_arts
|-- english.txt
`-- match.doc
sample_dir1 is a subdirectory of your current (home) directory. Move to
sample_dir using a relative pathname:

sudo mv sample_dir1/ sample_dir/
Replace the sample_dir1/ with the actual location then replace sample_dir/ with the new location.

try it in local example directory , if you are existing in sample_dir
then : mv ../sample_dir1 ../sample_dir/
if did not work i am pretty sure i am not understanding your question or the path names are not clear enough to me

Related

PlantUML not finding custom stylesheets

I attempted to replicate the directory structure in this tutorial by jerieljan. Unfortunately I seem to be getting the default PlantUML stylings. I have included the expected results vs. the actual results in screenshots below. I am using the Visual Studio Code extension by jebbs with preview. While the style sheets are too long to include here they can be found in the aforementioned linked tutorial. The diagram file is as follows:
# Sequence Diagram Example
#startuml
'General Defaults
!define BASEPATH ..
!include BASEPATH/globals/stylesheet.iuml
'Actor Definitions
autonumber 1 "0:"
title Sequence Diagram
A -> B: Perform Action
B --> A: (Response)
#enduml
The directory structure is the same as in the tutorial and is as follows:
$ tree
.
├── globals
│ ├── style-presets.iuml
│ └── stylesheet.iuml
└── diagrams
├── example-sequence.puml
├── etc...
Expected Diagram
Actual Diagram

Change React build path post application build

The project structure that we have is:
| - - - - - - myproject-service
| | - - - src
| | - - - main
| | - - - resources
| | - - - static
| - - - - - - myproject-ui
| - - - build
When we build the UI project the build folder is created in the project. But we want to copy the build folder to mypoject-service/src/main/resources/static/
How do we achieve that during the build phase?
if you are using create-react-app you should have a paths.js file in the config folder.
change the
appBuild: resolveApp('build'),
in module.exports section to your path which in your case will probably be:
appBuild: resolveApp('../myproject-service/src/main/static')

Proxying multiple create-react-app static folders with Nginx

I have a nginx hosted on a VM with an authentication service that expose a simple login page and some other services hosted onto a secondary VM (create-react-app builds served through serve -s build).
If the user tries to access a protected resource gets promped the login page.
The architecture is as follow:
+-------------------------------+
| Other VM |
| |
| +-----------------------+ |
| |serve -s build -l 8000 | |
+--------------------> localhost:8000 | |
| /resource1 | | | |
| | +-----------------------+ |
| | |
+----------+ | | |
| | | | +-----------------------+ |
/static? | Linux | | | |serve -s build -l 7000 | |
+---------->+ nginx +-----+--------------------> localhost:7000 | |
| Auth sys | /resource2 | | | |
| | | +-----------------------+ |
+----------+ | |
| ● |
| ● |
| ● |
| |
| |
+-------------------------------+
I have correctly configured nginx to reverse proxy all the resources.
resource1, resource2, resourcen and auth system access to a /static folder to take css, js, etc...
I have done a "workaround" to retrieve the correct static folder that is as follow:
location /static {
try_files $uri $uri/ =404;
if ($http_referer ~ ^http://linuxhostname/resource1) {
proxy_pass http://otherVMhostname:8000;
}
if ($http_referer ~ ^http://linuxhostname/resource2) {
proxy_pass http://otherVMhostname:7000;
}
}
Seemed to work fine until I faced this situation:
trying to access /resource1 without authentication:
The user is requesting /resource1 but the login page is prompted, nginx is proxying static files onto the other vm while they are on its file system, this results in a 404 error.
To mitigate this issue I thought to change the static folder name into something specific (e.g. for resource1, put static_r1) but I found that is not straightforward (see this link).
Do you have any ideas on how this can be approached nginx side or application side?
Thanks
After some experience and the updates made to the create-react-app I learned that you can use an environment variable when you build your package that is PUBLIC_URL=basepath.
This will make the index.html (the entrypoint of the React SPA) look for static files inside /basepath/static, hence by setting this variable the job is done.
The only thing you need to be aware of is the actual path on the websever, for example: if you use the nginx directive try_files $uri it will actually look inside $root_dir/basepath since the $uri will contain the base path.

QooxDoo: Dialog contrib Error

I am doing RIA application with QooXDoo, I want to use Dialog like windows to prompt & notify the user.
I have used dialog contrib from qooxdoo. But i got following error when i am trying to run
dialog.Dialog.warning( "I warned you!" );
Error in property decorator of class dialog.Alert in method setDecorator with incoming value 'shadow-popup': Is invalid!
I did added Dialog contrib in "config.json" file as follows.
"libraries" :
{
"library" :
[
{
"manifest" : "../qx-contrib-Dialog-master/Manifest.json"
}
]
}
Can any one guess what is the problem?
Thanks in advance.
Can you give some context?
Which version of qooxdoo and qx-contrib-Dialog are you using?
Which type of application are you developing (contribution|desktop|inline|mobile|native|server|website)?
Do you get an error message when running ./generate.py source?
I'm not sure what your problem is but when starting from scratch everything works for me (using qooxdoo-2.1, creating a desktop app and using the current head of the master branch from qx-contrib-Dialog):
$ cd workspace
$ wget/unzip => qooxdoo-2.1-sdk/ // I've already done that before...
$ ./qooxdoo-2.1-sdk/create-application.py -n stackoverflow
$ git clone https://github.com/cboulanger/qx-contrib-Dialog.git
file system at this moment:
workspace/
|-- qooxdoo-2.1-sdk/
| |-- application/
| |-- component/
| |-- create-application.py
| `-- ...
|-- qx-contrib-Dialog/
| |-- Manifest.json
| |-- README.md
| |-- demo/
| |-- qooxdoo/
| `-- source/
|-- stackoverflow/
| |-- Manifest.json
| |-- config.json
| |-- generate.py
| |-- readme.txt
| `-- source/
$ cd stackoverflow
$ vim config.json
config.json
.-----------
| ...
| "libraries" :
| {
| "library" :
| [
| {
| "manifest" : "../qx-contrib-Dialog/Manifest.json"
| }
| ]
| }
| ...
$ ./generate.py source
$ vim source/class/stackoverflow/Application.js
Application.js (adapted with reference to the demo on github [1])
.-----------
| ...
| // Add an event listener
| button1.addListener("execute", function(e) {
| // alert("Hello World!");
| dialog.Dialog.warning( "I warned you!" );
| });
| ...
|
$ ./generate.py source (cause the dialog classes aren't known yet)
Open app in your browser! :)
[1] https://github.com/cboulanger/qx-contrib-Dialog
Finally i got the solution for this error.
I just removed the following line from Dialog.js file, after that all are working fine.
'decorator' : "shadow-popup"
But shadow effect is missing.
So i did wrote a decorator named "shadow-popup" in theme file.
Thank you.

How can I branch "main" node of a UCM project?

We're using RAD with ClearCase plugin as "ClearCase Explorer Perspective". I need to make a new main version of a java project. For that reason, I want to change main/0 version to ie. main/1. How can I forward version from top-level? I tried to make new project by using "Project Explorer" creating new stream. It required previous baselines. However, when I checkin from this new project stream, it branches from the given baseline version(say 1) like below.
main
|
0
|
MyProj1_Integration
|
0
|
1(BL)---MyProj2_Integration
| |
2 0
|
1
I want it to be like:
main
0 ------------------- 1
| |
MyProj1_Integration MyProj2_Integration
| |
0 0
| |
1(BL 1
|
2
When inspecting versions from ClearCase Explorer version numbers are shown like below:
/main/MyProj1_Integration/MyProj2_Integration/1
I expect to see:
/main/MyProj2_Integration/1
Also, I want to include latest versions of files from previous branch to the new branch.
How can I achieve that? Do I need to create a new VOB?
/main/0 is only accessible from the 'INITIAL' baseline.
That means you need to have on your MyProj2_Integration an baseline ending with _INITIAL.
Only that foundation baseline will branch from /main/0.
Once you have that configuration, you will then be able to make a 'deliver' from 'MyProj1_Integration' to 'MyProj2_Integration', in order to get back the latest versions of your first project in the new branch 'MyProj2_Integration'.

Resources