Tuesday, June 12, 2018

How can I find broken symlinks


find . -type l ! -exec test -e {} \; -print

Find and delete files recursively in unix

recursively list files by extension
find ./ -type f | awk -F . '{print $NF}' | sort --unique
recursively list files by specific extension
find . -type f -iname "*.css" 

recursively delete them
find . -name "*.html" -type f -delete

Monday, June 11, 2018

Docker wordpress

mkdir wordpress
cd wordpress

touch docker-compose.yml
vi docker-compose.yml

version: '3.3'

services:
   db:
     image: mysql:5.7
     ports:
       - "3306:3306"
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
volumes:
    db_data:



docker image prune --all
docker-compose restart
docker-compose build
docker-compose stop
docker-compose start
docker-compose up


sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 3306
sudo service ufw restart
sudo ufw status


Friday, May 18, 2018

Ubuntu open ports

Impossible to disable this...
sudo netstat -plunt

udp 3840 0 0.0.0.0:5353 0.0.0.0:* 24467/ --disk-cache

udp6    2304      0 :::5353                 :::*                                24467/ --disk-cache


chrome://flags/#device-discovery-notifications

chrome --disable-device-discovery-notifications

systemd-timesyncd

sudo apt update && sudo apt install systemd-timesyncd && sudo systemctl enable --now systemd-timesyncd