Symlink not working when pointing one subfolder to a sibling subfolder - symlink

Trying to create a symlink in my hostgator shared hosting account via Jailshell 4.1 and my Mac's Terminal as a test before applying the symlinks to a larger project.
When I try the following it doesn't seem to work:
ln -s public_html/y public_html/x
As I get the following response:
ln: creating symbolic link `public_html/x/y': Permission denied
I am simply trying to set it up so that going to public_html/x will instead take me to public_html/y. My ultimate goal is to later configure many wordpress sites to share a single set of core files without sharing databases, as described here:
http://jason.pureconcepts.net/2012/08/wordpress-multitenancy/
http://jason.pureconcepts.net/2013/04/updated-wordpress-multitenancy/
Edit: Both folders /x and /y already exist, containing a simple index file in each.

Related

Issues with copying a file path with documents to a local Repository Raspberry Pi

I am trying to create a USB stick to be a local Git repository to have a backup of code and automate version control. I have found many articles on how to do this, but I am having an issue copying my documents from my existing folder to a Repo on my local device. Once I have the files on my local device repo, I will clone my repo to another one on the flash drive. I can figure out Git for the most part, lots of documentation. However I am having an issue with copying from my local file system to another local file system Repo. Here is what I am doing:
cd /home/pi/Desktop/Aaron Maker Project/AM_git_controller/
BASH: cd: too many arguments
also when trying to copy the files over:
cp -r home/pi/Desktop/Aaron Maker Project/Code_pack1.1/ ~home/pi/Desktop/Aaron Maker Project/AM_git_controller/
cp: target '~home/pi/Desktop/Aaron Maker Project/AM_git_controller/' is not a directory
I am copy pasting the file paths from file manager, so its not in how I am inputting the file path
I realize this is a very obscure question, this is my first post, anything helps!

Symlink in Laravel current release folder from external folder

I am using zero downtime deployment for Laravel and I have a folder which is updated regularly with weather files.
The folder structure is like:
releases/1 - where the current release is.
current/ - linked to /releases/1 and this is where Apache server root is.
public/weather - this is the folder where weather files are stored (via ftp process).
Can I use symlink on public/weather -> /current/public/weather?
Command I try to use:
ln -nfs --relative /var/www/html/public/weather /var/www/html/current/public/weather
the command appears to work, however I can not see it linked with ls -al.
If I try:
ln /var/www/html/public/weather /var/www/html/current/public/weather
I get this error.
ln: /var/www/html/public/wdisplay: hard link not allowed for directory
Thank you

how to download files from google drive via command line

I would need to download files or folders from my google drive, via command line.
Thought to a script, a batch file, windows platform.
Seen that I could use gdrive app but I have some troubles with syntax.
I tried:
gdrive-windows-x64.exe download -r --path "G:\My Drive\myfolder"
but it gets me error as "invalid arguments"
Also I'm interested to a way to zip the content of a folder upon my google drive...again via command line
someone can help me?
thanks a lot
marco
Drive is an option.
Create a new folder and do the Initializing setting up;
Create the sub folder mirroring the remote folder structure;
Cd to the sub folder and run $ drive pull
Click here for more pulling documentation.
You have available a Command-line utility for working with Google Drive in github here:
https://github.com/google/skicka
Examples:
skicka download /folder1 ~/folder2
The contents of your ~/folder2 directory will match the contents of ~/folder1.
For download to local:
skicka download /local ~/remote
gdrive is an option written in GoLang. This does require connecting a Google account. This command downloads a Google Drive directory:
gdrive download --recursive DRIVEID

Accessing Symlink folder in ~/Sites folder on Mac (Web Sharing)

I have a local development environment setup on my mac and I am having permission issues accessing a folder in my ~/Sites directory.
Essentially I have Folder A in my Dropbox folder.
I created a SymLink of Folder A to my ~/Sites folder
ln -s ~/Sites ~/Dropbox/FolderA
When I try to access Folder A like so: localhost/~username/FolderA
The page says You don't have permission to access /~username/FolderA on this server
Can someone help me figure out this problem. When I do the same thing on MAMP I don't have this issue. Thanks in advance.
Go on private/etc/apache2/users/, edit your usernamefile.conf, add to the Options line, the option SymLinksIfOwnerMatch, don't use FollowSymLinks if the directory contains important personal files, if for example the dir that you want link is are under your Documents or Dropbox.
Remember that the directory linked by your symbolic link must have 755 permission, and so her parents!
Let's suppose you have /Users/foo/Dropbox/MySites/BarSite, both Users, foo, Dropbox, MySites, BarSite must be 755.

How to change Controllers/Models source directory in CodeIgniter

I need to load controllers and models from a different folder than the default one. I am using a Linux system.
I am building a simple CI application for some people, for use on a shared hosting I own. But I want to give them access only to /views folder and some /config files. And this is why I need to store the controllers and models in a different folder on the same level as /public_html folder or maybe somewhere in the linux system.
I consider this would be a better solution than encoding files
CodeIgniter permits you to organize your controllers,views and config files into sub-folders. As far as I know it doesn't permit it for models (at least documentation doesn't mention it, I've not tried myself).
As your are in a Linux system, you can create a symbolic link to reference to another directory in the filesystem.
So you can create the directories:
application/config/public
application/controllers/public
application/views/public
And then create in your /public_html symbolic links ponting to these directories:
/public_html/config -> application/config/public
/public_html/controllers -> application/controllers/public
/public_html/views ->application/views/public
When your customers upload files to /public_html/config, they will be also available in application/config/public. The same applies for /public_html/controllers and /public_html/views.
The command syntaxis to creates symlinks is
# ln -s target name
i.e:
# ln -s application/config/public /public_html/config
If you don't have console access to your hosting you can create the links using the PHP function symlink() .
To load a view/config/controller from a subfolder you only have tu prepend the directory name in the $this->load->...() function call. i.e:
$this->load->view('public/my_view);
Check CI documentation for more info about organizing your files into sub-folders.

Resources