- mysql> create database wordpresswebsitestaging;
CREATE USER "stagingwpuser"@"localhost" IDENTIFIED BY "ThePasswordH3r3";
GRANT ALL PRIVILEGES ON wordpresswebsitestaging.* TO "stagingwpuser"@"localhost";
FLUSH PRIVILEGES;
https://developer.wordpress.org/advanced-administration/before-install/creating-database/ - Creating the web root directories and a user who can sftp in to upload files etc if needed
sudo adduser thewpwebsiteadmin
sudo su thewpwebsiteadmin
cd /home/thewpwebsiteadmin
mkdir directory1
mkdir directory2
We need to give read permissions to the entire path for the webserver to be able to read these directories, so
sudo chmod -R +rx /home/thewpwebsiteadmin - Created DNS entries in cloudflare. In this case, CNAME records.
- Copied existing files in /etc/apache2/sites-available as templates for the new sites. Since we were using cloudflare origin certificates, there was no need to create new certificates with certbot etc. After editing the conf files as needed, with the /home/thewpwebsiteadmin/directory1 and directory2 as home directories, enabled the sites with
sudo a2ensite newsite1 newsite1ssl newsite2 newsite2ssl
sudo systemctl reload apache2 - Path to latest wordpress from https://developer.wordpress.org/advanced-administration/before-install/howto-install/ -
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cp -R wordpress/* directory1 etc - Visit the new sites with a browser to supply the database configuration etc, the wp-config file gets generated, create a new file and paste the generated file to the wordpress root directories as
nano wp-config.php - Create ssh key and add to authorized_keys -
ssh-keygen -t rsa -m PEM -f theadminuserkey.pem
mkdir .ssh
mv theadminuserkey.pem.pub .ssh/authorized_keys
and set appropriate permissions for the .ssh directory and file -
chmod 700 .ssh
cd .ssh
chmod 600 authorized_keys
Mostly work related stuff which I would've entered into my "Log book". Instead of hosting it on an intranet site, outsourcing the hosting to blogger!
Thursday, February 20, 2025
adding two wordpress sites to an existing server
Monday, February 17, 2025
cloudflared or ssh tunnel for reverse-proxying on-premise servers
https://developers.cloudflare.com/rules/origin-rules/features/#destination-port
via
https://old.reddit.com/r/CloudFlare/comments/12km27p/using_non_http_https_ports/
dynamic dns with
https://developers.cloudflare.com/dns/manage-dns-records/how-to/managing-dynamic-ip-addresses/#ddclient
https://dnsomatic.com/docs/software
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/
Saturday, February 15, 2025
app api call slowdown, QUIC is suspected
net::ERR_QUIC_PROTOCOL_ERROR
Monday, February 10, 2025
Miscellaneous Blender VSE settings used for the recent project
Shift + K to 'hold-split' at the cursor.
Sunday, February 09, 2025
listing ffmpeg commandline options
-preset lossless
to my commandline, and it worked. I think it was something like
ffmpeg -r 30 -start_number -003875 -f image2 -preset lossless -i "OpenSpace%06d.png" -c:v hevc_nvenc ../filename.mp4
Got the message
The selected preset is deprecated. Use p1 to p7
(but it is doing the encoding.)
There is also -tune lossless option. But I didn't try that.
Thursday, February 06, 2025
simple static multi-lingual titles instead of tracked titles
Instead of going the tracked title route, I settled on a simpler static title overlay using Blender VSE, because
- It's far less time-consuming
- Hindi text does not render well as a Blender text object
So,the workflow was:
- Create the title text in a document editor like Google Docs
- Take a screenshot of the black text on white background
- Invert to white text in black background on Gimp
- Overlay over "warped" video directly with opacity fading in from 0 to 0.5 over a second - OR -
- If overlaying over a fulldome clip, first "warp" the flat text to match the fulldome clip's curvature using the method in this old post.
In particular, after trial and error, the particulars seem to be:
- 36 point font size text to take screenshot
- stretch the text to make it square (halve the width)
- put the stretched screenshot at the bottom of a 4096x4096 transparent image
- make the screenshot even smaller if required, or use a larger transparent image
- merge down the layer if the filter doesn't act on the entire image
- use Gimp's Filter > Distorts > Polar co-ordinates with "Map backwards" checked (otherwise the text would be inverted left to right) and save as png preserving transparency (alpha channel).
Payzapp mini review
I tried using HDFC Bank's Payzapp app for payments - it has features like loading up the Payzapp wallet with credit card, then transfer by UPI to bank accounts, etc. But,
- they doubled the fee for Payzapp wallet loading from credit card
- many merchants, including the most important one which I needed to pay > 10k per month, blocked access to Payzapp payments due to fees they're charging merchants
- a billdesk payment of APSPDCL went through, but did not reflect in the "paid" bills. Billdesk said merchant had rejected payment, I need to pay again. Payzapp says refund has been issued, but there is no way to check except by seeing the balance - which I have now emptied, because the back-and-forth between Payzapp and Billdesk had taken more than a month.
Overall, a very poor experience. So I will use Payzapp only for the convenience of paying HDFC Bank credit cards with it, will block all notifications from it, and not keep any wallet balance. Even when making HDFC bank credit card payment, the app failed to load this morning, and loaded again later in the day. Also, the Payzapp app shows "apply coupons" when making a Rs. 4000 payment, but the coupon says min. transaction Rs. 5000, and the "apply coupon" button is not shown when I was actually making the Rs. 10,000 transaction! Bad HDFC! We can contrast this with Amazon.in's method of showing exactly how much "cashback" or "savings" will accrue for each payment method.
Tuesday, February 04, 2025
monitoring expiring certificates with Red Sift
LetsEncrypt sent out an email that they would no longer be sending certificate expiry warning emails, and recommended we sign up to Red Sift's free plan.
We can recommend Red Sift Certificates Lite, which provides free expiration emails for up to 250 active certificates: https://redsift.com/pulse-platform/certificates-lite
After signing up, there was a certificate warning, but it turned out to be a false alarm - a certificate which had been re-issued onto a new machine.
Monday, February 03, 2025
manual setup of awstats with static report pages
To improve responsiveness, tried to make awstats generate static pages instead of dynamic report generation with the cgi-bin perl script.
Most probably the unresponsive nature was due to the DNS settings in the /etc/awstats/*.conf files for the domains we were reporting on. As the conf file says,
# If you want/need to set DNSLookup to 1, don't forget that this will
# dramatically reduce AWStats's update process speed. Do not use on large web
# sites.
Then, there was also the dynamic DNS lookup option, which also needed to be set to 0 -
# For very large sites, setting DNSLookup to 0 (or 2) might be the only
# reasonable choice. DynamicDNSLookup allows to resolve host names for
# items shown in html tables only, when data is output on reports instead
# of resolving once during log analysis step.
# Possible values:
# 0 - No dynamic DNS lookup
Then two more settings were changed, changed to 0
# Possible values:
# 0 - Report is not shown at all
# 1 - Report is shown in main page with an entry in menu and default columns
# XYZ - Report shows column informations defined by code X,Y,Z...
# X,Y,Z... are code letters among the following:
# U = Unique visitors
# V = Visits
# P = Number of pages
# H = Number of hits (or mails)
# B = Bandwidth (or total mail size for mail logs)
# L = Last access date
# E = Entry pages
# X = Exit pages
# C = Web compression (mod_gzip,mod_deflate)
# M = Average mail size (mail logs)
# Show domains/country chart
# Context: Web, Streaming, Mail, Ftp
# Default: PHB, Possible column codes: UVPHB
ShowDomainsStats=0
# Show hosts chart
# Context: Web, Streaming, Mail, Ftp
# Default: PHBL, Possible column codes: PHBL
ShowHostsStats=0
Then, with much trial and error, the following lines were added to the root crontab for creating the static pages, and an index file was created to easily go to the relevant server/month page.
sudo su -
crontab -e
58 23 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -update -dir=/var/www/pathtostatsfromawstats/ -config=server1.org -builddate=$(date '+\%Y\%m') > /dev/null 2>&1
56 23 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -update -dir=/var/www/pathtostatsfromawstats/ -config=server2.org -builddate=$(date '+\%Y\%m') > /dev/null 2>&1
and so on.
There were lots of emails to root being generated every 10 minutes from cron, saying awstats.pl could not read the log files in /var/log/apache2/ourlogfile.log - it turned out that these were being generated by another cron which would probably have been created by the awstats installation via apt, which was located in /etc/cron.d directory, the file was /etc/cron.d/awstats which was being run as an unprivileged user, hence unable to read log files etc. So I just commented out those awstat update lines in that file. To note:
Initial setup -
And if we need to password protect it,
Running the perl script without any arguments gave the listing of possible arguments -
perl /usr/share/awstats/tools/awstats_buildstaticpages.pl
Usage:
awstats_buildstaticpages.pl (awstats_options) [awstatsbuildstaticpages_options]
where awstats_options are any option known by AWStats
-config=configvalue is value for -config parameter (REQUIRED)
-update option used to update statistics before to generate pages
-lang=LL to output a HTML report in language LL (en,de,es,fr,...)
-month=MM to output a HTML report for an old month=MM
-year=YYYY to output a HTML report for an old year=YYYY
and awstatsbuildstaticpages_options can be
-awstatsprog=pathtoawstatspl AWStats software (awstats.pl) path
-dir=outputdir Output directory for generated pages
-diricons=icondir Relative path to use as icon dir in <img> links
-builddate=%YY%MM%DD Used to add build date in built pages filenames
-staticlinksext=xxx Build pages with .xxx extension (default .html)
-buildpdf[=pathtohtmldoc] Build a PDF file after building HTML pages.
Output directory must contains icon directory
when this option is used (need 'htmldoc')
At first, I thought I would need to manually create directories and chown them to www-data
# mkdir 202502
# chown www-data:www-data 202502
but then I could use the builddate parameter instead. Note that in the builddate parameter, when the $(date) is called in a cron script, the % characters have to be escaped.
Reports for older year/month combinations could be created like
perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -dir=/var/www/pathtostatsfromawstats/ -config=ourserver.org -year=2024 -month=12 -builddate=202412
And finally, asked Github Copilot to generate a form with dummy servernames and paths, which I manually edited to get the correct paths, as below -
<script>function redirectToUrl() {
var server = document.getElementById("server").value;
var year = document.getElementById("year").value;
var month = document.getElementById("month").value;
var url = "https://ourstatsurlforstatsfromawstats/awstats." + server + year + month + ".html";
window.location.href = url;
}
</script>
</HEAD>
<body>
<form onsubmit="event.preventDefault(); redirectToUrl();">
<label for="server">Select Server:</label>
<select id="server" name="server">
<option value="1.org.">CMS</option>
<option value="2.org.">devel2</option>
</select>
<br /><br />
<label for="year">Select Year:</label>
<select id="year" name="year">
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
</select>
<br /><br />
<label for="month">Select Month:</label>
<select id="month" name="month">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<br /><br />
<input type="submit" value="Submit" />
</form>
</body>
Friday, January 31, 2025
resizing a window in xfce
Some windows like the file manager Thunar allow resizing by dragging any corner, but not the Microsoft Edge browser window. Solution - press ALT, right-click inside the window and drag in any direction.
Thursday, January 30, 2025
show date-time instead of date in Thunar
On the Linux Mint XFCE desktop, Thunar is the default file manager, and by default, it just shows "Today" or the created date of the file. Not useful to find the latest in several versions created in a few minutes time, or to see how long it took to generate file sequences etc. But happily, it can easily be fixed, instead of having to open a terminal and do ls -l
https://forums.linuxmint.com/viewtopic.php?t=241840
Menu > Edit > Preferences - very first tab (Display), Date Format - drop down list right along the bottom is a format like yyyy-mm-dd hh:mm:ss
Wednesday, January 29, 2025
boot logs and more with journalctl
tail /var/log/dmesg
Tuesday, January 28, 2025
adjusting pitch and narration speed in Reaper
Monday, January 27, 2025
downloading youtube videos in 4k
Youtube has recently changed some of its video delivery code, so that online tools like ssyoutube.com etc don't provide videos higher than 360p. Even tools promising free 4k downloads like 4kdownload.com could only provide a 1080p version. Checking if open-source tools can do better - searched for yt dl on github, found https://github.com/ytdl-patched/ytdl-patched
Usage - just needed to give
Sunday, January 26, 2025
Fulldome video - simulated view of moving through a gas cloud or Nebula
Trying to create a different version of this video by ESO - https://www.youtube.com/watch?v=lj3t_gjuXWk - led me to various searches, where apparently IFSRenderer was supposed to be easier to create Nebula videos than Blender. There's the disadvantage that it runs only on Windows, and also doesn't seem to be accelerated much using an NVidia graphics card? So, these renders are only 1024x1024 - also, since these are supposed to be clouds, we can probably scale them to 4k - and probably just get a softer look for the nebula. These renders went at around 4 to 5 frames per minute on the computer with the NVidia 1060 card.
Fulldome video suitable for playback in Planetariums -
And one more (which was actually done earlier, on a laptop with integrated Intel graphics) -
The saved settings for these are uploaded to github,
https://github.com/hn-88/IFSRenderer-saves
Zoom out to the edge of the observable universe in a single shot without cuts
Similar to the previous post, but in a "single take" zoom motion all the way from Earth to the edge of the observable Universe. A fulldome video made with OpenSpace - details as in my previous post.
A "reference" video with text overlay is also created, so that we can note the distances from Earth as the "camera" moves outwards -
Earth to the Moon - fulldome video
Zooming out from a view of the Earth to a close view of the Moon, with a shot similar to the iconic "Earthrise" photo, and moving beyond the Moon - fulldome video suitable for planetariums created with OpenSpace.
The "recording" file used to create this image is shared at https://github.com/hn-88/openspace-scripts/tree/main/user/recordings/Moon-Earthrise-beyond
As noted in the readme there, this was created with v2.1 of OSREC-interp and not with v3.0, v3.0 had bugs - jerky motion.
The full resolution 4096x4096 video is shared on archive.org - https://archive.org/details/earthto-moon-earthrise-beyond-hevc-nvenc
More of our fulldome videos on archive.org are at https://archive.org/search?query=creator%3A%22www.saispace.in%22
Saturday, January 25, 2025
delete files found with "find"
Trying to create an AppImage for OpenSpace led to many learnings. Among them - how to delete the files found with the "find" command -
find . -name '*.cpp' -print0 | xargs -0 -P2 rmExplanation -
"If you're on Linux or have the GNU find and xargs commands, then use -print0 with find and -0 with xargs to handle file names containing spaces and other odd-ball characters." - https://stackoverflow.com/questions/864316/how-to-pipe-list-of-files-returned-by-find-command-to-cat-to-view-all-the-files
"xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or new‐lines, and executes the command (default is echo) one or more times with any initial-arguments followed by items read from standard input. Blank lines on the standard input are ignored." ... "Because Unix filenames can contain blanks and newlines, this de‐ fault behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs. In these situations it is better to use the -0 option, which prevents such problems. When using this option you will need to ensure that the program which produces the input for xargs also uses a null character as a separator. If that program is GNU find for example, the -print0 option does this for you." - https://www.man7.org/linux/man-pages/man1/xargs.1.html
and the -P option is "-P max-procs, --max-procs=max-procs
Run up to max-procs processes at a time"




