Skip to content

Instantly share code, notes, and snippets.

@fluidum
fluidum / strapi_foodadvisor_seed_import.md
Last active May 18, 2023 13:57
strapi migration examples to empty instance

Creating new instance

npx create-strapi-app@latest strapi-import --quickstart

Copying src/, script/, package.json and data.zip from https://github.com/strapi/foodadvisor

cp -r foodadvisor/api/src/ strapi-import/
cd strapi-import/
cp ../foodadvisor/api/package.json .
# Set a PDF password as variable because it might contain special symbols and it will break shell if not quoted
PDF_PASSWORD='<space_holder>'
# qpdf utility will help removing encryption. https://qpdf.readthedocs.io/
qpdf --decrypt --password="$PDF_PASSWORD" encrypted.pdf unencrypted.pdf
# Watermark can be removed PDF is not encrypted.
# One type of watermarks in PDF-s are detected by lines that contain string BaseEncoding and what we will remove below.
sed -i '/BaseEncoding/d' unencrypted.pdf
@fluidum
fluidum / gist:d8d63457d96b78ae46c117fb49ba8f0d
Created February 20, 2021 18:33
remove duplicate files in the same folder
sha256sum * | sort -k1 | uniq -w 32 -d | cut -d' ' -f3 | xargs -I{} sh -c 'rm {}'
!/bin/bash
to="something@somegmail.com"
function status_check() {
if [ $? -ne 0 ]; then
echo "$1 failed" | mutt -s "ERROR: $PWD/$0" $to
echo ":("
fi
}
# list.txt contains Google Chrome extension id per line
for line in $(cat chrome_extensions.txt | sed '/^$/d' | tr -s " ")
do
cnt=`curl -s -I https://chrome.google.com/webstore/detail/${line} | grep 'HTTP/2 301' | wc -l`
if [ "$cnt" -ne 1 ]; then
out+="https://chrome.google.com/webstore/detail/${line}
"
fi
done
@fluidum
fluidum / install-casperjs-and-phantomjs-on-ubuntu.md
Created December 24, 2017 16:42 — forked from mrroot5/tutorial-casperjs.md
Simple tutorial for installing casperjs on ubuntu

Install PhantomJS

Oficial installation documentation.

Prerequisites: PhantomJS dependencies

sudo apt-get install fontconfig

Installation

cd /usr/local/share
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2