Skip to main content leehalls.net

Posts

2021

  1. Pandas SQL and pain

    I’ve left the home monitoring system alone for a few years, its just sat quietly in the garage collating data into an SQL database, the only changes made recently were to move everything onto a Pi4 and add an additional camera into the motioneye system running on the same Pi. So as its a slow day i decided now was the time to update it or rather start work on it. One thing i wanted to do was re-instigate the live readings and an auto graph element and for this i needed to extract data - simple i got my old code somewhere …. somewhere … maybe.

  2. More visitors up close

    OK hands up .. these were taken whilst sat inside nice and warm through the window! so not brilliant plus a little poor editing still not bad though

  3. New lense - close-up

    So a little splurge and finally got a lense that means i dont have to be within 3m of the thing i’m trying to catch an image of! Still lots to learn but first handheld efforts dont seem to bad.

2020

  1. emacs on MS Windows and opening files

    Working mostly in the MS Windows environment i keep notes, project records in org and these files have multiple links to documents, images, saved mails etc and most are stored with hyperlinks (though i may now be migrating to attachments) but when it comes to opening the links then it takes a little extra work. When using helm and initiating links by C-c C-l and choosing file this allows me to select files from a list and use completion support to narrow down the list of files. However the file+sys option does not, so i always chose file, used helm to help find it, insert the link and then edit it to add the +sys part.

  2. COVID vs North & South

    Its interesting to me that society or rather the portrayal of modern English society is one where the class system of the Oliver Twist era and before no longer exists or has been eroded to almost non-existence. Bollocks. The number of poorer people going to the alleged “elite” universtities is minimal but I agree that the internet has muddied the water, allowed those with talents to broadcast themselves to a wide audience and earn in some cases significant money but they are still a rarity and have they crossed the divide or simply created another class?

  3. Light pollution

    In light (no pun intended) of the last post not enough darkness it was quite suprising to see more stories on the subject of light pollution filter into my news-stream, from the effect on cougars hunting in the western US to reduced pollination, affected sleep cycles and more. Although the dark sky movement has been going for a long time and reading through its site you can find out about the effects of light pollution on animals and humans, energy waste and more I guess we need people to stop being afraid of the dark but it would seem there could be a push to make artificial light a form of environmental pollution the same as other forms that we naturally consider to be pollution. For me this can only be a good thing, as i mentioned in my earlier post the benefits of simply turning the lights off could be immense.

  4. not enough darkness

    I’ve often been heard muttering the phrase “there’s not enough darkness in the world” most who hear it tend to assume i’m talking about we need more death,pestilence, war, famine etc all the “bad” things rather ironic given the COVID situation but i actually mean its too bright. For a man that loves the sunshine i also embrace the night and i prefer working in the dark or reduced light environment not nightshifts though i’ve done my fair share of those, in the office i’d often be first one in and the lights would remain off until the second person arrived, at home i never turn on the main lights unless there is a need & by this i mean looking for a needle or a genuine situation where light bright enough to blind for a few moments should one care to look directly at it, is required.

  5. outlook events for orgmode

    If like me you spend all your working life in MS products and yet you still want to or do rely on orgmode to give you some semblance of sanity, then this might help. Its not a bidirectional synchronisation and i only wanted the appointments for today to show. It queries Outlook for any confirmed appointments in the calendar and then outputs a single orgmode file in my main org folder which is automatically added to the agenda. The following code originally taken from https://sukhbinder.wordpress.com/2020/04/08/get-outlook-entries-with-python-3/ then gutted and adapted for my needs queries MS Outlook for the events in the calendar. I’ve restricted it for one day but changing the variable num_days can output more if you wanted.

  6. dotemacs in orgmode?

    Looking back i think this may have been the better way to start a journey with orgmode and emacs. My dotemacs file was a mess of code i didnt understand, half tried packages and poorly written comments. If you’ve spent any time searching for emacs help and on orgmode/dotemacs etc then i’m sure you will have heard of literate programming.

    There is a wealth of information on the subject for example on using python;

  7. Beginning Outlook email analysis

    [2020-06-24 Wed 22:36] This was originally titled “Outlook email analysis” but on reflection it sounded to presumptious for what is actually shown hence the new “beginning” addition/

    Its been a productive week and this morning i finally got around to trying my hand at using python to conduct some simple Outlook inbox analysis. I’ve wanted for a long time to have more data visualisation and so another journey begins. The following piece of code is simple and needs improvement but what it does is to connect to the outlook mailbox, and loop through all emails to provide a count of emails received against a persons name for today and it creates an org table output

  8. Emacs lisp & yasnippet

    On my home machines as detailed in this post i keep a journal and used some fu to determine which machine the journal entry was written on. I also keep a daily log for work normally this consists of start time, mileage to be claimed so the snippet template resembles

    text code snippet start

  9. My website security

    This site already uses HTTPS and SSL but whilst wandering aimlessly through some tech sites i stumbled upon reference to Mozilla’s Observatory which states;

    The Mozilla Observatory has helped over 170,000 websites by teaching developers, system administrators, and security professionals how to configure their sites safely and securely.

    Essentially it scans your site for security issues and gives you a report, hey i thought lets try it so i did and i got an F :open_mouth: :disappointed: :shit:

  10. HTML/CSS formatted agenda for emacs batch output

    UPDATE [2021-01-03 Sun 13:30]

    After posting a reply on reddit to request for help on emacs batch mode and the agenda i realised when i migrated from the pi based server to the macmini replacement i had not re-setup batch mode myself, so following my own advice below i recreated the dotemacs added in the css export from a good working installation, altered the org-super-agenda as described here and typed in the magic code:

  11. dirty python for quick link creation

    As the sub-heading to this site suggests this maybe a place to find poor python! I was updating my photography galleries and in doing so creating ox-hugo clickable image links so that the main page shows the thumbnail and a click brings up the main image. Anyway its a pain to go C-c C-l for each and every file so i cobbled together a dirty and quick python script to trawl a directory and create a text file with the necesary ox-hugo links for clickable images.

  12. batch agenda output via html

    Success! previously i mentioned difficulty in getting the agenda output using the command line in HTML form however now after a bit of baking in today’s glorious sunshine i figured it out. As normal i’d overlooked the obvious and discounted all the info i had reviewed.

    My old command looks like

    /usr/local/bin/emacs -Q --batch --load ~/.emacs --eval='(org-batch-agenda "c" org-agenda-files (quote ("/srv/dev-disk-by-id-usb-Seagate_Portable_NAA570VH-0-0-part1/drakx/orgfiles/")) org-agenda-span (quote week))' > /srv/dev-disk-by-id-usb-Seagate_Portable_NAA570VH-0-0-part1/drakx/orgfiles/agenda.txt

    and this is entered into the scheduled job section of the OMV server setup;

  13. orgmode, android and tasker

    Yes i know orgzly exists and whilst it is an excellent app it just doesn’t feel right or perhaps quick enough for me, I use it but only as a “refer to” method ie a viewer of pgp encrypted passwords or other entries and not as a capture/entry or agenda viewing system and yet because i wanted a way of quickly capturing tasks & sometimes tasks with photos I created several scenes in Tasker which work for me, using these i have to simply click an icon and can have a task populated with the right orgmode format, date etc and ready to enter text. The capture scenes write to a staging_ground.org file which is automagically sync’d via syncthing to my main machine and the agenda scene simply reads the cron-generated text output of the org agenda.

  14. COVID19

    Currently as of Thursday 21 May 2020 @ 16:09 there has been for the UK 36,042 deaths associated with the virus, 250,908 lab-confirmed cases and for the rest of the world inc UK data its 5,067,579 cases & 332,711 deaths 1. So its a very real threat and has had a significant impact not only on families but countries with some close to the brink of bankruptcy and being forced to chose letting people live in lockdown and to continue the disease control measures or sending them back to work and possibly die. Despite all this, for me personally, the enforced lockdown has been brilliant.

  15. emacs,orgmode,hugo + ox-hugo

    OK so i dont pretend to be an all knowing computer geek in fact just the opposite i’m aging computer enthusiast that grew up in the golden age of electronics and computers but i do have some understanding from starting out with BBC’s,Spectrums and hacking high score tables or re-programming the header so the game could run from microdrive instead of C90 tape :wink: through to TCL for aero engine data analysis and then python for a home monitoring system but my decision to start afresh, move to a new domain and use hugo + ox-hugo has had me reaching for a glass of the strong stuff and several relaxing hours getting my arse handed to me on COD!

  16. starting afresh

    So during this lockdown amongst other things i decided to re kick-start all projects which had either lay in waiting or been put on hold for more time, for example some of what was on that list was

    • DONE convert old mac mini to OMV5 server
    • DONE install syncthing under OMV
    • DONE get my orgmode agenda automatically rebuilt & setup sync to my phone
    • DONE setup motioneye on a RasPi to monitor my bike
    • TODO re-write dragelec the home monitoring system
    • TODO sort photos, improve Affinity workflow
    • TODO misc python scripts to mimic a second brain
      • basically these are scripts which pull data from various sources and output to a journal so for example i use Tasker to track start & end of car journey’s which gives me time spent plus GPS coords

    There are other jobs but one i had been putting off was a new domain as my current .eu one may end up being taken to the bottom of the garden and shot because of brexit, i also wanted a more controllable, more orgmode based blogging experience but a wise man once said “Coming back to where you started is not the same as never leaving” 1 and i can fully agree, I started this journey with some knowledge of hugo, reasonable orgmode knowledge and little if any CSS & to be blunt I feel like i’ve been dragged by my testicles backwards through a privet hedge by a small bearded dwarf with penchant for dense privet, what i thought would be a relatively simple transition turned out to be taking the red pill down a sewer of broken themes, conflicts and my own lack of understanding of both hugo and how to write in orgmode for ox-hugo. So i am back where started, scratched, a little bloody but wiser and with a significant amount of respect for Kaushal who not only wrote ox-hugo but this theme i’m using.

  17. ssh in to Android

    Lockdown experiment - could i run ssh and access my phone apparently the answer is yes if using the excellent Termux which i already use for emacs on android

    Firstly in termux install openssh with

    apt install openssh

    Next run ssh-keygen to generate your own access keys at this point you can choose to add a passphrase or not.

    The next step is to either create the /.ssh/authorized_keys file or ensure that the id_rsa.pub key is added to it, so first check if the file exists;