Tag: command-line


The most common shortcuts for code editing | OSX

Most Common Text Editor Hot Keys For Programmers Here are a list of hot keys that work the most universally as possible for text editing. There are so many hot keys and yet so little time. Which hot keys should you learn? If you work in the command l...

How to open multiple Iterm windows on startup

Find your self having to run a server or turn on some sort of process every time you open up your development environment? The script bellow will help you set up your own custom default tabs in iterm running what ever scripts you want when the window i...

Installing xdebug in XAMPP 5.5.19 on Mac OSX

This was tested on OSX Lion. Please let me know if it works on Mountain Lion or later. Here is what we will be doing in a nut shell. You will need to download the correct source code for your version of xdebug and then you will need to use the correct...

Installing xdebug in XAMPP 1.8.3 on Linux

If you have installed XAMPP 1.8.3-0 for Linux and you want to install x-debug here is how to do it using PECL. 1.) Check to make sure /bin is in your path echo $PATH; if :/bin: is in the path then bin is in your path. This makes sure that when you c...

Don't overwrite permissions with tar file

When you use tar to back-up a directory and then you want to restore that directory you may want to keep existing permissions intact. If you made changes to the permissions since the archive was created and you want to restore the original files while ...

Jump to end of file with vi or vim | Jump to last line

Insert Mode is when you have a block cursor and can edit the text Command Mode is when you have a : at the bottom where you can enter commands. If you are in insert mode or command mode hit: escape key then shift+g keys If you are not in insert mode...

Add an existing user to an existing group in Linux

If you want to a add a user to an existing group this is how you do it. [local_username@localhost /]$ useradd -a -G somegroup usernameThen log out and log back in for the new group settings to take effect.Managing permissions for a group is an importan...

Exclude images from a Linux find

If you want to find all files in a sub directory and you don't want images to show up in the list here is a way to do it: [local_username@localhost /]$ find /some/dir/ -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' \) -pr...

Installing SSH and SCP in ANT 1.8.2 OSX

Download jsch-0.1.50.jar at http://sourceforge.net/projects/jsch/files/jsch/0.1.50/jsch-0.1.50.zip/download Download ant-jsch-1.8.2.jar at http://mvnrepository.com/artifact/org.apache.ant/ant-jsch/1.8.2 jsch-0.1.50.jar - contains the supporting clas...

List all users on a server

User information is stored in the /etc/passwd file [username@localhost /]$ awk -F":" '{ print $1 }' /etc/passwd If you want to print out the user name and UID: [username@localhost /]$ awk -F":" '{ print $1 "\t\t"$3 }' /etc/passwd | column -t Here is ...

Copy MySQL schema from remote host to local host

The secret is to use a program called mysqldump which comes with your installation of mysqld. user@localhost the_directory>mysqldump --no-data -u root remote_db_name -h address_of_remote_machine.com > temp-db-schema.mysql user@localhost the_directory...

Copy all files a user owns off of remote server

This is for copying files from a Linux machine to a local Linux machine. user@localhost the_directory> ssh user_name@remote_domain.com 'cd /dir/you/want/to/copy/; find `pwd` -user user_name' | xargs -I{} scp user_name@remote_domain.com:{} `pwd` This...

Change ownership of files owned by only one user

To find all the files owned by a specific user and then change their group and user ownership to something else use the example in green and follow the directions on what to replace in the green example: Replace enter_user_name_here with the specific ...

Interpret PHP as you type | PHP prompt

How to Code PHP from the prompt. How to run PHP in interactive mode. Open a command line prompt and type the following: C:\> php -a Interactive shell php > echo 5+8; 13 ctrl-D to exit If it can't find PHP, you need to check and see if it is inst...