Code Blog

Displaying 1-3 of 3 results.
2016/06/14 PHP,Joomla

Had to upgrade and re-install a Joomla-site. One thing that is a bit annoying is how to get the "log" and "tmp" folder variables in system configuration set correctly. Joomla needs the absolute physical path, so a relative path will not work. And if the "tmp" folder is not writable (easy to check under "System Information" -> "Folder Permissions") then its not possible to install new extensions (which I needed to do).

One way to get the full path is to upload a php file and just type it out:

<?php echo "cwd: " . getcwd(); ?>

Not ideal but it will work. I wish the Joomla system configuration UI could have an info button that would display the current path and I could just copy and paste from there. 

I suppose if I log in to the hosting company's administration website I may also be able to find the full path from there but its also a bit of a hassle.

One way that I found that seems to be an easy way to find the path is to use Akeeba backup and click "Configuration". The "Output Directory" will contain the full path to the joomla base directory. Another way (if Akeeba isn't installed) is to go to "System Information" and select "PHP Environment". Scroll down to "Apache Environment" and the OVERWRITE_DOCUMENT_ROOT variable will contain the full physical path.


2016/06/01 Programming,Xcode

After starting to use the new layout in Xcode I run into the “Frame for Button will be different at run time” warning. Not very obvious how to solve this, but after searching online I found this very useful tip:

This warning is displayed when the actual position of the element is different in your storyboard than while running the app.

You can select that element and then hit 'Option+Cmd+='.

This will update the position of the element in the storyboard and that warning will go away.

2016/06/01 OpenWRT

In order to keep the router in a stable condition I want to reboot it automatically every morning. This is a bit trickier than one would expect because the clock may get caught in an inifinite loop of reboots, see link below for more details. So the recommended way is to add a delay and update the clock before rebooting the router.

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot

Good tips from: