• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

linux

How to Remove CVS folders recursively in Terminal

June 29, 2012 by Webhead

In mac os x terminal (linux) you can navigate to the desired directory and run the following command to remove any specific file or folder.

find . -name CVS -exec rm -rf {} \;

Basically a “find” command can be concatenated with other commands so the same operation can be applied recursively to all the found results.

keywords: terminal remove all cvs folders
source: http://www.phinesolutions.com/remove-the-cvs-folders.html

Filed Under: Coding Tagged With: linux, mac os x

MAMP optimizations

May 18, 2012 by Webhead

“Optimizations” in the sense that you’ll have to do less work.  This website gives some great tips on saving you some time using MAMP.

http://www.sitepen.com/blog/2008/05/16/supercharge-mamp/

This site below actually helped me with the silent MAMP startup.  Read the comments on this page for updates on getting it to work with version 2.  It’s so good to not deal with the GUI and entering my password!

http://stringfoo.com/2008/08/25/tutorial-launching-mamp-silently-on-startup/

 

The 2nd website no longer exists and I’m afraid the first one will be gone.  Below are the steps required to start MAMP 3.x without the GUI automatically on startup:

  1. Use Standard Ports
    • Set the web port 80 and and MySQL port to 3306 by using the MAMP GUI preferences.  There’s even a button to set it so you don’t need to type it.
  2. Set up Virtual hosts (optional)
    1. Create the directory /Applications/MAMP/conf/apache/vhosts
    2. Open /Application/MAMP/conf/apache/httpd.conf and add this to the end:
      1. NameVirtualHost *:80
        Include /Applications/MAMP/conf/apache/vhosts/*.conf
    3. Restart Apache
      1. sudo /Applications/MAMP/bin/apache2/bin/apachectl restart
  3. Run MAMP at startup without having the GUI popup.
    1. Put the following in /Library/LaunchDaemons/USERNAME.mamp.start.apache.plist  replace USERNAME with your username in both the filename and the contents below.
      1. <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
         <dict>
         <key>Disabled</key>
         <false/>
         <key>Label</key>
         <string>corey.mamp.start.apache</string>
         <key>ProgramArguments</key>
         <array>
         <string>/Applications/MAMP/Library/bin/apachectl</string>
         <string>start</string>
         </array>
         <key>RunAtLoad</key>
         <true/>
         </dict>
        </plist>
    2. Create /Library/LaunchDaemons/USERNAME.mamp.start.mysql.plist  replace USERNAME with your username in both the filename and the contents below.
      1. <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
         <dict>
         <key>Label</key>
         <string>USERNAME.mamp.start.mysql</string>
         <key>ProgramArguments</key>
         <array>
         <string>/Applications/MAMP/Library/bin/mysqld_safe</string>
         <string>--port=3306</string>
         <string>--socket=/Applications/MAMP/tmp/mysql/mysql.sock</string>
         <string>--lower_case_table_names=1</string>
         <string>--pid-file=/Applications/MAMP/tmp/mysql/mysql.pid</string>
         <string>--log-error=/Applications/MAMP/logs/mysql_error_log</string>
         </array>
         <key>RunAtLoad</key>
         <true/>
         <key>UserName</key>
         <string>corey</string>
         </dict>
        </plist>
    3. Change the file permissions using the following commands:
      1. sudo chown root:wheel USERNAME.mamp.start.apache.plist
        sudo chown root:wheel USERNAME.mamp.start.mysql.plist

 

Filed Under: Coding Tagged With: apache, linux, optimize

Useful Linux Commands

September 16, 2011 by Webhead

I recently had to move a server and needed to set up another server. I’m a linux newbie so I needed to look up a lot of things. Below are some of the more common commands that I needed: (replace with your own command/name).

Create a short name or alias to run a command.

alias =''

Create a symbolic link to another directory/file

ln -s

http://kb.iu.edu/data/abbe.html

Transfer files from your computer to a server

scp  :

Transfer files from a server to another server.

scp : :

Change file owner w/ recursion

chown -R :

Change file permissions for web w/ recursion

chmod -R 644

Find a file

find / -name

http://content.hccfl.edu/pollock/unix/findcmd.htm

Add a user

sudo useradd -d /home/ -m
sudo passwd

Change a users’ primary group

usermod -g

Add a group

groupadd

Add a user to a group

usermod -G

Make everything in a dir owned by the dir group owner

sudo chmod g+s

Find largest 10 files in wp-content folder

find wp-content -type f -exec du -h {} + | sort -rh | head -n 10


Filed Under: Server Stuff Tagged With: apache, linux

Mac OS X Linux Stuff

September 15, 2011 by Webhead

Locations and commands on the Mac OS X vs any other Linux/Unix system are different.  Below are some of the locations and commands I ran across in setting up my macbook as a webserver.

apache2 is located in

/etc/apache2/

Along with the httpd.conf:

/etc/apache2/httpd.conf

By default apache2 logs are located at:

/var/log/apache2

By default files in the root directory are at:

/Library/WebServer/Documents/

To restart apache:

sudo /usr/sbin/apachectl restart

or

sudo apachectl -k restart

To Enable PHP, in httpd.conf remove the ‘#’ from this line:

#LoadModule php5_module        libexec/apache2/libphp5.so

Filed Under: Server Stuff Tagged With: apache, linux, mac os x, php

Setting up a Cron Job on GoDaddy

July 20, 2011 by Webhead

Set up GoDaddy Cron Job

  1. Log Into your GoDaddy.com account.
  2. Choose “My Hosting Account” from the “Hosting & Servers” menu on the top navigation bar.
  3. In the Hosting Account list, click the Open link beside the account you want to use for your website.
  4. In the Hosting Manager window, click the Cron Manager icon or “Cron Manager” menu item under content menu.
  5. Now you are on the page where you need to setup two cron jobs: one to run daily for the daily backups and one to run monthly for the monthly backups. The monthly one can run on any date of the month, just as long as the time it runs at is after the daily backup run.
  6. You need to know the following:
  7. Host Name: (Usually localhost but in case of godaddy account it will be look like mysql123.secureserver.net)
  8. Database Name: Name of the your database.
  9. User Name: User name of the database. In case of godaddy account it will be same as db name.
  10. DB Password: Database user password for authentication.
  11. Use the various drop downs to schedule your Cron job and enter the Cron Command Line you have created.
The command line should be something like:
mysqldump –opt -Q -h (hostname) –user=(user-name) –password=(password) (database-name) > (full path of backup file)
For example  if you did daily backups and wanted to keep one month’s worth (after 1 month it would be overwritten):
mysqldump –opt -Q -h some.thing.com –user=mywebdb –password=thePassword mywebdb > /home/content/b/a/b/babychep/html/backups/bak_`date +%d`.sql

Filed Under: Server Stuff Tagged With: linux

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization macOS mac os x ms sql mysql open source optimize php php 7.2 rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized