When downloading a script, I suggest making a "scripts" folder somewhere safe and then adding that folder to PATH1.
Then, you can just write the name of the script with arguments in your favourite shell.
Example:
script arg1 -switch1`\If not, you will have to call each script either by relative or absolute paths.
Example:
"C:\users\FlyMandi\Downloads\script.ps1" arg1 -switch1
config.ps1 is a script I personally use to set up new computers. It installs and updates all software that I use on a daily basis.
I can't recommend you use it, since the software is highly dependant on personal uses and platforms, but certainly have a look at the source code if intrigued. It can set up windows 10/11 as well as Arch Linux machines, completely from scratch. On Windows, it will work out of the box.
On Arch Linux, you'll need pwsh and the yay package manager.
Other distros might work, but I've only tested this script on arch and will only update/fix if it breaks for arch.
Make sure you've installed less and fzf, both available via scoop.
This streamlines the use of curl cht.sh/language/topic like so:
cheatsheet language topicSo, if you've set a csh alias for cheatsheet, curl cht.sh/cpp/loops becomes:
csh cpp loopsYou can also open a fuzzy find list of languages:
cshand topics:
csh cppDidn't you always want to set an alarm from your terminal? Well, now you can. First, make sure you've installed mpvnet.
scoop install mpv.netThen, you can set an alarm for any time today. For now, input is limited to hh:mm:ss or hh:mm within the same day. Specify a file path to then be played.
Set-Alarm "CatAlarm" 16:09 "~\Videos\Funny Cat Video.mp4"or, alternative syntax:
Set-Alarm -n "Cattie Cat" -t 16:09:30 -p ~\Videos\Cat.mp4You can check status and cancel by name with -s and -c:
To view status:
Set-Alarm CatAlarm -sTo cancel:
Set-Alarm "Cattie Cat" -cScript to get unix & discord timestamps
I communicate with a lot of people abroad via discord and it's super handy to be able to set a discord timestamp that automatically converts to the reader's timezone. For example, when I set a streaming schedule and want to say "Tuesdays at x time, thursdays at y time" I can't say my time because that's only going to apply to people within my timezone. Here's a quick way to get a formatted discord timestamp from a time of your desire:
Input:
unixor
unix getOutput:
Writing time 06/02/2024 15:02:13 (1717333334) to clipboard.
Input:
unix convert 1717333334
or
unix convert -t 171733333402 June 2024 15:02:14 will have been written to your clipboard.
Mode can be any of the following:
| Mode | Values | Result in clipboard | Format in discord |
|---|---|---|---|
| relative | relative or r |
<t:1717331031:R> |
54 minutes ago |
| long time | longtime or lt |
<t:1717331031:T> |
14:23:51 |
| short time | shorttime or st |
<t:1717331031:t> |
14:23 |
| long date | longdate or ld |
<t:1717331031:D> |
2 June 2024 |
| short date | shortdate or sd |
<t:1717331031:d> |
02/06/2024 |
| long full | longfull or lf |
<t:1717331031:F> |
Sunday, 2 June 14:23 |
| short full | shortfull or sf |
<t:1717331031:f> |
2 June 2024 14:23 |
| default | blank or invalid | <t:1717331031> |
2 June 2024 14:23 |
Usage:
unix discord -m Mode -t time
Input:
unix discord -m relative -t 1717333334Output:
Writing time 06/02/2024 15:13:45 to clipboard.
Written timestamp with mode : <t:1717333334:R>
If you leave out the mode, the mode will fall back to default and if you leave out the time, it will use the current unix timestamp.
Limitations: can only work with current or specific unix time (for now)\
Script to update winget package registry version
Some packages don't update properly (like Discord.Discord) and using winget update would result in the package being shown as not updated, staying on the version that was first installed. This is a scuffed fix. It will find and update the registry key, but please only use this when you're sure you have the newest version installed and only winget is showing the wrong, outdated version number.
Example usage:
updatewr discord.discordLimitations: registry key folder must match the name that's displayed via "winget show" or you have to supply the registry folder name.
Example:
updatewr jandedobbeleer.ohmyposh
doesn't work, but
updatewr jandedobbeleer.ohmyposh -reg "Oh My Posh_is1"does.
to update a steam app that is recognized via winget but has an out-of-date or unknown version number, you can utilize the steam app ID, as follows:
updatewr jagex.oldSchoolRunescape -reg 'steam app 1343370'NOTE: to update the ones stuck in HKEY_LOCAL_MACHINE, you will need to run this script in an elevated prompt. Please never run scripts off the internet without having read through them. Unfortunately, not everyone is as nice as me. 👁️
If you want to take matters into your own hands, hit Win+R, type regedit, hit enter & search for the folder yourself in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall
or
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
and look for the Registry Key called DisplayVersion, then update it.
Simply run
PlayniteImageCleaner
and the script will clean unused Images, specifically leftovers from the BackgroundChanger and CoverStyleSwitcher extensions.
Simply run
SkyrimDiagnostics
and the script will warn about outdated mods, as well as indicate which single .ESP files are very large, which are both good indicators about possible mod problems.
It features an exclusion list.
Script to change between made winfetch config files
I shan't need to say that you need to have winfetch installed. Personally, I've installed it via scoop install winfetch. Uninstalling winfetch via scoop uninstall winfetch will not get rid of your saved theme configuration files.
I personally use winfetchconfig as a way to change up the image being displayed when winfetch is called, as I was tired of always manually editing the config file for that. If you want to do that, read below.
Syntax is as follows: winfetchconfig operation ThemeName choose is the fallback operation.
The location for all your personal configs is in %UserProfile%\Documents\.personalConfigs\winfetch.
You shouldn't need to access this folder unless you desire to change them in a specific text editor instead of with the script.
At that point, just go and edit the line that says notepad in the script yourself.
To save a theme with a name, write:
winfetchconfig save ThemeNameNote: use the -f flag to overwrite a saved theme with the same name. Also, I shouldn't need to say this, but always replace ThemeName with... your desired name for the theme. ![]()
winfetchconfig choose ThemeNameor simply:
winfetchconfig ThemeNamewinfetchconfig listwinfetchconfig editwinfetchconfig edit ThemeNamewinfetchconfig randomThe default theme is stored as %UserProfile%\Documents\.personalConfigs\winfetch\default\!default.ps1 and is created the first time you use winfetchconfig, but can be adjusted to your liking by setting your current config as the default one. Personally, I recommend letting the default... be the default.
To save current theme to default, write:
winfetchconfig savedefaultTo reset theme to (saved) default, write:
winfetchconfig resetTo reset default to very default (c'mon now), write:
winfetch -genconf
winfetchconfig savedefaultI've now also uploaded a version for fastfetch, which I personally prefer using. All arguments are analogous.