Blog

  • Automated watering system project notes

    The plastic T-connectors broke over the winter.  Not very hardy.  Use the internal ones with hose clamps.

    The solenoids kept up, so far.
     
    Lost the code to the automated system.
     
    GPIO pin 7 – Far East solenoid – hanging plants.
    GPIO pin 8 – One West of Pin 7 solenoid – walk way floor bed. Soaker hose. North side of garage.
    GPIO 24 – not in commission ATM (2014-05-14) reduced watering schedule, to stress plants to help fruit. Back deck.
    GPIO 25 – not in commission ATM (2014-05-14) [was in action, but disabled, as overgrown with weeds. South side of garage.
     
    Cron job should be
    GPIO pin 7 morning, evening 30 seconds, spray
    GPIO pin 8, 60 minutes, morning.
    GPIO 24/25, …
     
     
    Ideas:
    Web Status page, for GPIOs…
     

  • [fixed] raspbian / debian apt-get connect (101: Network is unreachable)

    Are you having issues
    When I ran:
    $> sudo apt-get install mosh
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following extra packages will be installed:
    libio-pty-perl libprotobuf7 libutempter0
    The following NEW packages will be installed:
    libio-pty-perl libprotobuf7 libutempter0 mosh
    0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
    Need to get 767 kB of archives.
    After this operation, 2,190 kB of additional disk space will be used.
    Do you want to continue [Y/n]?
    Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libio-pty-perl armhf 1:1.08-1
    Cannot initiate the connection to mirrordirector.raspbian.org:80 (5.153.225.207). – connect (101: Network is unreachable)
    ….
     
    To fix this error:
    $> sudo route add default gw 192.168.1.1
    This will add the default gateway to route… as the RPi can’t find it’s way out of the network.
     

  • xdebug.ini with phpstorm

    [Server xdebug.ini file]

    zend_extension=xdebug.so
    xdebug.remote_enable=true
    xdebug.remote_connect_back = On
    xdebug.profiler_enable=1
    xdebug.profiler_output_dir="/tmp"

    Zero config phpstorm xdebug mode will now work.
     
     
    [Ensure your router isn’t blocking xdebug]
    Port Trogger is turned on

    • Trigger port: 80/tcp
    • Incoming port 9000/tcp

    OR
    Set your local machine as the DMZ
    OR
    Port forwarding

  • mac ports php rsync version not default

    You have a mac, and you’ve discovered that you want to install later versions of software that aren’t default on the Mac.
     
    Say, python 3.x, a newer version of PHP, curl, rsync… etc.
    you’ve installed them, and they reside nicely in /opt/local/bin
    but whenever you’re in the shell, they aren’t being used… what gives?
    run the following command:

    $> hash -r

     
    it’ll clear your executable cache.
    prior to running hash -r,

    $> php --version

    shows up 5.4.9

    $> hash -r
    $> php --version

    shows up php 5.5.11
     
     

  • New Car Smell? Getting rid of new car smell

    Some people love it.  Some people hate it.
    To get rid of new car smell… Febreze your car.  Just got these from home depot ($6.00 CDN + tax).  New car smell, by the next morning, gone/masked.  Two things: it smells nice (if you like that scent), and it’s getting rid/masking the new car smell.
    Still drive with the windows down to air out the minivan though.

  • So my site was compromised…

    Someone cracked my site, and started running a litecoin cpu miner on my server.
    I didn’t know how to remove them, thought I patched up the system.
    If you found out your site is hacked:

    1. Calm down
    2. Back up the system
    3. Diagnose what happened. Log files, etc… google it.
    4. Wipe it clean, and start fresh.

    Luckily I had backups… but still frustrating.
    Keep calm, carry on. Remember to update your site on a consistent basis.

  • Personal domain cname alias to ddns

    I know this will be giberish to most of my friends…
    if you have your own personal domain name; and decent router that supports ddns services, or a computer remains on most of the time, you could get something like:
    DOMAIN: privatelan.lloydleung.com to point to your home LAN, and no longer a need to remember your IP while away from your network.
    Say you wanted to connect to a device at home, and control it. You could now.
    How would you like to be able to connect to your home network like: http://home.yourpersonaldomain.com and log into your personal webserver. Want another protocol instead of http, sure no problem.

    1. Sign up with a ddns service your router supports. Or if your technically savvy run a deamon/cronjob yourself.
    2. Set a cname on your dns that points to a ddns.
      • if you don’t have access to your dns, contact your administrator, and they should be able to help you out on this.
    3. Setup on your computer or router update the ddns on the regular basis.
      • I have a raspberry pi, which runs a cron job every 5 minutes, to connect and update my ddns provider.
    4. Create the port forwarding to the devices you want to go use.
      • Such as HTTP, that would be port 80. The incoming port would be port 80, and you would forward it to an internal IP, say 10.0.0.101, on port 80. Save and apply these changes.
      • When you connect to http://home.yourpersonaldomain.com it will now try and connect to your internal network machine that has the ip 10.0.0.101 on port 80.
    5. Magic.

    So as an example, If I had a cname alias was “personalnetwork.lloydleung.com”, the ddns client will update the ddns server. On my router, I’d need to port forward whatever the application I was trying to go use. Some popular applications to use for this purpose would be RDP (port 3389), VNC (port 5900), ssh (port 22). How to setup these applications is outside the scope of this entry, and google is your friend.

  • PS3 YouTube App – unable to contact youtube fix

    I was getting “Unable to contact YouTube”. I believe my current version as of writing is 1.0.4.
    This is how I fixed it. I change the DNS settings on the PS3, to point to 8.8.4.4, and 8.8.8.8 (google’s DNS servers). After this change, the youtube app worked just fine.
    I gave my PS3 a static IP, and and applied the proper settings. Test the PS3 internet settings, and start the YouTube app. Everything should work, at least it did fo rme.
    Hope this helps… drop a line if it did.
    [Update: 2017-01-17] Ensure that your time and date are correct.  Without this, SSL will fail, as it requires that your time is near correct.

  • Magento Customer Segments vs Customer Groups

    A good primer is located here:
    http://gregdemetrick.com/2011/10/06/magento-customer-groups-vs-segments/
     
    One thing I really wanted to add to that list so others can know:

    Customer groups are related the catalog promotional rules.

    vs.

    Customer segments are related to shopping cart promotional rules.

  • Magento customer segment by past purchase history

    I wanted to fulfil the following use case:
    Create a customer segment based on past purchase history. If a user has purchased SKU-X, they are to belong to a given customer segment.
    The problem was, I could not remember why the SKU was not listed in the drop downs while adding a condition in the purchase history.
    Enabled “Use for Promo Rule Conditions” on the “SKU” attribute; it allowed “SKU” to show up in the promotional drop downs.