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
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 ...
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, ...
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. 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
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
If you want to get the phpunit coverage report for a single class you can use --filter setting with the --coverageoption.phpunit --coverage-html ./report --filter InsuranceStatusEligibilityFilterTest PluginAllTests.php
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
Pass the frequency and current date to get an array of dates.eg.getDatesForYear(4,'2011-01-01');the array you get will have the following dates"2011-04-30","2011-08-31","2011-12-31"public function getDatesForYear($monthlyFequency,$date){$dateParts = explode("-",$date); $firstDayOfTheYear = $dateParts[0] . '-01-01'; $lastDayOfTheYear = $dateParts[0] . '-12-31'; $i = $firstDayOfTheYear;for(strtotime($i);strtotime($i)<=strtotime($lastDayOfTheYear);) { $accruDate[] = date('Y-m-d',strtotime($i . " +$monthlyFe