My god was this a pain in the ass.. It was impossible finding the correct solutions on the web to do this in Ubuntu, so for those of you who are looking to do a crontab in Ubuntu check out the following:
What im doing here is creating a crontab to backup my www root folder and my db.
To begin the process we first do the following in terminal as root or a regular user:
#>crontab -e
this will invoke nano, and you can input something similar to the following lines:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the crontab
# command to install the new version when you edit this file
# This file also has a username field, that none of the other crontabs do
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=mailer@mailer.com
# m h dom mon dow user command
01 01 * * 0 /bin/tar cfP /mnt/nas/backup/www/`date +\%y-\%m-\%d`-server-name-www.tar /var/www
01 01 * * 0 /usr/bin/mysqldump –opt –all-databases > /mnt/nas/backup/mysql/`date +\%y-\%m-\%d`-server-name-mysql.sql
So basically whats happening here is we are tar-ing the www folder and sending it to the NAS drive with a timestamp. file ex will be: 09-01-01-server-name-www.tar
And its basically the same exact thing for the database backup.. Im just doing a mysqldump and the output goes to a sql file that ends up with the filename: 09-01-01-server-name-mysql.sql
Hope this helps someone..
Web Developing
This little code will check to see what page is current, then set the CSS color class “active”. It will make the text/link look selected and stay selected.
index.rhtml
<div id=”nav”>
<a <% if params[:controller] == ‘name_here’ %>class=”active”<% end %> href=”../name_here”>Link name</a>
</div>
and then make sure that you have the class “active” defined in your CSS:
main.css
#nav .active {color: #RED}
Web Developing
Stay on plane!
Ever wonder why pro golfers are so consistent? Well its cause they spend countless hours every day practicing these perfect positions!
One thing I would like to focus on in this post is spine tilt in the golf swing. Spine tilt is important when swinging the club. The reason for this is because it keeps us consistent and rotating on an axis which creates a better swing plane. If a golfer has a 90 degree spine tilt (which would be the spine being perpendicular to the ground) he would lose power and have no time for the club to lag behind his body. Having a spine tilt to the right, for a right handed golfer gives them time to lag the club and stay behind the ball rather than getting ahead of it and hitting a blocked shot or a high slice! When your spine gets too ahead and upright (90%) you tend to release the club way too early to get the club face to catch up to hit the ball squarely.
So the next time you go out to practice, think about your spine tilt. Do you have any?
Golf
Stay on plane!
Ever wonder why you cant stop hitting that HUGE slice or HUGE snap hook!? well most of these shots come from having a swing that is OFF plane. With a few simple flashlights and about an hour of practice a day you can be hitting on plane and bombing it down the middle for only $3.00!
Head over to wal-mart and grab 2 flashlights (preferably exactly the same). Tape them both together with the butt end of the handles against each other. You should end up with a double ended light SABER! Ok, now take your perfect setup as if you were going to hit a shot. Make sure you turn on both flashlights, and swing the flashlights on a line going all the way back and through. The best way to do this is to stand next to a wall and swing the lights along the bottom of the wall, staying on the line. Remember both flashlights should point at the line. Do this a few million times and you’ll be on your way to a perfect plane!
Golf
COIL drill
Want to see more power in your drives and iron shots? Well the key ingredient is making a good and full shoulder turn with minimal hip rotation. In the golf world this is called the “X” factor. A proper turn should have about 45 degrees of hip turn and about 90 degrees of shoulder turn in the back swing. If your tiger, your looking at more of about 40 degrees hip turn and about 100 to 110 degrees of shoulder turn. I don’t know if that’s exact but it must be close.
A good drill to incorporate this massive turn into your golf swing is right around the corner, keep reading. With a club in your hand (preferably a driver), grab the club so that it is parallel with the ground. Hold it so that it looks like your going to lay it flat on a table. Take your perfect golf stance and with the club still in your hands, take your backswing and focus on making a good shoulder turn and laying that club on the imaginary table. If you have made a bad shoulder turn then there will be no angle in your back. A good way to see if you are doing this is to make swings in front of a mirror. When you swing back, you should see your left should over your right knee and if you were to draw a line on your back, it would be angled. In another words, the angle your back creates is NOT straight up and down. Try this drill over and over again till you can do it in your real swing. You’ll be hitting drives right past those buddy’s your play with.
Golf