After switching to exa as an ls-replacement i also wanted to make use of the nerd-font support ho have icons displayed for files.
alias etree='exa --color --tree --icons=always'
However, in reality the fonts never looked the same in my terminal as in the web preview
So, to easy things up (getting the zip, unzipping it in ~/.local/share/fonts and updateing the fonts-cache) there is a little function which can be placed in the .zshrc/.bashrc to automate things.
#Function to install NerdFonts
function install_nerdfont()
{
if [ -not $1 ];
then
echo -e "\e[91mParameter missing!\e[0m"
fi
cd ~/.local/share/fonts
wget $1
unzip -u *.zip
rm *.zip
fc-cache -fv
cd -
}
Once executed with the download-URL as a paremeter, the font will be installed to your home directory.
If the fonts should be installed system-wide, this can be archived by placing them in /usr/local/share/fonts (folder might needs to be created if it does not exist).
Once the fonts are installed – the terminal-profile must be configured to use the newly installed fonts and that’s it.
As Windows Powershell is not able to create monthly tasks I used schtasks.exe utility to create the skeleton for the task/minimal task containing the trigger-definition and afterwards manipulate it via powershell to add the missing configuration.
To do so i used Get-ScheduledTask to obtaint he object references for the task and Set-ScheduledTask to write the object again.
Turns out – the task obtained via Get-ScheduledTask contains the trigger defintion for the montly repetition which can’t be handled by powershell and therefor the task itself can not be saved again but results in the above error. 😜
As it seems there are only two ways on how to deal with that problem: Export the task-definition as an XML and just reimport it via powershell on other systems which require the same configuration (currently untested) or run it daily and deal with the problem within the script.
Lil bit of the debugging-code as a reference for future projects.
After enabling OpenSSH on Windows I had the issue that powershell sessions could be mixed up quite easily as it does not display which host is opened in which session.
to work around that a custom prompt function can be specified in the powershell profile
powershell profile is loaded on startup of a powershell window. By default there is no file but it can be created. The file itself is referenced by the PS env $PROFILE.
The script will just generate face credit card numbers CVVs and face validation-dates and post it to the script, the scammer used to receive the data from the phising-site.
If a WSUS server fails to obtain updates with the following error: “wsus the request failed with http status 404 not found” this might be because it still uses an old/outdated URL (https://fe2.update.microsoft.com/v6) to obtain the updates from.
This can be checked and changed with the following PS1 Snippet:
$server = Get-WsusServer
$config = $server.GetConfiguration()
# Check current settings before you change them
$config.MUUrl
$config.RedirectorChangeNumber
# Update the settings if MUUrl is https://fe2.update.microsoft.com/v6
$config.MUUrl = "https://sws.update.microsoft.com"
$config.RedirectorChangeNumber = 4002
$config.Save()
iisreset
Restart-Service *Wsus* -v
Dovecot comes with a proprietary mailbox-format (sd/mdbox) that provides some benefits in regard of compression and performance but is not really readable with nothing else than an editor.
It seems that there are very little information on how to convert the sd/mdbox-fomat to mbox (at least nothing copy and paste like if you aren’t a dovecot admin and have no clue ;))
So here is one possible-way it could be archived:
To work around adapting the dovecot-config and running a dovecot-service for dsync to use, we can also pass configuration parameters (by default dsync uses the dovecot-configuration file stored at /etc/dovecot/dovecot.conf) directly to dsync. With that trick there is no need to configure & start a dovecot service.
An example command to convert a mailbox in mdbox-format located in the users home dir under mail to mbox format would look like:
Converting to other formats like maildir might require additional configuration parameters within the /etc/dovecot/dovecot.conf file as namespaces or similar.
IMPORTANT: Override options specified via “-o” must be passed directly after the dsync command and before “backup”
For converting a mailbox the “backup” attribute is recommended as this will do a 1-way-sync.
My printer at home is powered of most of the time to save power as I’ll only print a couple of pages once every while.
As i was teached that technicians shall be lazy I use a Sonoff POW R2 to work around getting up and switching on the printer when I want to use it. The Sonoff was flashed with Tasmota to as I don’t want some chinese company to have some backdoor within my IOT-home net.
However, I still had to open up the sonnoff webpage every time and hit the power-on-button for my printer to come up and that’s still some work to do which could be avoided in honor of laziness.
So, the ingridents to a lazy but power saving printer are:
We can configure a Task that’s running in case a specific event log entry is appended to the event log and call the printer’s API to switch on the power every time somebody adds a new print job to the OS printer queue.
Event log config (eventvwr.msc)
The entry we want is: “Microsoft-Windows-PrintService/Operational” (Applications and Service Logs -> Microsoft -> Windows -> PrintService : Operational) That log needs to be enabled first:
Once that’s done there will be new entries every time a new printjob is added:
The interesting part is the Event with the ID 800 -> that’s the one we are looking for as it logs that there is a new spooling job.
Create a Batch-Script to call the Tasmota API
That’s pretty easy. I suggest to simply create a batch script witht he following content:
@echo on
C:\Windows\System32\curl.exe "http://<IPADDRESS>/cm?cmnd=Power%%20On"
As curl already comes with newer installations we can simply use it for our call. A powershell could also be used, but by creting a batch script we do not have to deal with the PS-execution policy settings and getting them correct to work.
Create a Task (taskschd.msc)
A new task needs to be created. The Trigger is a specific event-log enty:
With the correct event configured:
As an action we just want to start a program which is the batchscript witht he content from above.
Once that’s done, the script will be run by the task scheduler every time someone hits the “print” button. Running the script will power up the printer automatically and Windows will print the page as soon as the printer is reachable. – so nomore getting up to power the printer manually 🙂
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookies
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
3rd Party Cookies
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!