Skip to content

Instantly share code, notes, and snippets.

View asheroto's full-sized avatar
😎

asheroto

😎
View GitHub Profile
@asheroto
asheroto / README.md
Last active May 4, 2025 17:30
Easily install and configure GeoIP for use with iptables which enables you to block/allow entire countries.

Configure GeoIP for iptables

This script configures GeoIP for use with iptables. Installs Linux headers, uses xtables-addons, uses latest db-ip.com database, fixes dependencies, loads xt_geoip module.

Supports colored message using ANSI escape codes. 😎

Run the script as root or with sudo.

Script Functionality

@asheroto
asheroto / README.md
Last active February 4, 2024 04:28
Example of daemonized teler

Example of daemonized teler

This example turns teler into a service, then implements inotifywatch to monitor the configuration file for changes. This way teler will automatically load on start on boot, and when config.yaml changes the teler service will restart and load the changes.

Steps

  1. Install inotify-tools
apt-get -y install inotify-tools
@asheroto
asheroto / Disable-EdgeAnnoyances.reg
Last active April 25, 2025 10:45
Disable annoying Microsoft Edge first run experience, implicit sign-in, disable shopping, rewards, default browser campaign, auto import, forced sync, sidebar, restore browser reminder. Shows home button, enables SmartScreen.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\Recommended]
"UserFeedbackAllowed"=dword:00000000
"AutoImportAtFirstRun"=dword:00000001
"SmartScreenEnabled"=dword:00000001
"PersonalizationReportingEnabled"=dword:00000000
"ShowRecommendationsEnabled"=dword:00000000
"ForceSync"=dword:00000000
"SyncDisabled"=dword:00000001
@asheroto
asheroto / Install-Font.ps1
Last active January 29, 2024 19:21
PowerShell function to install fonts on Windows. Supports both individual and bulk file installations. Offers wildcard and recursive directory searching. TTF and OTF fonts supported by default.
Function Install-Font {
<#
.SYNOPSIS
Installs fonts from a specified path on Windows systems.
.DESCRIPTION
The Install-Font function supports handling individual font files, directories containing multiple fonts, and wildcard paths. It also supports recursive search for font files in the specified path and all its subdirectories. The function is capable of installing both TTF and OTF font types.
.PARAMETER Path
Specifies the path to the font file(s). This can be a path to an individual font file, a directory containing font files, or a wildcard path. The function accepts both relative and absolute paths.
@asheroto
asheroto / Create-NewOutlookEmail.ps1
Last active July 7, 2024 00:19
Create e-mails in Outlook using PowerShell. Select account, keep default signature, keep original formatting, produce valid HTML.
function Create-NewOutlookEmail {
param (
[Parameter(Mandatory = $true)]
[string]$To,
[Parameter(Mandatory = $true)]
[string]$Subject,
[Parameter(Mandatory = $true)]
[string]$Body, # Expecting HTML formatted string
@asheroto
asheroto / Disable-PowerShellTelemetry.ps1
Last active May 30, 2024 05:27
Scripts to disable PowerShell Telemetry and Update Check. Scripts add the System environment variables.
# Disables PowerShell telemetry by setting the environment variable associated with it.
# More info: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_telemetry
#Requires -RunAsAdministrator
# See this for more info:
# https://gist.github.com/asheroto/5c1711fcbd888c5a621b1ff0b91dfc00
# Bypasses the typical delay experienced with Environment.SetEnvironmentVariable, which can be slow due to its broadcasting a message to all top-level windows.
# These functions offer a more efficient alternative for getting, setting, or deleting environment variables.
function Set-EnvironmentVariable {
@asheroto
asheroto / README.md
Last active October 2, 2024 06:34
Nextcloud - Show gallery view by default with public / sharing / shared folders

Nextcloud - Show gallery view by default with public / sharing / shared folders

This will automatically switch a public or shared folder to gallery view when loading.

This only works on public or shared folders on Nextcloud and will not affect normal folders viewed under your user account.

Tested and working on Nextcloud 27+.

How to Configure

  1. Open core/js/public/publicpage.js.
@asheroto
asheroto / Optimize-TCPSettings.ps1
Last active February 11, 2025 06:25
Adjusts various TCP and network settings in Windows to enhance the speed of the Internet connection.
Write-Output "Setting congestion provider to CTCP for Internet."
netsh int tcp set supplemental Internet congestionprovider=ctcp | Out-Null
Write-Output "Enabling Direct Cache Access, and configuring RSS and RSC settings globally."
netsh int tcp set global dca=enabled rss=enabled rsc=disabled | Out-Null
Write-Output "Disabling TCP timestamps globally."
netsh int tcp set global timestamps=disabled | Out-Null
Write-Output "Setting initial Retransmission Timeout (RTO) to 2000 milliseconds globally."
_CommonRedist
game
qt5_plugins
steamapps
subtools
amd_ags_x64.dll
animationsystem.dll
assetpreview.dll
ati_compress_wrapper.dll
bugreporter_filequeue.dll
@asheroto
asheroto / ImportPFX.ps1
Created October 11, 2023 05:47
Import PFX files with PowerShell using the .NET class.
# Load the PFX file into an X509Certificate2 object
$pfxPath = "path_to_your.pfx"
$password = "your_password" # Consider using SecureString for production use
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
# Import the PFX into the certificate object
$cert.Import($pfxPath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::PersistKeySet)
# Add the certificate to the desired store (in this case, the Personal store of the CurrentUser)
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store "My", "CurrentUser"