Skip to content

Instantly share code, notes, and snippets.

View richardnfag's full-sized avatar
👽

Richard do Nascimento Fagundes richardnfag

👽
View GitHub Profile
@richardnfag
richardnfag / hyper-v.bat
Created September 21, 2022 22:54
Enable Hyper-V on Windows 11 Home
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Hyper-V*.mum >List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del /f List.txt
dism /online /enable-feature /All /featurename:Microsoft-Hyper-V
@richardnfag
richardnfag / edge_policies.sh
Last active September 13, 2022 23:32
Apply Edge Policies in Linux
#!/bin/sh
mkdir -p /etc/opt/edge/policies/managed/
cat > /etc/opt/edge/policies/managed/my_policies.json << EOF
{
"NewTabPageLocation": "chrome-search://local-ntp/local-ntp.html"
}
EOF
@richardnfag
richardnfag / enable_gpedit.bat
Last active September 21, 2022 22:14
Enable Group Policy Editor (gpedit.msc) on Windows 11 Home
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del /f List.txt
pause
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"NewTabPageLocation"="chrome-search://local-ntp/local-ntp.html"
@richardnfag
richardnfag / playback_rate.js
Created August 21, 2022 03:04
Youtube Video Play Back Rate
const youtube_speed = (speed) => [
...document.getElementsByClassName("video-stream html5-main-video")
].forEach(
(v) => v.playbackRate = speed
);
@richardnfag
richardnfag / setup.sh
Created October 9, 2021 13:55
Remove title bar on maximized windows KDE Plasma
kwriteconfig5 --file ~/.config/kwinrc --group Windows --key BorderlessMaximizedWindows true
kwin_x11 --replace
# kwin_wayland --replace
@richardnfag
richardnfag / installer.sh
Created May 15, 2021 21:18
firefox nightly
#!/bin/sh
# https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt
wget -O nightly.tar.bz2 "https://download.mozilla.org/?product=firefox-nightly-latest&os=linux64&lang=en-US"
tar -jxf nightly.tar.bz2
rm nightly.tar.bz2
mv firefox /opt/
chmod 755 /opt/firefox/*
#!/usr/bin/env python3
import tarfile
from re import match
from json import loads
from shutil import move
from requests import get
response = get(
"https://api.github.com/repos/MiniShift/minishift/releases/latest"
# 1 - Run `notepad $PROFILE.CurrentUserCurrentHost`
# 1.1 - If $PROFILE.CurrentUserCurrentHost does not exists, run before `New-Item -Path $PROFILE.CurrentUserCurrentHost -ItemType "file" -Force`
# 2 - Copy and paste the following function:
function prompt {
Write-Host "($env:USERNAME) $([char]0x03BB) " -ForegroundColor Blue -NoNewline;
Write-Host "$PWD" -ForegroundColor Gray -NoNewline
" "
}
# 3 - Run `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
@richardnfag
richardnfag / zsh.sh
Created April 23, 2021 02:09
ZSH customization script
#!/bin/sh
user_setup(){
sed -e '/PROMPT/ s/^#*/#/' -i $1 2> /dev/null
cat >> $1 <<EOF
# Find and set branch name var if in git repository.
function git_branch_name()
{
echo $(git branch 2>/dev/null | grep '^*' | colrm 1 2)