Category: quickfixes

  • Add extra validation rules to Laravel ForgotPassword

    I wanted to add a captcha to the Forgot Password form, so I ended up doing this to the default ForgotPasswordController: Only relevant bits are shown there.

  • React Native: Application is not registered

    – This is either due to a require() error during initialisation or failure to call AppRegistry.registerComponent. I had been struggling with this for some time and the answer was right there… I had to make sure I called AppRegistry.registerComponent with the right params/appname – I had renamed my app and forgot to update the class…

  • HTTPS and GA referral exclusion

    After converting a site to be served over TLS, we noticed the drop off rates increasing on some pages. This was because: user was being redirected to a payment page on another domain that was also served over TLS. As, now both sites were served over TLS, Google Analytics was picking up the referrer (HTTPS…

  • missing scheme in email body url

    Some mail service providers (Yahoo Mail exhibits this at the moment), do not like links that do not have a scheme(http/https for instance) and will make the link non-clickable by removing the href. The fix is simple: Google Google

  • how to not run a cron job between certain datetimes

    Say, I have a cron job entry and do not want the job to run between 2013-02-01 9PM (Feb 1st 2013) and 2013-02-02 11AM (Feb 2nd 2013), this is one possible solution (in crontab).

  • rsync only certain files

    Create a file on on the origin server and use the –files-from option cd / rsync -anvi –files-from=/tmp/only_these_files . to-server:/ cat /tmp/only_these_files /srv/www/mysite/uploaded_files/9a3d3d9046aaad4bbe3074d794a6adaf.jpg /srv/www/mysite/uploaded_files/5ca1c97efd730427f846e457bd0a0667.png /srv/www/mysite/uploaded_files/5b0923025b4a1fde3a34119bfcd56567.jpg /srv/www/mysite/uploaded_files/870ed45d9ad704deace8fb541242425a.jpg

  • Starting KVM guest after memory change

    After a memory module was taken out the system, the KVM guest was failing to start complaining about insufficient memory. Editing the domain XML file (in /etc/libvirt/qemu on Debian) to use less RAM and then trying to start the guest did not work. I had to do this: libvirt-bin restart for the the updated XML…

  • WordPress + Nginx + Permalinks Rewrite rules

    The following works for me: I have my blog here: http://www.trk7.com/blog/and my permalink structure is: /%postname%/

  • myisamcheck running out of tmp space

    Recently I was running myisamcheck on an entire database housed inside a vserver. And, by default vserver mounts a 16MB ramfs on /tmp. This obviously is not an ideal solution when you are running a DB server that has a few tables that are around 20GB. So I had to specify a different directory for…

  • Getting rid of MySQL Warning: Truncated incorrect DOUBLE value

    If you come across a cryptic warning like this: | Warning | 1292 | Truncated incorrect DOUBLE value: ‘xxxxxxx’ on running a MySQL query, it could be caused by using a numeric value against a CHAR/VARCHAR column. —assuming `name` is a CHAR/VARCHAR column —the following query might cause warnings SELECT * FROM `t1` where `name`…