Menu
  • Home
  • Recent Posts
  • My Skills
  • My Projects
    • All Projects
  • My Blog
    • PHP MySQL Development
    • Laravel Development
    • Javascript Development
    • WordPress Development
    • Magento Development
    • System Administration
  • Contact

Month: April 2018

Complex Eloquent Query

April 30, 2018
| No Comments
| PHP MySQL Development

A query below selects products that need to be updated in a remote application. It takes quantities of products in host application that are connected to source products application. On top of that it looks at all the orders that are in “Pending” status and reserves quantities for those products. SELECT products.quantity_available, connector_products.stock_id, products.id, connector_products.sku,…

Read More »

Posted in PHP MySQL Development

Upload to FTP with PHP

April 29, 2018
| No Comments
| PHP MySQL Development

$fp = fopen(’https://www.example.com/pdfdoc’, ‘r’);   $user = "sammy"; $pass = "password"; $ftp_server = "192.168.10.10";   //should be wrapped in try catch to properly handle errors $ftp_conn = ftp_ssl_connect($ftp_server); $login = ftp_login($ftp_conn, $user, $pass);   ftp_chdir($ftp_conn, ‘path/to/folder’); //can also use ftp_pwd   ftp_pasv($ftp_conn, true); //passive mode   ftp_fput($ftp_conn, "mydocument.pdf", $fp, FTP_BINARY);   fclose($fp); ftp_close($ftp_conn);$fp = fopen(‘https://www.example.com/pdfdoc’,…

Read More »

Posted in PHP MySQL Development

Finding Directories And Files And Changing Permissions

April 6, 2018
| No Comments
| System Administration

I always forget how to do this: find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \;  

Read More »

Posted in System Administration

Archives

  • July 2021
  • April 2021
  • February 2021
  • October 2020
  • September 2020
  • August 2020
  • May 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • December 2018
  • November 2018
  • September 2018
  • August 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • November 2017
  • October 2017
  • September 2017
  • July 2017
  • June 2017
  • December 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016

Meta

  • Log in
Back to Main Page

© 2020 Alex Rusin. All Rights Reserved.