Monday, December 31, 2012
Windows 8 Application tile update
Ref:
http://msdn.microsoft.com/en-us/library/windows/apps/hh761490.aspx
Updating notification tile:
//1. Choose a tile contents template:
var tmpl = Windows.UI.Notifications.TileTemplateType.tileWideImageAndText01;
//2. Get tile xml dom:
var xml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent( tmpl )
//3. Update text:
var txt = xml.getElementsByTagName("text");
txt[0].appendChild( xml.createTextNode("Hello World") );
//4. UpdateImage:
var img = xml.getElementsByTagName("img");
img[0].setAttribute("src", "ms-appx:///images/logo.png");
//5. Create a notification via the new xml and set it to expire in 10 minutes:
var notification = new Windows.UI.Notifications.TileNotification( xml );
notification.expirationTime = new Date( (new Date()).getTime() + 600 * 1000 );
//6. Send the tile update
Windows.UI.Notifications.TileUpdateManager.createTileUpdateForApplication().update(notification);
Wednesday, November 28, 2012
Wednesday, November 21, 2012
CSS: box-sizing
Don't Overthink It Grids | CSS-Tricks: "Gutters
The hardest part about grids is gutters. So far we've made our grid flexible by using percentages for widths. We could make the math all complicated and use percentages for gutters as well, but personally I don't like percentage gutters anyway, I like fixed pixel size gutters. Plus, we're trying to keep too much thinking out of this.
The first step toward this is using box-sizing: border-box;. I like using it on absolutely everything.
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Now when we set a width, that element stays that width, despite padding or borders being applied."
'via Blog this'
The hardest part about grids is gutters. So far we've made our grid flexible by using percentages for widths. We could make the math all complicated and use percentages for gutters as well, but personally I don't like percentage gutters anyway, I like fixed pixel size gutters. Plus, we're trying to keep too much thinking out of this.
The first step toward this is using box-sizing: border-box;. I like using it on absolutely everything.
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Now when we set a width, that element stays that width, despite padding or borders being applied."
'via Blog this'
Saturday, September 29, 2012
Monday, September 3, 2012
MySQL: fix : Could not parse relay log event entry
Steps:
- mysql> stop slave;
- mysql> show slave status\G
- copy the values Relay_Master_Log_File, Exec_Master_Log_Pos
- mysql> CHANGE master TO master_log_file=<Relay_Master_Log_File>, master_log_pos=<Exec_Master_Log_Pos>;
- mysql> start slave;
Reference:
- mysql> stop slave;
- mysql> show slave status\G
- copy the values Relay_Master_Log_File, Exec_Master_Log_Pos
- mysql> CHANGE master TO master_log_file=<Relay_Master_Log_File>, master_log_pos=<Exec_Master_Log_Pos>;
- mysql> start slave;
Reference:
- http://www.gustavomejia.com/blog/2008/12/02/1228210800000.html
- http://www.mysqlperformanceblog.com/2008/08/02/troubleshooting-relay-log-corruption-in-mysql/
- https://www.google.com/#hl=en&sugexp=les%3B&gs_nf=1&tok=i8vkKBQNNInCf7ZBcqQgIg&cp=20&gs_id=27&xhr=t&q=could+not+parse+relay+log+event+entry&pf=p&output=search&sclient=psy-ab&oq=could+not+parse+rela&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=77b9feddd4c5d47e&biw=702&bih=461
Thursday, August 16, 2012
Monday, July 30, 2012
HTML select elements by css selectors
var arr = element.querySelectorAll( css_selector );
var first_elm = element.querySelector( css_selector );
https://developer.mozilla.org/en/DOM/Document.querySelectorAll
var first_elm = element.querySelector( css_selector );
https://developer.mozilla.org/en/DOM/Document.querySelectorAll
Wednesday, July 25, 2012
Saturday, July 7, 2012
Linux: Mount USB drive
- Plug the USB drive
- fdisk -l
- create a mounting folder. i.e. /media
- mount -t vfat /dev/sdb1 /media
To unmount
- umount /media
- fdisk -l
- create a mounting folder. i.e. /media
- mount -t vfat /dev/sdb1 /media
To unmount
- umount /media
Tuesday, July 3, 2012
Compress and split large files
# create archives
$ tar cz my_large_file_1 my_large_file_2 | split -d -b 1024MiB - myfiles_split.tgz_
# uncompress
$ cat myfiles_split.tgz_* | tar xz
This solution avoids the need to use an intermediate large file when (de)compressing. Use the tar -C option to use a different directory for the resulting files. btw if the archive consists from only a single file, tar could be avoided and only gzip used:
# create archives
$ gzip -c my_large_file | split -d -b 1024MiB - myfile_split.gz_
# uncompress
$ cat myfile_split.gz_* | gunzip -c > my_large_file
Wednesday, June 27, 2012
Apache Performance Tuning
http://httpd.apache.org/docs/2.0/misc/perf-tuning.html
Performance Related settings:
EnableMMAP Off // default is ON
Monday, June 25, 2012
Mysql replication: purging binary logs
It is recommended to purge or recycle the master/slave db binary logs on a daily or weekly basis
Here is the command:
purge binary logs before '2012-05-01';
http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html
Here is the command:
purge binary logs before '2012-05-01';
http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html
Bandwidth Monitor Linux tools
Good command line tools:
bwm
bwm-ng
iftop
Useful links:
http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-linux.html
bwm
bwm-ng
iftop
Useful links:
http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-linux.html
Tuesday, May 8, 2012
SendMail Testing tool
Use the following tools to test your SendMail server:
http://www.mxtoolbox.com
https://www.wormly.com/test_smtp_server
Default SendMail configuration allows listening only to 127.0.0.0
That causes SendMail to accept emails from internal accounts only.
To receive emails from the whole world, Edit Network ports and change 127.0.0.0 to the server external IP address or set it to All.
http://www.mxtoolbox.com
https://www.wormly.com/test_smtp_server
Default SendMail configuration allows listening only to 127.0.0.0
That causes SendMail to accept emails from internal accounts only.
To receive emails from the whole world, Edit Network ports and change 127.0.0.0 to the server external IP address or set it to All.
Thursday, April 5, 2012
Building and install PerlMagick on windows
Please follow the following steps
- It requires downloading the source code package of ImageMagick.
- Goto VisualMagick folder
- Build the solution via Visual Studio
- Add VisualMagick\bin to environment PATH
- Goto PerlMagick directory
- Copy MakeFile.nt to MakeFile.PL
- perl MakeFile.PL
- nmake
- nmake install
- restart windows
- nmake test
- It requires downloading the source code package of ImageMagick.
- Goto VisualMagick folder
- Build the solution via Visual Studio
- Add VisualMagick\bin to environment PATH
- Goto PerlMagick directory
- Copy MakeFile.nt to MakeFile.PL
- perl MakeFile.PL
- nmake
- nmake install
- restart windows
- nmake test
Subscribe to:
Posts (Atom)