ok.. well after searching the internet via google… once again I was disappointed to find nothing about replacing a current folder in the svn repo with a newer folder that contains no .svn directories.
Just so you guys know.. the reason i was doing this was to upgrade my version of wordpress.. My site is on subversion control and i just wanted to replace the wp-includes folder with the newer wp-includes folder. So this is how I did it.
First i deleted the old folder:
~$ svn delete old_folder_name
Than i commit the delete with a nice little message:
~$ svn commit -m "deleted old folder"
Than i add the new folder in the repo:
~$ cp /path/to/new_folder /path/to/new_folder_destination
Than i tell svn im adding the new folder:
~$ svn add new_folder/
Than finally i commit:
~$ svn commit -m "added new folder"
Done. Hope this helps… its better than deleting the whole repo and creating a new one with the new folders.. (some of what i read from google searches).
Web Developing
Im glad to say that it is actually possible to mount an ext3 formatted linux drive in mac OS X Snow Leopard using a few tools. Let me share with you how I did it.
Download fuse-ext2
Also make sure you have MacFUSE otherwise fuse-ext2 wont work.
Install both of those and run a few commands in terminal:
first, create a mount point such as: $ sudo mkdir /Volumes/HD
next, navigate to the fuse-ext2 folder: $ cd /usr/local/bin/
execute the fuse command: $ sudo ./fuse-ext2 /dev/nameOFdisk /Volumes/HD/ -o force
note:(nameOFdisk can be found by typing disktool -l).
Heres some useful information if you dont understand my syntax:
$ fuse-ext2 <device|image> <mountpoint> [-o option[,...]]
options:
ro : mount read only
force: mount read/write
allow_others: allow other users to access
debug: noisy debug output
Voila! your drive should mount, and you should have read/write access as well! man i love mac.
Chatterlings, Web Developing
In this example I am showing you how to use the crontab in order to reload a fresh copy of a DB at 12 noon and 12 midnight everyday. Lets take a look:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
0 12,0 * * * /usr/bin/mysql -u username -ppassword database_name < ~/backupfile.sql
You can see that I am connecting to mysql with my -u username and -ppassword ( And no, I did not make a mistake by not putting a space in between -ppassword, its supposed to be like that, if you put a space in between it thinks that *space* is part of your password.) and telling it to import the sql file backupfile.sql to the database database_name. This script is good if you need to reload a DB with fresh new data everyday. For example if you have a TEST CRM that people can use and test, you dont want people to input so much junk, so you have to reset the test data ever so often.
I love cron. hes a good friend of mine!
Web Developing
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
There is a great article on how to read directories and output their results with Ruby on Rails. If you would like to find out how this works and how to implement check out this website! It explains perfectly on how to do this. This is a great tip because I could never find anything on google that worked properly, but this does!
**The tutorial is here…
Web Developing
you can use -l to limit the bandwidth usage of SCP.
example:
$ scp -l 200 user@host:~/files .
Web Developing