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();

Getting Local Time based on Timezone in AirTable

If you’re using Airtable as a CRM and working with clients in different timezones. You might want to know what their local time is before actioning something perhaps when they’re awake or asleep 🙂

In your Airtable database, create a column called “Timezone” where you’ll put a supported Timezone for the SET_TIMEZONE function. You can see a list of these timezones at the following link

https://support.airtable.com/docs/supported-timezones-for-set-timezone

You will then create a new “formula” column and use the following formula.

IF( {Timezone} = BLANK() , "" , DATETIME_FORMAT(SET_TIMEZONE(NOW(), {Timezone} ), 'M/D/Y h:mm A'))

The above code will check if the Timezone field is blank or not, if it’s not blank it will take the current time NOW() and set the Timezone to {Timezone} column and then see the DATETIME_FORMAT.

You should then see the following in Airtable.

Synology Redirect Nginx HTTP to https + Allow Letsencrypt

You can follow this article pretty much all the way.

https://techjogging.com/redirect-www-to-https-in-synology-nas-nginx.html

However, it will fail if you use Letsencrypt to generate an SSL Certificate. So you simply need to add the following above the redirect line. Here’s how it should look.

server {
    listen 80 default_server{{#reuseport}} reuseport{{/reuseport}};
    listen [::]:80 default_server{{#reuseport}} reuseport{{/reuseport}};

    gzip on;
    
    location /.well-known/acme-challenge/ {
    # put your configuration here, if needed
    }

    server_name _;
    return 301 https://$host$request_uri;
}

Of course after you make this change you will need to restart Nginx

synoservicecfg --restart nginx

You can add as many locations as you like; once they’re matched, the request will not continue to the redirect at the end of the server {} container.

This was highlighted in the following Stack Overflow post.

https://serverfault.com/questions/874090/nginx-redirect-everything-except-letsencrypt-to-https

Dell OSMA on Proxmox/Debian Buster

I found a Reddit post that I wanted to make sure I kept in case it gets deleted and lost forever.

My Issue

I have some Dell servers that I wanted to enable iDRAC on remotely via a secondary network interface. Unfortunately, I didn’t have physical access. So I needed to use OSMA to enable iDRAC and configure the necessary network details.

Proxmox and Dell OSMA

If you have a Dell server and you want to be able to use the OSMA (Dell EMC OpenManage Server Administrator) on your Proxmox server. Here’s a quick guide that someone posted on Reddit and on the Proxmox forums.

WARNING

The code below on the Proxmox forums works, but the Reddit code doesn’t.

Since the code is half-baked on both. I’ve maintained my own version.

https://forum.proxmox.com/threads/dell-openmanage-on-proxmox-6-x.57932/