Devops: Linux tips - maple-dev-team/docs GitHub Wiki

Deleting or Vacuuming Journals To delete archived journal entries manually, you can use either the –vacuum-size or the –vacuum-time option. In the example below, we are deleting any archived journal files, so the journal size comes back to 200MB.

$ journalctl --vacuum-size=200M

ERROR mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory (allocated 621813760) (tried to allocate 33554440 bytes) in /usr/share/php/Composer/DependencyResolver/RuleSet.php on line 84

SOLUTION To enable the swap you can use for example:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1

CHANGE WELCOME MESSAGE SERVER

sudo nano /etc/motd			

Check Files size

du -hsx -- * | sort -rh | head -10				
```				
				
OWNER				
sudo chmod +x dbackup.sh sudo chown -R www-data:www-data /var/www/html/cvlweb/ sudo chown -R oscar:oscar /var/www/html/cvlapi/
				
Check swapfile				
cd /
```
ls -a

Just follow these steps:

Make all swap off

sudo swapoff -a				

Resize the swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024				

Make swapfile usable

sudo mkswap /swapfile				

Make swapon again

sudo swapon /swapfile				

Clear systemd journals older than X days The first one is time-based, clearing everything older than say 10 days.

$ journalctl --vacuum-time=10d		
find your php.ini find memory_limit see the value
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=3000

Mysql import with error When exporting with workbench - click Advaced Options - set-gtid-keys = OFF

Now the exported file will not have any garbage

⚠️ **GitHub.com Fallback** ⚠️