Category Archives: Programming

Useful SSH commands for access issues and Keys

Load custom php.ini with CRON job

Live and learn. I didn’t realize that when a cron job runs, it does not load the site php.ini file, but by adding a custom directive, we can tell the the php cron job to load the file. The error I was receiving is below even though I had allow_url_fopen enabled:
Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/username/script.php on line 12
Adding the custom directive resolved the issue and hopefully will for you too.

How to duplicate | copy a Magento Database with SSH

I was a bit hopeful with phpMyAdmin “Synchronize”, but Magento’s databases are apparently too big for it because I ended up with white screens and partial uploads.  I resorted to using SSH and doing it over command line.  Two lines of code and you can export from your live database and import into a production database.  Here you go. Export   Import Hopefully saved you some time and frustration 🙂

How to change “Date Modified” in Windows with PowerShell

I was doing some development locally and needed to change the file time on some files so I could delete certain files in a directory.  Below is the code I used to change the files modified time: Hopefully you find this as useful as I did!

Couple of useful Powershell commands

Write all contents of folder to a .txt file.  Helpful if you have a folder of images and need a .txt list Recursive find query.  Super helpful to find code snippets within a local project