This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22
First install Rosetta if not already done, this is needed to run x86 code:
# using mongodump | |
mkdir swateek | |
mongodump --db="stats" --out="./swateek" --gzip | |
cd swateek | |
tar cvzf ../db_backup.tar.gz * | |
# using mongorestore | |
tar -xvzf db_backup.tar.gz | |
mongorestore --gzip --db="stats" --noIndexRestore stats/ |
#!/bin/bash | |
# Print an introduction line in cyan | |
printf "\033[0;36mPre-commit hook - For Checking Tabs in Golang Files...\033[0m \n" | |
# Grab feed of staged files | |
files=$(git diff --name-only --cached -- "*.go") | |
numfiles=$( printf '%s' "$files" | grep -c '^' ) | |
if [ $numfiles -eq 0 ] |
-- https://www.digitalocean.com/community/tutorials/working-with-json-in-mysql | |
-- select rows where isPrivate field is "" | |
SELECT * FROM ecom_categories WHERE JSON_EXTRACT(`attributes` , '$.isPrivate') = ""; | |
-- select rows where isPrivate field is not a part of JSON object | |
SELECT * FROM ecom_categories WHERE JSON_EXTRACT(`attributes` , '$.isPrivate') IS NULL; | |
-- add isPrivate field to attributes which are not present | |
UPDATE ecom_categories SET `attributes` = JSON_INSERT(`attributes`, '$.isPrivate', false); |
// pm.globals.clear(); // Be careful with this usage | |
// Save common tests in a global variable | |
postman.setGlobalVariable("commonTests", () => { | |
pm.test("Common Tests - Response Time", function(){ | |
pm.expect(pm.response.responseTime).is.lessThan(500); | |
}); | |
pm.test("Common Tests - Content Type", function(){ | |
pm.expect(pm.response.headers.get('Content-Type')).equals('application/json'); |
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22
First install Rosetta if not already done, this is needed to run x86 code:
If you'r using MAC Intel CPU you want to use VMware to virtual your desired OS such Windows or Ubuntu on the MAC OS you need to download VMware Fusion Player first then it has two version Pro and Player, the Player version is free for personal use but you need to create VM account to download and licence key. | |
You can create account to download yourself here: | |
https://customerconnect.vmware.com/group/vmware/evalcenter?p=fusion-player-personal | |
If you don't want to create account to get license, you can try below original license key for VMware Fusion Player: | |
COMPONENT: | |
VMware Fusion Player – Personal Use |
@echo off | |
echo %DATE% %TIME%>C:\Users\Swateek\Downloads\tmp\abc_%RANDOM%.txt |
-- Delete a key from JSON Object | |
-- INPUT: {"somekey":"somevalue", "meta": {"ui": false, "miscTest": {"unit": "kWh", "value": 10}}} | |
UPDATE myTable | |
SET meta=JSON_DELETE_KEY(meta, 'miscTest') | |
WHERE id="85c8a446-fe24-11ed-8abf-af2f19c7e27f"; | |
-- RESULT: {"somekey":"somevalue", "meta": {"ui": false}} | |
-- Update a key in JSON Object | |
-- INPUT: {"somekey":"somevalue", "meta": {"ui": false}} |
#!/bin/bash | |
current_time=$(date "+%Y_%m_%dT%H_%M_%S") | |
rm -rf .my_job 2> /dev/null | |
mkdir -p .my_job | |
mkdir -p .my_job/{100,101,102,103,104,105,106,107,108,109,110} | |
ls -d .my_job/* | xargs -I {} bash -c "cd '{}' && touch sample_$random_$current_time.txt" | |
curl -s -X GET https://filesamples.com/samples/document/csv/sample4.csv -o .my_job/sample_$current_time.csv | |
curl -s -X GET https://filesamples.com/samples/document/pdf/sample2.pdf -o .my_job/sample_$current_time.pdf | |
curl -s -X GET https://filesamples.com/samples/document/xls/sample3.xls -o .my_job/sample_$current_time.xls |
echo '{"key1":"value1", "key2": "value2", "key3": "value3"}'\
| jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]'
echo '{"key1":"value1", "key2": "value2", "key3": "value3"}'\
| jq -r 'to_entries[] | "\(.key)=\(.value | tostring)"'