But actually if you look on the wayback machine, this site has existed since 2010
I should go scrape the old articles and re-add them, not like it would be hard. Why? For street cred and getting to claim this blog is 14 years old instead of 10!
This is related to Tmux workspace-in-a-box in my general effort to be productive with a bunch of linux terminals open at once
Preamble bitching nonsense
When things are all the same color, I work slower, if I get any work done at all. I noticed this in college taking a course in structural design. It was the kind of class that took up a three ring binder. Of course it wasn’t all notes, it had at least a hundred pages of the American Institute of Steel Construction. In that monster of a notebook I could not find a goddamn thing! That is, until I got a bunch of different colored pens, highlighters, flags, etc.
Same thing with computers, I stare at a bunch of black terminals and its just all runs together I can’t do shit. In fact, it even seems like every game now has the same stupid fucking flat black and white menus. Certainly true for Halo Infinite, MechWarrior 5, and HBS Battletech.
Identify which is which, I dare you.
Terminator
No, not ahhhhnold. Not even grizled, gray haired ahhhhnold. I can’t say terminator is the best gui terminal emulator, but I use it because I can easily make it different colors. It also has a nice human readable config file, as god intended. You don’t have to edit it by hand, but for some reason the gui is slow when I edit the colors and I don’t care to find out why.
I try to use the same color terminal for the same remote host when I am working on a bunch of them at the same time. Here are some examples:
WWW
There is not much for the blue - www profile the config file ~/.config/terminator/config really just the background color.
Despite my proclivities for dark computer screens, I need more color choices so here is a light blue one. I had to change the color palette since the color schemes that come with terminator don’t work on light backgrounds. It is by no means complete, maybe I will actually come back and update this later accordingly.
The idea here is when I work on a system, I want to open tmux and have it automatically open all the windows I always open. This will save me manually doing all that, and give me consistency of what window is where so I can build muscle memory and quit flapping around looking for the right window.
For reasons beyond my comprehension, instead of just issuing the usual tmux, you actually need to tmux attach. I guess that is a good thing regardless, as if the main tmux session is already open I would just want to reconnect.
Anyway, here are some tmux.conf examples:
WWW
Here is an apache web server, called www.
mr@www:~$ cat .tmux.conf
new -s www -c /etc/apache2 #create new session for www
rename-window /etc/apache2/ #rename first window
new-window -c /var/log/apache2/ #make a second window
rename-window /var/log/apache2/ #rename second window
new-window -c /var/www/rushworx.net/
rename-window rushworx.net
mr@www:~$ tmux attach
Nextcloud
A nextcloud server
mr@nextcloud:~$ cat .tmux.conf
new -s nextcloud -c /home/nextcloud_data #create new session for nextcloud
rename-window /home/nextcloud_data/ #rename first window
new-window -c /var/log/ #make a second window
rename-window /var/log/ #rename second window
new-window -c /home/mr/
rename-window /home/mr/
Move, move, he said. And I did. I moved exactly onto into the plasma grenades he was warning me about. And this fucking guy managed to boost his ass off the sinking ship even!
For some reason the defaults in php will remain tiny forever and ever, amen. So you always gotta do this if you want to upload a pic or clip larger than the default upload_max_filesize of 2MB:
Mitigating attacks within the web server itself appears tidy and convenient but there are limits to what can be accomplished without incurring excessive load in the process. Let’s set up mod_evasive for that purpose however it can also be integrated with firewalls and routers.
This is the default config per the github but I think it might be older than dirt so expect to change it! Also I am definitely not sending email. DOSSystemCommand is how you are going to integrate with external edge devices to block there rather than on the web server itself. I am putting my log in the debian apache dir. You could use that to hit an API at your web host to add IPs to their anti DDoS system. Or, probably could use it to hit CloudFlare’s API or similar external service.
I should have done this a long time ago. Swapping between speakers and headset in windows sucks ass. Somebody solved that problem with a thing called SoundSwitch that lives in your system tray and lets you do it with a press of a button or even a goddamn hot key. Sick.
There is much on this topic, this is just one solution.
W3 Total Cache is a well known performance plugin for WordPress, and it can use memcached.
memcached should already be listening on loopback, not on a public ip!, on a tcp socket:
root@www:~# netstat -lnp --tcp |head -3
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 681/memcached
Going to need the php extension to connect to the memcached server:
apt install php8.2-memcached
After which, the main things in W3TC we are looking for are object cache (php), page cache, and database cache and all three are working so we are all set.
Apache by default comes with an old crusty style of doing things which includes MPM prefork and mod_php. I am going to instead use the threaded event multi-processing module.
apachectl -M | grep 'mpm'
root@www:~# apachectl -M | grep 'mpm'
mpm_prefork_module (shared)
root@www:~# a2query -m |grep php
php8.2 (enabled by maintainer script)
a2dismod php8.2
a2dismod mpm_prefork
a2enmod mpm_event
apt install php-fpm
Creating config file /etc/php/8.2/fpm/php.ini with new version
NOTICE: Not enabling PHP 8.2 FPM by default.
NOTICE: To enable PHP 8.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Created symlink /etc/systemd/system/multi-user.target.wants/php8.2-fpm.service → /lib/systemd/system/php8.2-fpm.service.
Setting up php-fpm (2:8.2+93) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for php8.2-fpm (8.2.20-1~deb12u1) ...
NOTICE: Not enabling PHP 8.2 FPM by default.
NOTICE: To enable PHP 8.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
apt install libapache2-mod-fcgid
Uses unix socket.
a2enconf php8.2-fpm
a2enmod proxy
a2enmod proxy_fcgi
apachectl configtest
Syntax OK
systemctl restart apache2
apachectl -M | grep 'mpm'
mpm_event_module (shared)