Archiving Facebook Messages and Facebook Marketplace Messages

Too many Facebook Messages

I had a ton of Facebook Marketplace messages that I was annoyed with and wanted archived. So I found many resources online on using the Chrome console to run javascript to archive the messages.

Javascript Gist and More

I found a gist with the needed code, but it didn’t work. Upon reading the comments, there was updated code buried and another Github repository.

Archive all of the messages in your Facebook Messages Inbox · GitHub
Archive all of the messages in your Facebook Messages Inbox – archive-all-facebook-messages.js
gist.github.com

My modified code

I took the original code and modified it with ChatGTP. I had it limit the number of times the script would run, essentially, how many messages it would archive. I also added a delay, to make sure I didn’t get blocked by Facebook.

let executionCount = 0;

function run() {
  if (executionCount >= 100) {
    return;
  }
  
  let all = document.querySelectorAll('div[aria-label="Menu"]');
  if (all.length == 0) return;
  
  let a = all[1];
  a.click();
  
  let menuitems = document.querySelectorAll('div[role=menuitem]');
  let archiveChatRegex = /Archive chat/;
  
  for (let i = 0; i < menuitems.length; i++) {
    if (archiveChatRegex.test(menuitems[i].innerText)) {
      menuitems[i].click();
    }
  }
  
  executionCount++;
  setTimeout(run, 200); // Delay of 1 second (1000 milliseconds)
}

run();

Importing Large .ics file into Gmail or Google Workspace Calendar

Importing a large Gmail or Google Workspace calendar that, when exported as a .ics file and larger than 1MB, will fail. This is due to the Gmail interface’s 1MB limit on processing .ics files.

The solution is to split up the .ics file, which you can do manually or using the following python script.

GitHub – druths/icssplitter: A script to split up big ics files
A script to split up big ics files. Contribute to druths/icssplitter development by creating an account on GitHub.
github.com

Using Cloudinit and Netplan with IP’s on a different Network and Gateway

If you’ve ever had to utilize a hosting provider that offers the option to buy extra IPs or failover IP addresses, you may have observed instances where these IPs shared the same gateway as your original IPs, rather than being part of the additional IP network.

Here are some of the providers I’m aware of that require this.

  • OVH
  • SoYouStart

The problem is when you use Cloudinit to deploy your VM’s on Ubuntu which uses netplan and unfortunately, there isn’t a method to configure netplan through Cloudinit to use a gateway that isn’t on the same network as the IP address.

I’m using Proxmox, and although you can create a custom network configuration for netplan.yml and deploy it as a snippet via Cloudinit. This isn’t ideal.

Canonical looks to have fixed the bug this year (2023) in January https://github.com/canonical/cloud-init/pull/1931

However, that most likely relates to the new Ubuntu LTS. I’ve tested this within Ubuntu 20.04, and the appropriate config is in place. Here’s the generated /etc/netplan/50-cloud-init.yaml

root@srv01:~# cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - 147.135.0.0/24
            match:
                macaddress: 02:00:00:79:e4:73
            nameservers:
                addresses:
                - 213.186.33.99
                search:
                - domain.com
            routes:
            -   on-link: true
                to: default
                via: 15.0.0.254
            set-name: eth0
        eth1:
            dhcp4: true
            match:
                macaddress: 8a:ca:d3:4d:c9:28
            set-name: eth1
    Reddit – Dive into anything
    www.reddit.com
    BUG: No routing in VM with cloud init (ubuntu 18.x – 19.4) | Proxmox Support Forum
    It´s possible a bug in the network setting from proxmox to VMs with cloud-init and ubuntu. I have see many forum entries about the same problemas! The big…
    forum.proxmox.com

    https://linuxconfig.org/how-to-add-static-route-with-netplan-on-ubuntu-22-04-jammy-jellyfish-linux

    Using Monit Environment Variables with exec

    If you read the Monit documentation, it tells you exactly how to use Monit environment variables when using exec.

    No environment variables are used by Monit. However, when Monit executes a start/stop/restart program or an exec action, it will set several environment variables which can be utilised by the executable to get information about the event, which triggered the action.

    https://mmonit.com/monit/documentation/monit.html#ENVIRONMENT

    I can be smart, but sometimes I can be daft. You don’t want to use the variables within your monit configuration, but instead, you want to use these variables in your exec script.

    Here’s a great example of how to use $MONIT_EVENT. First set up a monit check

    check system $HOST-steal
        if cpu (steal) > 0.1% for 1 cycles
            then exec "script.sh"
            AND repeat every 10 cycles
    

    Now here’s script.sh which will use $MONIT_EVENT

    #!/bin/bash
    echo "Monit Event: $MONIT_EVENT" | mail -s "$MONIT_EVENT" [email protected]

    I was in a rush and felt I had to post this to help others who might overlook this.

    Large Mail Folder and imapsync Error “NO Server Unavailable. 15”

    I was having issues migration the “Sent Items” folder on a hosted Exchange 2013 account to Microsoft 365. The hosted Exchange 2013 server was returning a “NO Server Unavailable. 15” error when trying to select the “Sent Items” folder with 33,000 messages.

    Digging further, I couldn’t find anything until I stumbled upon this thread on the Microsoft forums.

    https://social.technet.microsoft.com/Forums/azure/en-US/2508f50f-6b28-4961-8e6c-5425914d4caa/no-server-unavailable-15-on-exchange-2013?forum=exchangesvrclients&forum=exchangesvrclients

    I’ve come across this issue twice with 2 different exchange 2013 farms while setting up IMAP to use IMAPSync to migrate mail. The issue only happened when accessing 1 folder with lots of mail messages. A simple test is to use OpenSSL to verify the issue like:

    openssl s_client -quiet -crlf -connect mail.domain.com:993
    A01 login domain/user password
    A02 LIST “” *
    A03 SELECT “problem folder”

    IMAP will return: A03 NO Server Unavailable. 15

    After change lots of IMAP settings, the resolution is to enable IMAP protocol logging. It was previously (by default) disabled and this issue would happen. We disabled it again and the problem returned for the same mailbox. Re-enabled logging en voila works.

    Set-ImapSettings -Server <server-name> -ProtocolLogEnabled $true

    Hope this helps someone!

    WHMCS Lightbox Loading Image in Footer (Cloudflare Issue)

    You might have seen a loading image in the footer of your WHMCS admin page. If you inspect the page, you’ll see it’s got some tags for the lightbox.

    The issue is related to Cloudflare Rocket Loader, you can simply create a page rule to disable Rocket Loader on the admin pages or disable Rocket Loader altogether.

    Source: https://whmcs.community/topic/309599-loading-spinner-admin-area/

    Disable Rocket Loader with Cloudflare Page Rule

    If you wish to disable Rocket Loader for a specific URL then you can use Cloudflare Page Rules using the following configuration.

    MySQL, Percona, MariaDB Error: Out of sort memory, consider increasing server sort buffer size!

    There is a bug in MySQL 8.0.18, and above https://bugs.mysql.com/bug.php?id=103225 it was patched in 8.0.28 https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-28.html

    It looks as though Percona released version 8.0.28, which includes all features and bug fixes in MySQL. However, if you only do security updates, it’s possible you might have an older version of Percona based on your server’s deployment date. You can run MySQL --version via SSH to confirm.

    If you’re not on 8.0.28, then you can run apt-get update and then apt-get upgrade. However, this will upgrade all packages on the system. So instead, you might just want to update Percona by running apt-get install --only-upgrade percona-server-common.

    If you’re worried about what apt-get upgrade will do, you can run it in safe mode and see what packages will be upgraded and their version; simply type apt-get -V -s upgrade.

    As for MariaDB, this was patched in 10.5.7 https://jira.mariadb.org/browse/MDEV-24015 same process applies as above.

    SynoCommunity “Invalid location” error

    When trying to install the SynoCommunity to your Synology’s package manager, you might get the “Invalid location” error, as shown in the screenshot below.

    Excuse the location, this was from Google Images as I didn’t take a screenshot when the issue was occurring.

    You can find the cause of this issue on the SynoCommunity Github, under the following issue.

    https://github.com/SynoCommunity/spksrc/issues/4897

    The root cause as explained by the creator of SynoCommunity

    So yes after some testing on my end I can confirm that the trust certificates on a not fully updated DSM 6 are too old (a certificate must have expired recently). If you want to continue to stay on an old versions (not recommended obviously) you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers), using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem This will fix the issue, alternatively you can set the clock back. The best solution however is to update to a more recent DSM6 version.

    So if you’re running DSM6, update to the latest available version or DSM7 if supported. Otherwise, the following command will resolve the issue.

    sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem

    Synology Mail Server Fix “Enable User Name Service” Mirrored Content

    If you’ve ever installed Synology Mail Server, you might have had the “Enable User Home Server” error pop-up. Even after enabling this setting and restarting, the error still comes up.

    I’m mirroring this page just incase https://community.synology.com/enu/forum/1/post/144970

    How to fix “Enable User Home Service” or “The operation failed” if you try to disable User Home Service. Applies to Moments and other packages that rely on User Home Service

    Ppbarney @pbarneyJul 08, 20210 Replies 298 Views 1 Likes Toggle Dropdown

    Apparently, when you enable the user home service on the Synology NAS, it incorrectly places the homes directory in /var/services/homes even though it’s supposed to be in /volume1/homes (with a symlink to it in /var/services/homes).

    This creates a number of problems, including potential loss of user data on upgrades, but it also causes many other packages that depend on the user home service to fail.

    The solution to this apparently very common problem can be found on Gabriel Viso Carrera’s web page at https://gvisoc.com/tech/linux/2021/02/06/Fixing-User-Homes-Error-Synology-NAS.html

    The fix on that page solved the problem completely.

    Here is the basic fix:

    1. SSH into your NAS (you can set up SSH at Control Panel → Terminal & SNMP → Terminal tab → Enable SSH service)
    2. go to the services folder: cd /var/services
    3. create an archive of existing user files (if necessary): tar cfz /volume1/homes/homes-backup.tgz homes
    4. remove the homes folder: sudo rm -rf homes
    5. Create a symbolic link to /volume1/homes: sudo ln -s /volume1/homes homes

    At this point, you can untar your user files archive if necessary into /volume1/homes.

    After this, Moments will work. This also applies to other packages that rely on the User Home Service.

    Note: his page with the solution is also added to the Internet Archive at https://web.archive.org/web/20210206053959/https://gvisoc.com/tech/linux/2021/02/06/Fixing-User-Homes-Error-Synology-NAS.html in case his website ever disappears.

    MSP360 (Cloudberry) Backup SSL Certificate Expired when using Backblaze B2 Storage

    If you’ve been using the MSP360 backup client on older CentOS hosts, you might have run into this error.

    HTML

    Upon further investigation, the agent error log /opt/local/Online Backup/<INSERTUUIDHERE>/logs/log_worker_<ANOTHERUUID>}.log show the following errors.

    HTML

    The issue was being on the client version Linux (rpm) v. 3.2.0.114 of which this MSP360 community support thread speaks about upgrading to the latest version of the client.

    https://forum.msp360.com/discussion/2429/certificate-renewal-errors-for-backblaze-b2

    To do so, you need to click on “Downloads” from your MSP360 admin dashboard and request the update of the default build. The new build ended up being 3.2.3.156

    Once done, you can then update your clients under RMM->Remote Management, then click the settings icon to the far right and then click “Force Update”.