Can not read the files present inside folder in Linode - file

I have an issue.I can not access files from one folder from Linode.I can access the files present inside other folder in the same parent directory.Let me explain it properly.
When i am trying to access like my-hostname/icons/, its not coming.But at the same time if i am trying to access like my-hostname/css/ this its coming.I can not know why this type problem is coming.When i am chceking it inside putty,its coming like below.
You can check above the icons folder is showing some other color which i can not access.Here i need to access this using the same domain name.Please help me.

It seems sticky bit is activated.
Try
chmod -t icons/

Could you post the permissions of the files/folders there? You can do it by running
ls -l
When you are in that folder, and provide us the output.

Related

encfs does not mount folder

I have installed encfs to encrypt my directory and files and everything worked well when I installed encfs and configured it. I created two folders, one /XDM/game and second /Private and as encfs works I have to copy my files into /Private folder and this will sync all those files' encrypted version with /XDM/game. But when I restart my pc I have to remount /Private folder for that I am using the following command -
encfs ~/XDM/game ~/Private
But it returns me this error -
encfs ~/XDM/game* ~/Private
EncFS Password:
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
fuse failed. Common problems:
- fuse kernel module not installed (modprobe fuse)
- invalid options -- see usage message
help me with this error please. Thank you in Advance!!!
Short answer is 'In order to mount the directory you need to remove file from /Private folder and try mounting again with
encfs `~/XDM/game ~/Private`'
And long answer, after you configured encfs once you restart computer, you can see your folder /Private empty and to show the files you have to mount folder but if you copy any file in /Private folder and then try to mount then it will give you this error. So first delete the file you pasted/created after you restarted computer and then mount. It should work!
I have written a detailed article to help you understand better.
http://www.linuxandubuntu.com/home/how-to-encrypt-cloud-storage-files-folders-in-linux
I was stuck in a similar scenario once when accidentally trying to write to the encrypted directory. Solved it by doing
encfs -o nonempty <encryptedDirPath> <decryptedDirMountPoint>
There are some repercussions to using the 'nonempty' option though. More here.
If you are not able to unmount the decrypted directory after doing the above, you might need to delete the entry for your stash from Gnome Encfs Manager, in case you are using it.
I was having the same problem where it says that mountpoint is busy or not empty. so, I created another dir. in your case, you can do mkdir ~/Private2. and then, simply treat this as your new mountpoint.
encfs ~/XDM/game ~/Private2.

save pdf on server fpdf

I am generating a pdf with fpdf in cakephp and I try to save it on the server.
I do it like this :
$fpdf->Output("D:/Files/mypdf.pdf",'F');
but it doesn't save.
I think it doesn't find the folder, but I don't know how specified it?
I have put the all the right on the folder.
I don't know if it is a cakephp restriction or just my directory?
Try this
$fpdf->Output(WWW_ROOT."files\mypdf.pdf", 'F');
As this code works fine locally, it's probably server-problem.
(1) Are you sure you can create files? Most free servers disallow creating files.
(2) Have you tried it with different location e.g. the current root location $fpdf->Output("mypdf.pdf",'F')
Anyway, you should enable error reporting in your index.php. If it was matter of directory not found you would get this result:
Warning (2): fopen(D:/Files/mypdf.pdf): failed to open stream: No such file or directory [ROOT\vendor\fpdf\fpdf.php, line 1025]
FPDF error: Unable to create output file: D:/Files/mypdf.pdf
Just a wild guess but change the slashes to windows style.
$fpdf->Output("D:\Files\mypdf.pdf",'F');
or even
$fpdf->Output("D:\\Files\\mypdf.pdf",'F');

non executable folder

How to make map/folder/dir not executable like I want to have images folder and there I want to say in ubuntu folder/home/images/ is only for photos like jpg,jpeg,png,gif and if for any reson someone upload some script like script.php can NOT fire that script!
So make folder where no script can be fired (executed) in ubuntu?
I think it has to be something with permissions 666 or 644, but I'm not sure if that is correct.
well, a php file isn't executed (it's read by the php-module) so you're not save disabling the x-bit.
You must filter the uploads on file-suffix.
You should configure your web server not to run scripts from the upload directories.

Using bake on shared hosting Cakephp

I'm trying to get bake working on my subdomain which is under shared hosting.
Is there a way we can get this working? I know how to connect to server via ssh shell but then what do I do after that?
First cd to the directory where the cake script is. On a Linux webserver, this would probably be something like ~/cake/console/, if you've put the CakePHP libs outside your web-accessible directories. If you've put everything into your web directory you'll probably have to go somewhere like ~/www/cake/console/.
Then simply type ./cake bake and take it from there.
You shouldn't have to do anything with environment variables. This is only necessary if you want to be able to run the cake console from any directory. I find it less of a hassle to just cd into the cake console's directory and run it using ./cake.
same as local machine cd <path_to_console> cake
if you do not know path_to_console ask for host support,
also path_to_console may be in environment path then just use cake in all dirs

vim cannot connect to cscope database

I have opensuse 11.4 installed. Vim is version 7. Now I normally use it to browse the linux kernel source. So I generated the cscope database inside a directory within my home folder i.e. /home/aijazbaig1/cscope_DB/ and I got 3 files viz. cscope.out, cscope.po.out and cscope.in.out besides the cscope.files file which contains a list of all the relevant files which I want to search.
Additionally I have added the following to my .bashrc:
CSCOPE_DB=/home/aijazbaig1/cscope_DB/cscope.out
export CSCOPE_DB
But when I do a :cscope show from within vim it says there are no connections. Can anyone please let me know what is going wrong.
Keen to hear from you,
This is mentioned in the comments above, but I want to make sure it's preserved in an answer.
The issue that came up for me was that vim didn't know where to look for the cscope database. When I added
cs add $CSCOPE_DB
to my .vimrc. Everything came out fine.
I figure since I've made the visit, I would try responding.
I was getting this error when searching using ctrl-space s (or any search for that matter):
E567: no cscope connections
I finally found the full solution at http://cscope.sourceforge.net/cscope_vim_tutorial.html, Step 11.
The idea is that you create a list of source files to be included in the view of cscope, generate the cscope.out in the same location, and update the export path accordingly:
find /my/project/dir -name '*.c' -o -name '*.h' > /foo/cscope.files
cscope -R -b (this may take a while depending on the size of your source)
export CSCOPE_DB=/foo/cscope.out (put this in your .bashrc/.zshrc/other-starting-script if you don't want to repeat this every time you log into the terminal)
You need to add a "cscope connection", like this in vim:
:cscope add $PATH_TO_CSCOPE.out
See :help cs for more examples.
Here's how I explore linux kernel source using cscope:
I use vim as my editor.
While standing inside the kernel source root directory, run cscope in interactive mode while recursively going through subdirectories during search for source files:
cscope -R
When run for the first time, it will generate the database file with the name: cscope.out inside the current directory. Any subsequent runs will use the already generated database.
Search for anything or any file and open it.
Set cscope tags in vim to make the :tag and CTRL-] commands search through cscope first and then ctags' tags:
:set cscopetag
Set cscope database inside current VIM session:
:cs add cscope.out
Now you can use CTRL-] and CTRL-t as you would do in ctags to navigate around! :)
I have the same issue on my PC. For now, to solve the issue:
On terminal execute: which is cscope
Open .vimrc file to edit: set csprg=/usr/bin/cscope
I ran into a similar problem with no cscope connections on ubuntu 18.04, then I discovered my .vimrc file does not load the CSCOPE_DB variable. Looked a little around and found a solution.
You can just copy this directly in to your .vimrc file.
Part of the code loads your cscope file from your directory. The keybinds are just a nice bonus.
Hope this helps.

Resources