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 / GithubGistFromFilesInFolder.md
Created October 30, 2024 18:56
Gist created from folder

To auto-generate a GitHub Gist from a folder with files, you can use the GitHub API and a scripting language like Python or Bash. Below are the steps to achieve this.

Step 1: Create a GitHub Personal Access Token

  1. Go to GitHub settings.
  2. Click on "Generate new token".
  3. Select the scopes you need. For Gists, you'll generally need the "gist" scope.
  4. Generate the token and save it securely.

Step 2: Script to Create Gist

@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/