Fix permissions for website directory mac osx 10.9 - macos

I have apparently messed up the permissions of my development environment and can no longer get the web site i'm working on to come up with localhost. There are a lot of files to fix and I do not want to have to try to fix them all manually through finder. Is there a way to fix them all at one time? I'm sure there is a command pompt I could use but I'm not that familliar with comman line.
I am on a Mac running OSX 10.9
Help please

This is an wasy one to fix, especially for wordpress permissions.
Open up a terminal (/Applications/utilities/terminal.app). You would then change directory to where you keep your development sites.
cd /path/to/where/you/keep/your/Site
Then issue the following two commands in you site's directory
find . -type d -print0 | xargs -0 chmod 755
find . -type f -print0 | xargs -0 chmod 644
This will recursively set permissions to what apache expects.

Related

Find git repository on macOS

I would like to find the location of a Git repository I made on my mac. Is there a way to find, for exemple, albatrocity/git-version-control.markdown on macOS using the Terminal? I installed everything with default parameters. I guess it must be in the User directory but I don't find anything related to GitHub there.
When I find it, I would like to completely remove it to maker a "proper" install.
EDIT: sudo find / -name "parsing.py" -print
I used a file that I know the folder contained when Terminal showed me nothing with sudo find / -wholename "*albatrocity/git-version-control.markdown"
You can use find's -wholename option to find a file based on its name and folder:
find <directory> -wholename "*albatrocity/git-version-control.markdown"
Example, if you want to search in the /Users/ directory:
find /Users/ -wholename "*albatrocity/git-version-control.markdown"
If you have locate on mac, and a regularly running updatedb, locate might be much faster:
locate albatrocity | grep git-version-control.markdown
It uses a hashtable to fast access filenames, but can be out of date, if the database isn't updated regularly or the file is too young (typically less than one day old).
If this is without success, then I would go for a full search with find, but maybe restrict it to a possible, narrowed path.

Continue button not working in magento

At Checkout page, when I click on continue button, it is not working.
When I press continue button, In console this error messages display.
Note: I concern with already submitted questions on Stackoverflow.
But not get any solution.
Same problem happened to me after an update. The continue button worked in the desktop view but not in the iphone theme
Solution: I replaced the file
/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml
with a correct file (I took it from an old installation)
well, is not about the file but permissions, check that every folder has a 755 and files 644
try ssh
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod +x mage
or if you are using cpanel, best to use filezilla to change it recursively
good luck
ivan Rojas
loom5.com

copy files across directories using terminal in mac

How to copy all files with an specific extension .SAV from one directory (including all subdirectories within that directory) to another one? I am using the terminal from mac. I have tried
/Users/tournillon/my_directory/research_projects/dissertation_related/inequality
Antonio-P-Tournillon-Ramoss-iMac:inequality tournillon$ ls
Brazil dhs_dados imr201101app.pdf
GHME_Education_final.pptx dhs_sav_files
Antonio-P-Tournillon-Ramoss-iMac:inequality tournillon$ dhs_dados /*.SAV/ dhs_sav_files/
I would assume this is a trivial task but I just can't get the syntax right.
Many thanks,
Antonio Pedro.
find /source/directory -iname \*.sav -exec cp {} /destination/directory/ \;
If you mean a UNIX copy,
cp -R <dirA>/*.sav <dirB>/
I'm not sure what dhs_dados is in your question..
Why not just use cp *.SAV directory

clear phpThumb cache regularly with cron job

I am using phpThumb on a client website, and as it is a very image heavy application the cache gets huge quick. Today the thumbs stopped working and I had rename the cache folder, as the folder was too big to delete via ftp. I renamed it cache_old and am trying to delete it now via ssh. I recreated the cache folder and everything worked fine again.
Since it seems it stops working when the cache folder is too full, plus just to keep the server tidy, I would like to setup a daily cron job to clear files from the cache folder. I have no idea how to do this though and haven't been able to find an answer yet..
The cache folder has a file in it called index.php which I assume needs to stay, plus a sub folder called source, which again has a file called index.php, again I assumed that needs to be there. So I need a command that will delete everything BUT those files.
Any guidance on how to set this up would be appreciated!
Thanks,
Christine
P.S. The site is hosted on DreamHost, and I have set other jobs up via there cronjob panel, and I do have SSH access if setting it up that way is easier. Cheers!!
it's possible to do this in one command but it's more obviously.
rm `find /path_to_cache_folder/ -type f | grep -v 'index.php'`
rm `find /path_to_cache_folder/source -type f | grep -v 'index.php'`
or in one cron job
rm `find /path_to_cache_folder/ -type f | grep -v 'index.php'` && rm `find /path_to_cache_folder/source -type f | grep -v 'index.php'`

Unable to find Applications folder in Mac's terminal

I tried the following code unsuccessfully
find Applications | xargs -0 grep Applications
I also tried the following unsuccessfully
find Applications
Was it something instead like:
mdfind Applications | grep Applications
mdfind is a command line interface to Spotlight. Somehow, I doubt this is what you were looking for.
The following command will find the names of Mac apps you have installed somewhere under /Applications.
find /Applications -type d -name "*.app"
Your question as phrased is pretty hard to help with, since you are not stating what your overall intent is...
It's in /Applications.
Try
find /Applications

Resources