Thursday, August 25, 2016

Git Hard Reset to a branch

In the case where work on a branch is not needed and you just want to reset the branch or hard reset to another branch, use the following command:

git reset --hard origin/your_branch

Note: this will over write any existing changes in the branch you're working on.

Tuesday, July 19, 2016

AWS Simple Bootstrap Linux Web Server with Website

Bootstrapping in AWS enables developers and admins to pre-configure how a resource should be setup.  This short bash script can be added to the Advanced Configuration section of a Linux web server launch.

The bash script will do the following:

1. Install the Apache web server
2. Update the server
3. Copy the web site files from an S3 bucket
4. Start the web server

Bash Script:

yum install httpd -y
yum update -y
aws s3 cp s3://YOURBUCKETNAMEHERE/index.html /var/www/html/
service httpd start
chkconfig httpd on

Wednesday, June 1, 2016

GitHub - Basic Version control using Pull, Commit, and Push from the console

This is a simple procedure for updating a Git repository. This works well for an individual developer working from a couple different environments.

1. Pull current version of branch:
git pull
2. Make changes to project files 3. See a list of changed files:
git diff --stat
4. Commit all changes to local copy of branch:
git commit -a
5. Finally, push changes to branch:
git push
That's it!

Monday, May 30, 2016

Linux - Download File(s) firom the Internet

Download files on Linux from the internet using the following command:
wget [OPTION]... [URL]...
I've been working to install a SSH web client on my Amazon Linux AMI instance. This client from GateOne seems like a good option. I created a new directory called 'sshclient'. Then inside that directory I ran the code:
That downloaded the file to the directory where I could then unzip it for installation. Other options for 'wget' include:

-O, --output-document=FILE    used to specify the output file
User credentials can also be passed for http and ftp requests.

Linux - View Files in a Directory

To list files in a Linux directory type:
Other options include:
-R, --show files recursively