Posted by antonio lorusso on the October 12th, 2009
1. Creating a remote repository before the local one
Step 1: create the folder on the remote server and initialise the empty bare repository
ssh username@yourserver
mkdir yourgitremoterepo.git
cd yourgitremoterepo.git
git --bare init
Step 2: back to your machine, clone the repository
git clone username@yourserver:yourgitremoterepo.git
2. Making your existing local repository available on remote
Step 1: I assume that you have done something like this
cd yourlocalrepo
git init
git add .
git commit -a -m "first commit"
Step 2: to create the remote repository, login to your remote server and initialise an empty bare repository
ssh username@yourserver
mkdir yourgitremoterepo.git
cd yourgitremoterepo.git
git --bare init
Step 3: now back to your machine, link your remote repository with the local one and push all your files
git remote add origin username@yourserver:yourgitremoterepo.git
git push origin master
Posted by antonio lorusso on the September 7th, 2009
If you have tried that command, you already know that doesn’t work! Here is the correct procedure to update gem under ubuntu/debian without using apt-get/aptitude $ sudo gem install rubygems-update $ cd /var/lib/gems/1.8/bin $ sudo ./update_rubygems $ gem -v $ 1.3.5
Posted by antonio lorusso on the August 23rd, 2009
After installing PHP 5.3, you may get a warning for every function involving date and time like Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for [...]
To fix this, you can set the timezone in your script using date_default_timezone_set(‘Europe/London’); or set it into the php.ini file with date.timezone = ‘Europe/London’
Posted by antonio lorusso on the August 14th, 2009
If you have recently upgraded to php 5.3 and you have done it using sudo port install php5 +apache2+macosx+mysqlnd+pear you should have noticed that you cannot use mysql anymore because of an error that, I’m sure, is driving you crazy PHP Warning: mysqli::mysqli(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /Users/antonio/Sites/db.php on line 25
PHP Warning: mysqli::mysqli(): (HY000/2002): No such file or directory in /Users/antonio/Sites/db.php on line 25 The problem comes from php and unfortunately is only fixable changing the location of the mysql.sock from the usual macports directory /opt/local/var/run/mysql5/mysqld.sock to /tmp/mysql.sock editing the file /opt/local/etc/my.cnf
You have reverted an svn merge and you have a lot of files not tracked (with exclamation mark, basically)? Clean it up: svn status | awk '$1 == "?" {print $2}' | xargs -t -i rm -r {} Again, knowing awk and xargs turn helpful!