Skip to content

Instantly share code, notes, and snippets.

@regexyl
Last active March 31, 2022 10:13
Show Gist options
  • Save regexyl/06e435bceaf914567114f16bc66b0616 to your computer and use it in GitHub Desktop.
Save regexyl/06e435bceaf914567114f16bc66b0616 to your computer and use it in GitHub Desktop.

Revisions

  1. regexyl revised this gist Mar 31, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@
    - `launchctl load ~/Library/LaunchAgents/com.gilite-notes.notes.plist`
    - Test the plist file by manually triggering it:
    - `launchctl start com.gilite-notes.notes`
    - Check if the plist file is valid:
    - `plutil ~/Library/LaunchAgents/com.gilite-notes.notes.plist`

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.
  2. regexyl revised this gist Mar 31, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,12 @@
    - `cron` worked after a few tries, incl. setting the git config to replace `https://github.com/` with `[email protected]:` since one of the errors specified `fatal: could not read Username for 'https://github.com': No such file or directory`. (see [this](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo))
    - To get over the same error with `launchd`, grant cron 'Full Disk Access' at Security & Privacy in macOS.
    - The cronjob can be edited via `crontab -e`, while list of cronjobs can be outputed via `crontab -l`. Cronjob outputs can be viewed with `mail`.
    - re: UPDATE on ^ - Got `launchd` to work! The issue was the same; enable 'Full Disk Access' for `launchctl`
    - Remember to execute the following load and unload commands every time you make a change to the plist file:
    - `launchctl unload ~/Library/LaunchAgents/com.gilite-notes.notes.plist`
    - `launchctl load ~/Library/LaunchAgents/com.gilite-notes.notes.plist`
    - Test the plist file by manually triggering it:
    - `launchctl start com.gilite-notes.notes`

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.
  3. regexyl revised this gist Mar 31, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@
    #### 31 Mar 2022
    - re: Obsidian scheduled backups - Tried to get `launchd` to work via `plist` at `~/Library/LaunchAgents/com.gilite-notes.notes.plist`, but it didn't have enough permissions to access the Node files at `/usr/local/bin/node`.
    - Originally preferred `launchd` over `cron` since it allows the job to run right after the computer wakes from sleeping, if the job was supposed to run but the computer was in sleep mode.
    - Also attempted moving the plist to `~/Library/LaunchDaemons/` so that the job can be executed even if I'm logged out, but the same error as above occurred.
    - `cron` worked after a few tries, incl. setting the git config to replace `https://github.com/` with `[email protected]:` since one of the errors specified `fatal: could not read Username for 'https://github.com': No such file or directory`. (see [this](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo))
    - To get over the same error with `launchd`, grant cron 'Full Disk Access' at Security & Privacy in macOS.
    - The cronjob can be edited via `crontab -e`, while list of cronjobs can be outputed via `crontab -l`. Cronjob outputs can be viewed with `mail`.
  4. regexyl revised this gist Mar 31, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    - Originally preferred `launchd` over `cron` since it allows the job to run right after the computer wakes from sleeping, if the job was supposed to run but the computer was in sleep mode.
    - `cron` worked after a few tries, incl. setting the git config to replace `https://github.com/` with `[email protected]:` since one of the errors specified `fatal: could not read Username for 'https://github.com': No such file or directory`. (see [this](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo))
    - To get over the same error with `launchd`, grant cron 'Full Disk Access' at Security & Privacy in macOS.
    - The cronjob can be edited via `crontab -e`, while list of cronjobs can be outputed via `crontab -l`.
    - The cronjob can be edited via `crontab -e`, while list of cronjobs can be outputed via `crontab -l`. Cronjob outputs can be viewed with `mail`.

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.
  5. regexyl revised this gist Mar 31, 2022. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,17 @@
    # TIL - March 2022

    #### 31 Mar 2022
    -
    - re: Obsidian scheduled backups - Tried to get `launchd` to work via `plist` at `~/Library/LaunchAgents/com.gilite-notes.notes.plist`, but it didn't have enough permissions to access the Node files at `/usr/local/bin/node`.
    - Originally preferred `launchd` over `cron` since it allows the job to run right after the computer wakes from sleeping, if the job was supposed to run but the computer was in sleep mode.
    - `cron` worked after a few tries, incl. setting the git config to replace `https://github.com/` with `[email protected]:` since one of the errors specified `fatal: could not read Username for 'https://github.com': No such file or directory`. (see [this](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo))
    - To get over the same error with `launchd`, grant cron 'Full Disk Access' at Security & Privacy in macOS.
    - The cronjob can be edited via `crontab -e`, while list of cronjobs can be outputed via `crontab -l`.

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.

    #### 29 Mar 2022
    Whoops skipped TIL for this day!
    Whoops skipped TIL for this day

    #### 28 Mar 2022
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [^](https://stackoverflow.com/a/37592669/14007383)
  6. regexyl revised this gist Mar 31, 2022. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    # TIL - March 2022

    #### 31 Mar 2022
    -

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.

  7. regexyl revised this gist Mar 30, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    # TIL - March 2022

    #### 30 Mar 2022
    - There's a collection of OSS on [Code Shelter](https://www.codeshelter.co/) for volunteer devs to adopt projects as maintainers.

    #### 29 Mar 2022
    Whoops skipped TIL for this day!

    #### 28 Mar 2022
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [^](https://stackoverflow.com/a/37592669/14007383)
    - `echo $?` returns the exit status of last command. [^](https://unix.stackexchange.com/questions/501128/what-does-echo-do#comment923415_501135)
  8. regexyl revised this gist Mar 28, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # TIL - March 2022

    #### 28 Mar 2022
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [(ref)](https://stackoverflow.com/a/37592669/14007383)
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [^](https://stackoverflow.com/a/37592669/14007383)
    - `echo $?` returns the exit status of last command. [^](https://unix.stackexchange.com/questions/501128/what-does-echo-do#comment923415_501135)
  9. regexyl revised this gist Mar 28, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # TIL March 2022
    # TIL - March 2022

    #### 28 Mar 2022
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [(ref)](https://stackoverflow.com/a/37592669/14007383)
  10. regexyl created this gist Mar 28, 2022.
    4 changes: 4 additions & 0 deletions TIL-2022-03.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # TIL March 2022

    #### 28 Mar 2022
    - Using `process.exit([number])` is not recommended practice due to the possibility of abrupt exits on executed async fucntions. Use `process.exitCode([number])` instead. [(ref)](https://stackoverflow.com/a/37592669/14007383)