Skip to content

Instantly share code, notes, and snippets.

View redpop's full-sized avatar

Martin Alker redpop

  • punkt.de GmbH
  • Karlsruhe
  • 01:07 (UTC +02:00)
View GitHub Profile
#!/bin/bash
# Usage display function
function usage {
echo "Usage: $0 sourcedir [-o outputfile] [-e excludedirs] [-x excludeexts]"
echo " sourcedir Source directory to be processed"
echo " -o outputfile Optional output file name (default: output.txt)"
echo " -e excludedirs Optional comma-separated list of directories to exclude"
echo " -x excludeexts Optional comma-separated list of file extensions to exclude"
exit 1
@redpop
redpop / internet_test.sh
Last active August 16, 2023 19:09
Ping Google every 60 seconds
#!/bin/bash
GREEN='\033[1;32m'
RED='\033[1;31m'
NC='\033[0m' # No Color
while true; do
if ping -c 1 google.com &> /dev/null; then
echo -e "${GREEN}$(date): Internet connection is up${NC}"
else
colima start --cpu=3 --disk=64 --memory=6 --dns=1.1.1.1
@redpop
redpop / typo3_cache_flush.sh
Created February 17, 2022 10:58
TYPO3 Console needed!
php ./vendor/bin/typo3cms cache:flush
@redpop
redpop / docker_compose.sh
Created December 4, 2021 17:23
Docker compose snippets
# Docker Compose reuses anonymous volumes created by the previous containers for the new containers. This way the new cache container can reuse the cache from the old container. To force Docker Compose to renew anonymous volumes for the new containers, we use:
docker compose up --build --force-recreate -V
# -----------------------------------------------------------------------------
# Deploying changes
# When you make changes to your app code, remember to rebuild your image and recreate your app’s containers. To redeploy a service called web, use:
docker-compose build web
docker-compose up --no-deps -d web
* {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
git ls-tree --full-tree -r --name-only HEAD
php -d memory_limit=-1 bin/console cache:clear
COMPOSER_MEMORY_LIMIT=-1 composer upgrade
# https://joostvanveen.com/run-composer-1-and-2-simultaniously
brew cleanup
brew link --overwrite composer
ln -s /usr/local/bin/composer /usr/local/bin/composer2