Skip to main content

Posts

Delete files older than 365 days

I must delete IIS *.log files in  older than 365 days. D:\Logs | -W3SVC1 -W3SVC2 -... -W3SVC33 daily-delete-logfiles-older-than-365-days.cmd :: Daily delete log files older than 365 days :: Created on: 20161120 :: Created by: :: Last modified on: :: Last modified by: :: History: SET DIRLOG=E:\_scripts\Logs\ :: Echo @path to test first :: FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c echo @path @fdate" :: Delete files ECHO "Begin" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c del @path" >> %dirlog%daily-delete-logfiles.log ECHO "Finished" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log :: END of script /P : Path to folder /S: recurse into subdirectories /M *.l...

Check and install php7.0-mbstring extention on Ubuntu 16.04 and Microsoft Windows

While learning Facebook SDK for PHP I overlooked one of system requirements preventing my code from running on my host. That is The mbstring extension. Facebook SDK for PHP's system requirements Check if mbstring is enabled root@ubuntu001:~# php -a Interactive mode enabled php > echo extension_loaded('mbstring'); php >exit root@ubuntu001:~# apt-cache search php7 | grep mbstring php7.0-mbstring - MBSTRING module for PHP root@ubuntu001:~# Install php7.0-mbstring root@ubuntu001:~# apt-get install php7.0-mbstring Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required:   fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0   libjpeg-turbo8 libjpeg8 libmcrypt4 libtiff5 libvpx3 libxpm4 Use 'apt autoremove' to remove them. The following additional packages will be installed:   libapache2-mod-php7.0 php7.0-cli ph...

Let's encrypt with apache and nginx on Ubuntu 16.04

Let's Encrypt - Free Certificate Authority Setup SSL for nginx using Let's encrypt &mdash a free, automated, and open certificate authority brought to you by the nonprofit Internet Security Research Group (ISRG).

error setting certificate verify locations when run git clone

I run into this error while using git clone. D:\Projects>git clone https://github.com/jonmountjoy/facebook-template-ruby Cloning into 'facebook-template-ruby'... fatal: unable to access 'https://github.com/jonmountjoy/facebook-template-ruby/': error setting certificate verify locations:   CAfile: C:/Program Files (x86)/Git/mingw32/ssl/certs/ca-bundle.crt   CApath: none How to fix Run DOS Prompt as Administrator, and run git config --system http.sslcainfo "Path to ca-bundle.crt" Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32> git config --system http.sslcainfo "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt" C:\WINDOWS\system32> Then, I can run git clone successfully. D:\Projects>git clone https://github.com/jonmountjoy/facebook-template-ruby Cloning into 'facebook-template-ruby'... remote: Counting objects: 177, done. remote: Total 1...

MySQL: Notes

Ways to check MySQL version mysql --version mysql -V dpkg -l 'mysql-sever' mysql -u root -p How to check MySQL version: mysql --version Database folder On Microsoft Windows, by default, MySQL save databases in this folder: %ProgramData%\MySQL\MySQL Server 5.5\data Check databases' size SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; Export database schema $ mysqldump -u root -p --no-data wordpress1001 > c:\backup\schema-wordpress1001.sql Enter password: **************** Create a dedicated user to backup databases Give credit to: http://www.fromdual.com/privileges-of-mysql-backup-user-for-mysqldump Create dedicated mysql user and grant privileges to run backup $ mysql -u root -p CREATE USER 'backupdb'@'localhost' IDENTIFIED BY 'passwordhere'; GRANT SELECT,SHOW VIEW,RELOAD,REPLICATION CLIENT...

PHP Manager on IIS 8.5

Install PHP Manager for IIS using Web Platform Installer 5.0 Install PHP Manager for IIS using Web Platform Installer 5.0 PHP Manager on IIS 8.5 Remove PHP 5.3 from IIS 8.5 Remove PHP 5.3 from IIS 8.5 Some PHP.ini settings to check session.cookie_secure = True expose_php = off

Google Drive: Notes

https://drive.google.com

Microsoft Windows Server: Notes from the field

Who is currently logged on? Who is currently logged on server Enable Network Level Authentication for Remote Desktop connection Enable Network Level Authentication for Remote Desktop connection

Microsoft Excel: How to find duplicate values

Use Conditional Formatting to find duplicate values in Excel Use Conditional Formatting to find duplicate values in Excel

PluralSight: Free Courses

Register free account at https://app.pluralsight.com to explore these free courses.