Skip to content

Instantly share code, notes, and snippets.

View vivek1986's full-sized avatar
💭
I may be slow to respond.

Vivek Shah vivek1986

💭
I may be slow to respond.
  • PS
  • Ahmedabad
View GitHub Profile
@vivek1986
vivek1986 / BulkVideoRenamer.bat
Created October 28, 2023 12:39
PowerShell & Batch+PowerShell Hybrid Script to Rename almost any Video/Movie/Episode file you ever want
<# ::
@echo off
powershell -c "iex ((Get-Content '%~f0') -join [Environment]::Newline); iex 'main %*'"
goto :eof
#>
$validExtensions = '.mkv', '.mp4'
Get-ChildItem -File |
Where-Object Extension -In $validExtensions |
Where-Object Length -GT 500mb |
@vivek1986
vivek1986 / PowerShellAllowScriptExecution0.md
Created October 24, 2023 20:44
PowerShellAllowScriptExecution0.md
  1. Open PowerShell in Admin mode(Run As Administrator):

  2. Run following commands 1-by-1 or altogether as mentioned below:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

#### OR ####
@vivek1986
vivek1986 / EnableDisableTouchPadLenovoLaptop.md
Last active October 24, 2023 19:17
How to Enable/Disable TouchPad PnpDevice when it becomes annoying to handle ?
  1. Open PowerShell in Admin Mode(Run As Administrator)
  2. Run following command to get List of All PnpDevices present in the OS/System:
Get-WmiObject Win32_PNPEntity | Select Name, DeviceID
  1. Run following command to filter the data-list and get the Device Info that you want to toggle:
Get-WmiObject Win32_PNPEntity | Select Name, DeviceID | Where Name -Match "HID"
@vivek1986
vivek1986 / FarCry-HowToMod.md
Created October 5, 2023 20:09
FarCry How to mod steps for modding / editing *.lua files

How to extract and edit files in FarCry game folder

  1. Put this Batch Script in FarCry install folder inside FCData folder (C:\Games\Far Cry\FCData):
  • Name this script RenameAndExtractScriptsPakFile.bat
@echo off && setlocal
copy /b /v /y Scripts.pak Scripts.zip
md Backups && copy /b /v /y Scripts.pak ".\Backups"
powershell Expand-Archive Scripts.zip -DestinationPath .
del /a /f /s /q ".\Scripts.zip"
start "" ".\SCRIPTS\Default\Entities\Weapons"
@vivek1986
vivek1986 / clean_cache_teams.cmd
Created July 27, 2023 22:15 — forked from tuantmb/clean_cache_teams.cmd
A simple batch script to clean up #cache for #Microsoft #teams
@echo off && setlocal
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' (
goto mainScript
) else (
goto getPrivileges
)
@vivek1986
vivek1986 / PrimaryControlExecutionPolicy.ps1
Created July 26, 2022 02:11
Powershell Set Execution Policy
$Loc = Get-Location
"Security.Principal.Windows" | % { IEX "( [ $_`Principal ] [$_`Identity ]::GetCurrent() ).IsInRole( 'Administrator' )" } | ? {
$True | % { $Arguments = @('-NoProfile','-ExecutionPolicy Bypass','-NoExit','-File',"`"$($MyInvocation.MyCommand.Path)`"","\`"$Loc\`"");
Start-Process -FilePath PowerShell.exe -Verb RunAs -ArgumentList $Arguments; } }
(Get-Location).ToString()
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
@vivek1986
vivek1986 / php.ini
Created July 14, 2022 21:58
Projects PHP INI Settings
[PHP]
max_execution_time = 18000
max_input_time = 3600
memory_limit = 512M
error_log = "{PHP_Dir_Path}\logs\error.log"
extension_dir = "{PHP_Dir_Path}\ext"
upload_max_filesize = 16M
max_file_uploads = 20
extension=bz2
extension=curl
@vivek1986
vivek1986 / makeMetered.ps1
Created March 6, 2022 17:03 — forked from danzek/makeMetered.ps1
Take ownership of key and make Ethernet connection a metered connection
<#
.SYNOPSIS : PowerShell script to set Ethernet connection as metered or not metered
.AUTHOR : Michael Pietroforte
.SITE : https://4sysops.com
#>
# Retrieved from https://4sysops.com/archives/set-windows-10-ethernet-connection-to-metered-with-powershell/
@vivek1986
vivek1986 / power-delete.psm1
Created March 6, 2022 17:02 — forked from jcttrll/power-delete.psm1
PowerShell module to take ownership of a file/directory, assign permissions allowing deletion, and then delete the item (recursively in the case of directories, and optionally including deletion of all hardlinks to files)
function Power-Delete {
[CmdletBinding()]
param(
[parameter(Position = 0, ValueFromRemainingArguments = $true, ValueFromPipelineByPropertyName = $true)]
$FullName,
[switch]
$AllHardLinks
)
process {