| by Scott Kilroy

Git – problems with first push

No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as ‘master’. fatal: The remote end hung up unexpectedly Just run git push origin master Or if you get error: src refspec master does not match any. just do git commit -m “initial commit” git push origin master

Share Button
Read More
| by Scott Kilroy

Moving from Subversion to Git

Follow this guys instructions http://daneomatic.com/2010/11/01/svn-to-multiple-git-repos/

Share Button
Read More
| by Scott Kilroy

Subversion – Remove all .svn directories recursively

rm -rf `find . -type d -name .svn`

Share Button
Read More
| by Scott Kilroy

Installing Zend the easiest way

Go to http://framework.zend.com/download/current/ download the minimal version extract to a directory that makes sense to you add to your .htaccess file RewriteEngine on RewriteBase / RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d php_value include_path “.:REPLACE_WITH_LOCATION_OF_LIBRARY_DIRECTORY”

Share Button
Read More
| by Scott Kilroy

Get started with Zend

Rob Allen has created a simple 18 page tutorial on using Zend that is a great place to get started.  You can find the tutorial at http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf  

Share Button
Read More
| by Scott Kilroy

Using an editor to create commands

If you have a long group of commands you need to run press Ctrl-X, followed by Ctrl-E This will open your default editor.  When you’re done close the editor (saving the file) and the command will run.

Share Button
Read More
| by Scott Kilroy

Using AWK

A good guide can be found at http://www.student.northpark.edu/pemente/awk/awk1line.txt

Share Button
Read More
| by Scott Kilroy

Use Cheat instead of man

http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ see for how to install and use.

Share Button
Read More
| by Scott Kilroy

Ubuntu – Reference

http://ubuntuguide.org/wiki/Ubuntu:Jaunty#User_Administration

Share Button
Read More
| by Scott Kilroy

Fstab Guide

Someday I’ll get around to writing something up but until then this guide is pretty good http://www.linuxstall.com/fstab/

Share Button
Read More
| by Scott Kilroy

Email – If port 25 is blocked

If your isp blocks port 25 (it should) redirect traffic coming in on port 2525 to port 25 /sbin/iptables -t nat -I PREROUTING -p tcp –dport 2525 -j REDIRECT –to-port 25 # make it so that this command runs on server boot up. if ! grep -qai 2525 /etc/rc.local; then echo ‘/sbin/iptables -t nat -I PREROUTING -p tcp –dport 2525 -j REDIRECT –to-port 25’ >> /etc/rc.local fi

Share Button
Read More
| by Scott Kilroy

Create a docker container with the name option

Create a docker container with a name you choose by including the –name=”NAME” option for example you could use docker create –name=”kilroy” ubuntu:latest

Share Button
Read More
| by Scott Kilroy

Docker hostname option

You can control the hostname when you start a container by using the –name option docker run –rm -ti –hostname =”mycontainer.linuxconsultant.org” ubuntu:latest

Share Button
Read More
| by Scott Kilroy

Push docker a image to docker.com

Tag your image with: docker tag username_on_registry/image_name:latest Then docker push username_on_registry/image_name:latest

Share Button
Read More
| by Scott Kilroy

login to your local machine

using docker exec docker exec -t -i CONTAINERID /bin/bash for example docker exec -t -i 589f2ad30138 /bin/bash using docker-machine docker-machine ssh MACHINENAME

Share Button
Read More
| by Scott Kilroy

View docker logs

docker logs CONTAINERID for example docker logs c5a6254f7da2 to see logs update in realtime (similar to tail -f) add -f for example docker logs c5a6254f7da2 -f for no logs add the option –log-driver = none

Share Button
Read More
| by Scott Kilroy

View docker stats

docker stats CONTAINERID for example docker stats 2a39d6844918

Share Button
Read More
| by Scott Kilroy

Update local images

docker pull DISTRONAME:latest for example docker pull ubuntu:latest

Share Button
Read More
| by Scott Kilroy

Save changes to your docker container

You can save changes you make to your docker container by getting the container id and running the following command docker commit CONTAINERID IMAGENAME for example after installing apache I ran docker commit 89c48ac17dd7 apache-simple

Share Button
Read More
| by Scott Kilroy

Remove a local docker image

When you run “docker images” you’ll get results that look something like this REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 1d073211c498 2 weeks ago 187.9 MB To remove a image type “docker rmi -f IMAGE_ID (the 3rd column above). Warning this is permanent.

Share Button
Read More