If you need an array representation of a calender month this function will come in handy. This functionwill return an array of a given month with days properly distributed in to weeks, as in real calendar.public function buildMonthCalendar($year, $month) { $calendar = array( 'week-1' => array('Mon' => null, 'Tue' => null, 'Wed' => null, 'Thu' => null, 'Fri' => null, ...
This is a simple way to back up your database everydayGo to ubuntu command line and log in as root user, type following command to open crontab file >crontab -e type the following command in the file 0 0 * * * mysqldump -uYOURUSER -pYOURPASSWORD YOURDBNAME > /home/tommy/my_back_up/mydb_`date +\%y-\%m-\%d`.sql you can restart cron by typing >restart cron OR >/etc/init.d/cron restartThis ...
First we find the .svn folders, then we use rm to remove those folders . There are 2 methods to do this.Type this in shellMethod -1 $ find . -name ".svn" -exec rm -rf {} \;Method -2$ rm -rf `find . -type d -name .svn`
1. Append the following line to your /etc/apache2/apache2.conf . NameVirtualHost 127.0.0.2:802 . Create unique files for each of my domains within the /etc/apache2/sites-available/ folder.Create a fie called mysitename.com<VirtualHost 127.0.0.2:80>ServerName mysitename.comServerAlias www.mysitename.comServerAdmin me@ubuntu.comDocumentRoot /var/www/mysitename/html</VirtualHost>3. Enable it by creating a symbolic link from one folder to the next ( etc/apache2/sites-enabled/)sudo a2ensite mysitenam
class A { public static function get_A() { return new self(); } public static function get_me() { return new static(); }}class B extends A {}echo get_class(B::get_A()); // out put Aecho get_class(B::get_me()); // out put Becho get_class(A::get_me()); // out put A
1.Create a folder in C:\xampp\htdocs\mysite2. Edit your hosts file in windows located in C:\WINDOWS\system32\drivers\etc\ and add following line127.0.0.1 mysite.localhostDon’t delete the existing “127.0.0.1 localhost” line3.Open your C:\xampp\apache\conf\extra\httpd-vhosts.conf file and add the following linesNameVirtualHost *:80<VirtualHost *:80> DocumentRoot "C:\xampp\htdocs" ServerName localhost</VirtualHost><VirtualHost *:80> ServerName mysite.localhost DocumentRoot C:\xampp\htdocs\mys
Out put a result of a MySQL query into a CSV fileSELECT * FROM m_table INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
I created the keys with openssl using:generate a 1024 bit rsa private key, ask for a passphrase to encrypt it and save to file.openssl genrsa -des3 -out /path/to/privatekey 1024generate the public key for the private key and save to fileopenssl rsa -in /path/to/privatekey -pubout -out /path/to/publickey
svn gedit svn:externals ./Gedit is the editor that you will see the external repository information, do the nessasary change and save tochange the edit external svn repositories