Skip to content

Instantly share code, notes, and snippets.

@ishu3101
ishu3101 / base.yml
Created September 28, 2022 01:53
Config file for Espanso - Cross Platform Text Expander
# espanso match file
# For a complete introduction, visit the official docs at: https://espanso.org/docs/
# You can use this file to define the base matches (aka snippets)
# that will be available in every application when using espanso.
# Matches are substitution rules: when you type the "trigger" string
# it gets replaced by the "replace" string.
matches:
@ishu3101
ishu3101 / Get-Computer-Info.ps1
Created September 28, 2022 01:52
How to Get Computer Information such as CPU, Manufacturer, Model, OS etc using Powershell
# Get Free & Total Disk Space
Get-WmiObject -Class win32_logicaldisk -ComputerName $computerName | ft DeviceID, @{Name="Free Disk Space (GB)";e={$_.FreeSpace /1GB}}, @{Name="Total Disk Size (GB)";e={$_.Size /1GB}} -AutoSize
# Get Computer Model
Get-ComputerInfo | Select -ExpandProperty CsModel
# Get OS
Get-ComputerInfo | Select WindowsProductName
@ishu3101
ishu3101 / Get-InstalledPrograms.ps1
Created September 26, 2022 23:24
Get the List of Installed Program via Registry using Powershell
Function Get-InstalledPrograms {
<#
.Synopsis
Fetches the list of installed software on a system via the Windows Registry.
.Description
Returns a list of software installed on a system determined from installations that have
registered themselves in the Windows Registry. This cmdlet will parse both the native key
and the WOW64 key if it exists to ensure a complete list of software installs is returned.
.Notes
This cmdlet is particularly useful on Server Core installations where the Programs and
@ishu3101
ishu3101 / Get-ComputerInfo.ps1
Created September 26, 2022 22:15
Get Computer Information such as OS, Manufacturer, Model, CPU using Powershell
$osInfo = Get-CimInstance Win32_OperatingSystem
$computerInfo = Get-CimInstance Win32_ComputerSystem
$diskInfo = Get-CimInstance Win32_LogicalDisk
$cpuinfo = Get-WmiObject Win32_Processor
[hashtable]$objectProperty = @{}
$objectProperty = [ordered]@{
ComputerName = $computerInfo.Name
OS = $osInfo.Caption + " $($osInfo.OSArchitecture)"
@ishu3101
ishu3101 / color.md
Created March 20, 2020 05:53
What each Color Reflects
Color Reflects
Greyscale Power, elegance, reliability, intelligence, modesty, maturity, functionality, and formality
Blue Depth and stability, trust, loyalty, wisdom, confidence, intelligence, faith, truth, heaven, tranquility and calmness
Teal Creativity, inspiration, credibility, reliability, spiritual development
Green Nature, growth, harmony, freshness, fertility, safety, healing, money
Purple Royalty, power, nobility, luxury, ambition, wealth, extravagance, wisdom, dignity, independence, creativity, mystery, and magic
Pink Girly, sweet, innocent, sensitive, passionate, playful, sensual and loving
Red Power, energy, passion, desire, speed, strength, love, fire, intensity, and celebration
Orange Joy, enthusiasm, fascination, happiness, creativity, determination, attraction, success, encouragement, and stimulation
@ishu3101
ishu3101 / setup_aws-vault.sh
Created March 3, 2020 04:11
Install AWS Vault on Linux
curl -SL https://github.com/99designs/aws-vault/releases/download/v5.3.2/aws-vault-linux-amd64 -o aws-vault
sudo mv aws-vault /usr/bin/aws-vault
chmod +x /usr/bin/aws-vault
[
{
"quote": "In a crowded marketplace, fitting in is failing. In a busy marketplace, not standing out is the same as being invisible.",
"author": "Seth Godin",
"source": "https://www.amazon.com/Purple-Cow-New-Transform-Remarkable/dp/1591843170"
},
{
"quote": "It’s counterintuitive, but the way to grow your business is to focus entirely on your existing customers. Just thrill them, and they’ll tell everyone",
"author": "Derek Sivers",
"source": "https://www.amazon.com/Anything-You-Want-Lessons-Entrepreneur/dp/1511366079",
@ishu3101
ishu3101 / packer_setup.sh
Created November 2, 2018 21:11
Install Packer on Ubuntu 16.04
curl -SL https://releases.hashicorp.com/packer/1.3.2/packer_1.3.2_linux_amd64.zip -o packer_1.3.2_linux_amd64.zip
unzip packer_1.3.2_linux_amd64.zip
sudo mv packer /usr/bin/packer
@ishu3101
ishu3101 / install_nanobox.sh
Created October 13, 2018 22:15
Install Nanobox and Docker CE on Ubuntu 18.04
# Script to install nanobox and docker-ce
# install Nanobox
curl -SL https://d1ormdui8qdvue.cloudfront.net/installers/v2/linux/nanobox_2_amd64.deb -o nanobox_2_amd64.deb
sudo dpkg -i nanobox_2_amd64.deb
# install docker ce
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=edge
@ishu3101
ishu3101 / Disable-UAC.ps1
Created October 4, 2018 22:22
Disable User Access Account (UAC) using PowerShell
function Disable-UAC(){
$numVersion = (Get-CimInstance Win32_OperatingSystem).Version
$numSplit = $numVersion.split(".")[0]
if ($numSplit -eq 10) {
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value "0"
}
elseIf ($numSplit -eq 6) {
$enumSplit = $numSplit.split(".")[1]
if ($enumSplit -eq 1 -or $enumSplit -eq 0) {