Tuesday, April 25, 2017

How to add and use syntaxhighlighter on blogger (blogspot)

Peace be upon you, Now you can use syntaxhighlighter in your blog by simply add the code below to the <head/> element in the template for your Blogger blog. For your record, I'm using syntaxhighlighter version 3.0.83 from official CDN, This version removed clipboard.swf because it is vulnerable to arbitrary XSS attack on Wordpress. But as blogger, nothing to worried about it.

<!-- BEGIN SyntaxHighlighter BEGIN -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/> 
<script language='javascript'> 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
</script>
<!-- END SyntaxHighlighter END -->


If you found my host are down or this script are outdated, please inform me. I will update it as soon as possible ;)

Tuesday, March 21, 2017

MySQL snippet : Calculate GST inclusive price from existing price

SELECT 
 name, 
 cost,
 price+ROUND( (price *(6/100)), 2 ) AS roundedgstvalue
FROM 
 `sma_products`
WHERE 
 `id` = '77';

Tuesday, March 14, 2017

MariaDB 10.1.22 now available

The MariaDB project is pleased to announce the immediate availability of MariaDB 10.1.22. This is a stable (GA) release. See the Release Notes and Changelogs for details.


- - Links - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

MariaDB 10.1.22
- Release Notes: https://mariadb.com/kb/en/mdb-10122-rn/
- Changelog: https://mariadb.com/kb/en/mdb-10122-cl/
- Downloads: https://downloads.mariadb.org/mariadb/10.1.22

About MariaDB 10.1:
- https://mariadb.com/kb/en/what-is-mariadb-101/

APT and YUM Repository Configuration Generator:
- https://downloads.mariadb.org/mariadb/repositories/



- - MariaDB Webinars - - - - - - - - - - - - - - - - - - - - - - - - -

There are several upcoming MariaDB-focused webinars and many previously held ones available to watch on an on-demand basis at:
- https://mariadb.com/news-events/webinars


- - MariaDB Books - - - - - - - - - - - - - - - - - - - - - - - - - -

There is an ever-growing library of MariaDB books available to help you get the most out of MariaDB. See the MariaDB Books page for details and links:
- https://mariadb.com/kb/en/mariadb/books/


- - User Feedback plugin - - - - - - - - - - - - - - - - - - - - - - -

MariaDB includes a User Feedback plugin. This plugin is disabled by default. If enabled, it submits basic, completely anonymous MariaDB usage information. This information is used by the developers to track trends in MariaDB usage to better guide development efforts.

If you would like to help make MariaDB better, please add "feedback=ON" to your my.cnf or my.ini file! See http://mariadb.com/kb/en/user-feedback-plugin for more information.


- - Quality - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


The project always strives for quality, but in reality, nothing is perfect. Please take time to report any issues you encounter at:
- http://mariadb.org/jira


- - Support MariaDB - - - - - - - - - - - - - - - - - - - - - - - - -

If you would like to contribute to the MariaDB Foundation, please see the "contributing" and "donations" pages. We also have merchandise available in a cafepress store. All proceeds go to support the MariaDB Foundation.
- https://mariadb.com/kb/en/contributing
- https://mariadb.org/donate/


We hope you enjoy MariaDB!

Monday, March 13, 2017

Installing ionic cordova on Fedora 25

Installing ionic on Fedora in quite easy
$ sudo dnf install npm nodejs
$ sudo npm install -g cordova ionic
$ ionic start --v2 myApplication tabs
$ cd myApplication
$ ionic serve

If you need to update ionic, just ran
$ sudo npm update -g cordova ionic

Thursday, March 9, 2017

Reset the MariaDB Root Password

If you forget your root MariaDB password, it can be reset.

1. Stop the current MariaDB server instance, then restart it with an option to not ask for a password:
sudo systemctl stop mariadb
sudo mysqld_safe --skip-grant-tables &

2. Reconnect to the MariaDB server with the MariaDB root account:
mysql -u root

3. Use the following commands to reset root’s password. Replace password with a strong password:
use mysql;
update user SET PASSWORD=PASSWORD("password") WHERE USER='root';
flush privileges;
exit

4. Then restart MariaDB:
sudo systemctl start mariadb