Sunday, September 13, 2020

S3 Permissions to mail-in-a-box backup

 To backup mail-in-a-box to AWS S3 you need:

  1. Have a AWS account
  2. Create a S3 bucket to store the backups (you will need to note the region)
  3. Create a group, e.g. backup-email-group, with the single policy shown bellow
  4. Create a IAM user with programmatic access as a member of the backup-email-group. Note down the Access key and Secret Access Key
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::my-bucket-name"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": "arn:aws:s3:::my-bucket-name/*"
        }
    ]
}
This policy was posted in the mail-in-a-box forums.

Saturday, June 06, 2020

Update Lineage Os in a oneplus 2

The instructions posted here in the Lineage OS web site regarding the update of oneplus do not work for me, I can't get the command adb reboot sideload to work, it simply reboots my phone.
So these are the steps I took to update my phone to the latest version.
    1. Restart phone in recovery mode:
        power + volume down (will also take screenshot, just wait)
     or
        adb reboot recovery
    2. In TRW select Advanced > ADB sideload > slide to start sideloading
    3. Run command
    adb sideload .\lineage-17.1-20200601-nightly-oneplus2-signed.zip
wait...takes some time, you should see progress indicator
    4. In TRW select ADB sideload and run command
adb sideload .\open_gapps-arm64-10.0-nano-20200530.zip
    5.Reboot.. Wait a long time


Visual studio: start mutiple projects

There is a nice tool that allows you to define combination of multiple projects that should be started together when running things from Visual studio, the extension is called SwitchStartupProject and can be found here:

Tuesday, March 17, 2020

Visual studio: Class from XML or json

Visual studio has a nice hidden feature, that it is able to generate classes from XML and JSON data.
To be able to use you need:
  1. Create an empty class file (.cs file)
  2. Copy the JSON/XML to the clipboard
  3. Go to Visual Studio -> Edit -> Paste Special -> Paste as class
and you will be left with a nice class.