Monday, August 19, 2013

Greek Laters in LaTeX

Greek letters are essential in writing mathematical equations. Many text editors
provide equation editors but we can say the most comprehensive one is the LaTeX. The list below represents letters and corresponding LaTeX commands.
The image of this list is imported from the site http://web.ift.uib.no/Teori/KURS/WRK/TeX/sym1.html
http://web.ift.uib.no/Teori/KURS/WRK/TeX/t1.gif

A list of other special characters can be found in site http://www.noao.edu/noaoprop/help/symbols/

Getting MySQL Backup and Archiving

Hi everyone!

In this article, I am going to show you how to get MySQL backup and archive on Linux. If you use MySQL or any data base, you need backup your database and archive after. So, If you work for huge datas, you get what I mean actually.


I am sure that you heard phpmyadmin before. This is alternative with a user friendly interface for developers. You can import and export datas or all databases. If your size of data is small or medium, phpmyadmin will be perfect for this. But if the size of data increases, phpmyadmin should be doomed. That's why we need console, namely mysqldump! In short if you dont want to get 504 gateway error message, just use it :)

In this regard, let me show you some codes:
$. mysqldump --add-drop-table -h localhost -u username
-p dbname > dbname.sql
$. ls
dbname.sql

The commands given above show us getting dbname database backup and touching dbname.sql file. Using ls command, just listing files in the folder.
$. tar cvzf archive.tar.gz dbname.sql
dbname.sql
$. ls
archive.tar.gz dbname.sql

The commands given above also show us archiving dbname.sql file to archive.tar.gz archive file. After that listing files on there.
Like you have seen up here, we created a archive file. But if want to open it, just do like:
$. tar xvzf archive.tar.gz
dbname.sql

Then we need remove .sql extension file, because it's size may be huge.
$. rm *.sql
$. ls

That's it! What did we do above? We just get the database backup and archive it. After that remove the .sql file. What we've got is my backup archive.
We'll see you next article!

How To Create Scheduled Jobs With Crontab in Linux

Hi everyone!


In this article, I want to talk about cronjob. Some of us heard about this subject before. Cronjob scheduled task used in the sense of is very important for us. Because you can use it everytime you have to set some scripts will run next date. So, imagine that you have got a web site there are so many users on it. If you want to send e-mail to all your members at 02:00 am, here is the time you need cronjob!

Some hosting companies offer to manage cronjob service, but not all. Because of it is every hosting have not CPanel. Maybe you can use SSH or something else. Me, show you how to manage cronjob using SSH. In this regard, open your Unix Server using SSH, and;

vi /etc/crontab

* * * * * ( [minute] [hour] [day] [month] [day of the week] )
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ │
│ │ │ │ └───── day of the week (0 – 7) (total 7 days)
│ │ │ └────────── month (1 – 12)
│ │ └─────────────── day (1 – 31)
│ └──────────────────── hour (0 – 23)
└───────────────────────── minute (0 – 59)

//test.php file
$db->query("INSERT INTO db_name.table_name(field_name) values('test')");
 
#cronjob file
* * * * * username php test.php

The code given above shows us the script that adds data to the database every minutes.
*/15 * * * * username php test.php

The code given above also shows us the script that adds data to the database every 15 minutes.
#02:00am at night
00 02 * * * username php test.php
 
#every 3 hours during the day
0 */3 * * * username php test.php
 
#each hour
0 * * * * username php test.php
 
#4 pm o'clock on the 15th day of each month
00 16 15 * * username php test.php
 
#weeks every night at 2 am
00 02 * * 1-5 username php test.php
 
#every hour every Sunday
0 * * * sun
 
#every 3 hours
0 2,5,8,11,14,17,20,23 * * * username php test.php

The codes given above shows us different cronjob examples. You can try and work for creative and usefull cronjob examples.
We'll see you guys next article!

Linear Regression Revisited



If she loves you more each and every day, by linear regression she hated you before you met.






- Your theory is wrong!
- Out, liar! 


Sunday, August 18, 2013