I changed password managers from LastPass to BitWarden the other day. Migrating your credentials requires exporting and importing a CSV file from one program to another. It was an easy transition. Everything seems to work. As you may be aware, LastPass decided to make their free account limited to just one device. Customers will need to choose which device to use, whether desktop or mobile. Not both. If you want it on multiple devices, you’ll need to fork up $3 per month. It is not that expensive, but there are other alternatives. A few recommend BitWarden. It will let you sync to all devices for free. It was an easy choice.
Misc
AWS Backup Setup
This script creates an AWS backup vault, adds a backup plan and a backup selection.
Set up profile, region and Account ID first.
#!/bin/bash profile="default" region="us-east-1" id=$(aws sts get-caller-identity --query Account --output text) |
Create a vault.
aws backup create-backup-vault \ --backup-vault-name my-vault \ --profile $profile \ --region $region |
Create a backup plan.
aws backup create-backup-plan \ --backup-plan file://back-plan.json \ --profile $profile \ --region $region |
backup-plan.json
{ "BackupPlan": { "BackupPlanName": "efs-0000", "Rules": [ { "RuleName": "efs-0000", "TargetBackupVaultName": "my-vault", "ScheduleExpression": "cron(0 0 ? * * *)", "StartWindowMinutes": 60, "CompletionWindowMinutes": 10080, "Lifecycle": { "DeleteAfterDays": 7 } } ] } } |
Get the backup plan ID.
planid=$(aws backup list-backup-plans \ --query "BackupPlansList[?BackupPlanName=='efs-0000'].BackupPlanId" \ --profile $profile \ --region $region \ --output text) |
Create a backup selection.
# Create a backup selection aws backup create-backup-selection \ --backup-plan-id $planid \ --cli-input-json file://backup-selection.json \ --profile $profile \ --region $region |
backup-selection.json
{ "BackupSelection": { "SelectionName": "efs-0000", "IamRoleArn": "arn:aws:iam::xxxxxxxxxxxx:role/service-role/AWSBackupDefaultServiceRole", "Resources": [], "ListOfTags": [ { "ConditionType": "STRINGEQUALS", "ConditionKey": "aws-backup", "ConditionValue": "efs-0000" } ] } } |
The enable EFS backup, add a tag key of aws-backup with a value of efs-0000.
Install OpenJDK 8
Here’s the installation instructions for OpenJDK 8.
For Fedora, Redhat and Oracle Linux.
yum install java-1.8.0-openjdk |
For Debian and Ubuntu.
apt-get install openjdk-8-jre |
To see if the packages (symbolic links) are there, they can be found in /etc/alternatives/, at least in Redhat 7.
ls -l /etc/alternatives/ |
MySQL Select Like
Here’s how to perform SQL searches using the like operator.
# Format SELECT column1, column2 FROM table_name WHERE column LIKE pattern; # Search for an entry starting with a 'joe.' SELECT id,username,address FROM users WHERE username LIKE 'joe%'; # Search for an entry ending with a 'joe.' SELECT id,username,address FROM users WHERE username LIKE '%joe'; # Search for any entry with 'joe' from any position. SELECT id,username,address FROM users WHERE username LIKE '%joe%'; # Finally, using "_" as wildcards. Find any field with "j" in the second position. SELECT id,username,address FROM users WHERE username LIKE '_j'; |
Logitech K811 Page Up and Down
I’ve been using this keyboard for a few years, but never knew how to use page and page down. It’s …
fn + up arrow = page up fn + down arrow = page down |
Splunk Search for Tanium Clients
Here’s the Splunk search for Tanium clients reporting to the Tanium server.
"data.jsonPayload.rule_details.direction"=EGRESS "data.jsonPayload.connection.src_ip"="10.0.0.1" "data.jsonPayload.connection.dest_port"=17472 |
FFMPEG Convert TS to MP4
If you have video files that are formatted in MPEG-2, video files with a .m2ts extension, you can convert them to MP4 using ffmpeg.
ffmpeg -i input.ts -c:v libx264 -c:a aac output.mp4 |
The video is encoded using open format H.264, while audio is encoded using AAC.
Mac OS Catalina
I’ve updated my system to the latest Mac OS 10.15.1 codenamed Catalina. Well, it broke a couple of apps that I use regularly, Audacity and OBS. There are currently no updates from Audacity. However, OBS has a workaround in terms of a test build. You have to download it, and set the system preferences to allow the Mac OS to access the cameras (webcam) and audio devices (microphones). There are no official releases yet from neither Audacity and OBS projects. Maybe in a couple of months.