Skip to content

Instantly share code, notes, and snippets.

@kanlas-net
kanlas-net / issue_config.sh
Created January 18, 2026 08:49
openvpn-scripts
#!/bin/bash
read -p 'Write name for client config: ' NAME
read -p 'Write path where to save config: ' HOME
DIGEST="sha512"
KEYSIZE="4096"
RSA="/etc/openvpn/easy-rsa"
OPENVPN="/etc/openvpn"
HOST="ovpn.kanlas.info"
@kanlas-net
kanlas-net / submodules_init.sh
Created November 14, 2024 14:30
working with git submodules
git submodule update --init --recursive
eval "cat <<EOF
$(<template.txt)
EOF
" 1> /to/file
ip=<ROUTER IP>
as=<ROUTER AS>
if ! pgrep wget
then
cd /tmp
wget https://gist.githubusercontent.com/kanlas-net/dec8e8eea08afe344faf43709f4f51e8/raw/bird.conf -O bird.conf.template
eval "cat <<EOF
$(<bird.conf.template)
EOF
@kanlas-net
kanlas-net / git-single-folder.sh
Created April 28, 2021 16:36
git checkout single folder
git clone \
--depth 1 \
--filter=blob:none \
--no-checkout \
<git-url-here>
git checkout master -- <foldername>
@kanlas-net
kanlas-net / cleanmgr_deep_cleanup.ps1
Created March 3, 2020 20:29
Powershell Disk Cleanup
#Some great person made this script, not me. Praise him! Praise him!
$VolumeCachesRegDir = "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches"
$CacheDirItemNames = Get-ItemProperty "$VolumeCachesRegDir\*" | select -ExpandProperty PSChildName
$CacheDirItemNames |
%{
$exists = Get-ItemProperty -Path "$VolumeCachesRegDir\$_" -Name "StateFlags6553" -ErrorAction SilentlyContinue
If (($exists -ne $null) -and ($exists.Length -ne 0))
{
Set-ItemProperty -Path "$VolumeCachesRegDir\$_" -Name StateFlags6553 -Value 2