Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin kevinski303

View GitHub Profile
View mediawiki_migrationscript.sh
#!/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "Diese Script muss als root ausgeführt werden" 1>&2
exit 1
fi
DATUM=`date +%Y%m%d`
before=`date +%Y%m%d -d "yesterday"`
@kevinski303
kevinski303 / replace_i18n_strings_smw.sh
Created May 5, 2020
replace some strings in smw i18n json files
View replace_i18n_strings_smw.sh
for f in ./*.json; do
echo "file $f"
cat "$f" | grep smw_decseparator
cat "$f" | grep smw_kiloseparator
sed -i '/smw_decseparator/c\"smw_decseparator": ".",' "$f"
sed -i '/smw_kiloseparator/c\"smw_kiloseparator": "",' "$f"
cat "$f" | grep smw_decseparator
cat "$f" | grep smw_kiloseparator
echo "-----------"
done
@kevinski303
kevinski303 / createfoldermovefile.sh
Created Feb 24, 2020
batchprocessing, moving multiple files into a subfolder from its filename (needed this to handle over 200 files)
View createfoldermovefile.sh
for f in *.pdf;
do
echo "filename: $f";
folder="$(echo $f | cut -f1 -d '.')";
echo "creating folder $folder";
mkdir $folder;
echo "moving file $f to folder $folder"
mv $f $folder;
done
View make-mcrypt.sh
#!/bin/bash -e
echo extracting the mcrypt archive
if ls | grep mcrypt-1.0.2.tgz &> /dev/null; then
tar -zxvf ./mcrypt-*.tgz &> /dev/null && cd mcrypt-*/
else
echo archive is missing
fi
if command -v phpize; then
echo compiling mcrypt module with phpize
phpize &> /dev/null
@kevinski303
kevinski303 / mcrypt_on_php7.3_.txt
Last active Mar 3, 2021
php-mcrypt on debian 10 & php 7.3 apache
View mcrypt_on_php7.3_.txt
#
# The php-mcrypt extension is depricated and therefore was removed from the apt repository.
# As of writing this, on php7.3 there is currently no other way to install mcrypt without downgrading the php version
# except for compiling it locally.
#
###
#
# 1; Install the php-dev version and all the used tools to compile the extension