How to show root folders in file tree in cloud9 local ssh install - ssh

I've installed cloud9 locally on my remote sever following instructions from Cloud9's "sdkcore" repository on github.
I was able to activate it correctly.
However, once started, the files tree only shows Cloud9 folders, but if you want to edit a file contained in a /var/www/examplefolder directory, I cannot.
I could only modify through the ssh terminal, but I would like to be able to edit the files using the most convenient sublime editor.
How can i fix it?
Thanks.

update:
I resolved creating a link with the command :
sudo ln -s /path/from/folder/you/need /path/to/c9/workspace
in that way you will see your files in c9 workspace folder in the file tree bar;
or
sudo ln -s /path/from/folder/you/need /home/yourusername/
in that way you will see your files in favourites folder in the file tree bar.

If you want to do this, you'll need to create the SSH workspace with the workspace root as / . Alternately, you can open files in the IDE by using the c9 {filename} command.

Related

Kompozer Can't "Publish" web page to my Raspberry Pi Server

I'm not sure how to set the publication settings...
... My RPi is at 192.168.2.126, and is running Apache and ftp.
... The site is to be located in the folder /var/www/GarageDoor on the RPi
... The site is accessed as http://192.168.2.126/GarageDoor/GarageDoors.html
I'm also concerned because my ftp client can't move the file(s) associated with this site directly to /var/www/GarageDoor either. I end up transferring them to my /usr folder, then copying the files manually to the /var/www... folder.
Seems like you need "sudo" permission to copy a file to this folder. I can't figure out how to give either Kompozer or my ftp client such permission. (I'm using bitvise sftp client)
Any ideas would be appreciated.
This sounds a lot like a permissions error. Enter the following into the raspberry pi command line:
sudo chmod 777 /var/www/GarageDoor/GarageDoors.html
Because that would make the file readable by anyone. If that doesn't work, try the +x option to make the file executable.
sudo chmod +x -R /var/www/GarageDoor
Note on the second command: This will make all files in /GarageDoor have executable permissions. (-R is for recursive)

intellij Mac set a SDK home path to /usr

Using Intellij IDEA 14.1.2 I am trying to set an Erlang SDK home path, the only option I have for doing this is a file browser that does not let me view my /usr/local file. That is, I have no option for typing the desired path. I am forced to use the Apple gui file browser (that does not show /bin or /usr)
File -> Project Structure -> SDK's
I made a sym-link, but I don't really want stray links.
ln -s /usr/local/path/to/erlang ~/erlang
I can "type" the classpath and sourcepath but not the main "Erlang SDK home path:"
any ideas?
I found a similar solution on AskDifferent posted by bmike:
Pressing shift + command + g will open a dialog where you can type the path of any folder that you want to open.
Or, you can press shift + command + . to see hidden files and then navigate to /usr/local/path/to/erlang.
Solution: installing erlang in a directory visible for Intellij IDEA
Steps:
// 1-7 could be found here http://www.erlang.org/doc/installation_guide/INSTALL.html
1. Download "OTP 17.5 Source File" from http://www.erlang.org/download.html
2. $ tar -zxf otp_src_17.5.tar.gz (unpack)
3. $ cd otp_src_17.5
4. $ export ERL_TOP='pwd'
5. $ ./configure --prefix=/users/myuser/otp (use obsolete path; "~/" didn't work for me)
6. $ make
7. $ sudo make install
//
8. File -> Project Structure -> SDK's (chose /users/myuser/otp)
9. Finally to be able to use erlang from command line still; edit or create .bash_profile in the home directory and add the erlang's directory to the PATH variable (export PATH=${PATH}:/users/myuser/otp/bin/)
10. Finally Finally :) $ source .bash_profile
For me that did the job!
I also didn't want "stray links". Nevertheless, I have tried it and it didn't even work.
Do you think it's possible to change it from some config file ~/Library/Preferences/IntelliJIdea14
I tried to add to (project.default.xml) something like with no success.

Run intellij application with sudo privileges

I have a scala application that needs to perform sys.process operations with sudo and these operations are failing for me. From my google searching, it appears that I may be able to resolve this by running intellij with sudo. However, when I do this, I'm prompted to import settings and need would need to re-import my project. This seems less than ideal. Is there a way to set up a run configuration in intellij to have sudo privileges or at least run idea.sh with sudo but use my original workspace, so that all changes and configurations are shared between the sudo and non-sudo profiles?
Presumably this is down to Intellij reading its settings from a directory under the current user directory, eg C:\Users\matt.IntelliJIdea13 on my Windows PC. When you sudo, it will try and read its setting from a different directory.
I would check with directory it is trying to save its config to when you run it with sudo. Then set up a soft link from this directory back to your normal user directory. IntelliJ should then read the same set of files whether or not you are using sudo.
eg ln -s /home/matt/.IntellijIdea13 /home/root/.IntelliJIdea13
I haven't got IntelliJ installed on Linux so can't check this.

How to use gitbash instead of windows cmd.exe with meteor Release 0.7.0.1-win2

I am getting started with Meteorjs. I'm a windows user so I downloaded the windows installer package Release 0.7.0.1-win2. I use gitbash for my command line interface and can't get it to recognize meteor. I get the error "sh.exe": meteor: command not found". It works fine in windows command line but I prefer gitbash.
How do I get meteor to work with gitbash?
I have the perfect answer for you since I literally just solved the issue myself.
First of all make sure meteor works in the default windows command prompt. Next open git bash and check if the following command works:
cmd //c meteor
This runs the command meteor as if you were in the command prompt.
Next step is to set up an alias in git bash so you don't have to type that out each time.
Open git bash and enter the following:
vim ~/.bashrc
this will open/create the bashrc file in VIM, press i to insert and type the following:
alias meteor="cmd //c meteor"
Save and exit vim by first pressing the Esc key then press the ":" key. Now you should be able to enter commands in VIM. Type "wq" and press enter which will write into your .bashrc file and exit vim.
Almost there! Now that you are back in git bash, all you need to do is point to your .bashrc file by entering the following:
source ~/.bashrc
Now you will be able to run meteor commands straight from git bash! Hope that helped!
Here's the fix:
The problem is because of .bat files not being handled properly by
MinGW
Go to this directory - C:\Users[your username]\AppData\Local\.meteor
You should see a meteor.bat file there. Create a new file called "meteor" (without any extension and ""). Open it with notepad and paste the following:
#!/bin/sh
cmd //c "$0.bat" "$#"
save the file and now run git bash. You should be able to use meteor command in git bash.
Details
To run a *.bat command from MinGW's MSYS shell, you must redirect the execution to cmd.exe, thus:
cmd //c foo.bat [args ...]
The foo.bat command file must be in a directory within $PATH, (or you must specify the full path name ... using slashes, not backslashes unless you use two of them for each path name separator). Also, note the double slash to inform cmd.exe that you are using its /C option, (since it doesn't accept the -c form preferred by the MSYS shell.
If you'd like to make the foo.bat file directly executable from the MSYS shell, you may create a two line Bourne shell wrapper script called simply foo alongside it, (in the same directory as foo.bat), thus:
#!/bin/sh
cmd //c "$0.bat" "$#"
(so in your case, you'd create script file meteor alongside meteor.bat).
In fact, since this wrapper script is entirely generic, provided your file system supports hard file links, (as NTFS does for files on one single disk partition), you may create one wrapper script, and link it to as many command file names as you have *.bat files you'd like to invoke in this manner; (hint: use the MSYS ln command to link the files).
Credits to: Keith Marshall on SO and rakibul on Meteor Forums
It shouldn't be too hard - you just need to make sure that the meteor.bat file is in your executable. Check with echo $PATH from the bash console if it is already there.
For me, the meteor 0.7.0.1-win installer appended meteor's folder to the path automatically. However, you can add it manually with:
export PATH=$PATH:/path/to/user/folder/AppData/Local/.meteor
(On CygWin my user folder is at /cygdrive/c/Users/adam - I'm not sure what the equivalent path would be on git bash).
If you like, append that line to your ~/.profile to make sure meteor gets added to the path when the console opens.
Finally, on Windows the executable file is meteor.bat. I made a symbolic link to the filename meteor, just so I wouldn't have to type the .bat:
cd /path/to/user/folder/AppData/Local/.meteor
ln -s meteor.bat meteor.
Please have a look at the issue https://github.com/sdarnell/meteor/issues/18
I would suggest maybe creating a trivial wrapper script or alias that invokes LaunchMeteor.exe with the original arguments.
After more research on google I see that there isn't an implemented way to do this yet. The guys at meteor are working on it and accepting pull requests if you have a solution. The conclusion I came to is to use Vagrant and virtualbox to set up a ubuntu vm for meteor development. You can find info at this site: http://win.meteor.com/ on how to install virtual machines and provision to work with meteor.

CException Error while deploying yii application on OpenShift?

Friends, I tried to deploy my yii production application from cloud9 IDE to OpenShift while do so, I got this error message,
CException
Application runtime path "/var/lib/openshift/51dd48794382ecfd530001e8/app-root/runtime/repo/php/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process.
Even when I changed folder permissions to 775 (chmod -R 775 directory) on Cloud9 IDE and deployed again, but I get the same error coming.
It's an old question, but I just bumped into the same issue very recently.
When you extracted the "yii" package several folders were empty, "framework/protected/runtime" was one of them.
To deploy to OpenShift you need to commit the yii package to git, and the push the commit to OS. But, git won't commit empty folders, so they are not created in your deployment. You need to create some file inside those folders and add those files to your git repo before committing/pushing. The usual procedure would be to add a ".gitkeep" file to those folders (it's just a empty dummy file, so git would see those folders).
That would fix this particular error.
It may be due the ownership given to the folder.
Check the web server user group, is that directory is writable or not and also What effects a web server when we change the platform.
Hope my suggestion would be useful.
For Yii applications, the assets and protected/runtime folders are special. First, both folders must exist and writable by the server (httpd) process. Second, these two folders contains temporary files, and should be ignored by git. If these temporary files got committed, deployment in plain servers (not Openshift servers) would cause git merge conflicts. So I put these two folders in .gitignore :
php/assets/
php/protected/runtime/
In my deployment, I add a shell script to be called by openshift, creating both folders under $OPENSHIFT_DATA_DIR and creating symbolic link to both of them in the application's folders. This is the content of the shell script (.openshift/action_hooks/deploy) which I adapted from here :
#!/bin/bash
if [ ! -d $OPENSHIFT_DATA_DIR/runtime ]; then
mkdir $OPENSHIFT_DATA_DIR/runtime
fi
# remove symlink if already exists, fix problem when with gears > 1 and nodes > 1
rm $OPENSHIFT_REPO_DIR/php/protected/runtime
ln -sf $OPENSHIFT_DATA_DIR/runtime $OPENSHIFT_REPO_DIR/php/protected/runtime
if [ ! -d $OPENSHIFT_DATA_DIR/assets ]; then
mkdir $OPENSHIFT_DATA_DIR/assets
fi
rm $OPENSHIFT_REPO_DIR/php/assets
ln -sf $OPENSHIFT_DATA_DIR/assets $OPENSHIFT_REPO_DIR/php/assets
The shell script ensures the temporary folders created on each gear after openshift deployment. By default, a new directory's right are u+rwx, and it became writable by the httpd process because the gear runs httpd as the gear user (not apache or something else).