Skip to content

Instantly share code, notes, and snippets.

Prasanna Loganathar prasannavl

Block or report user

Report or block prasannavl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@prasannavl
prasannavl / sysctl.conf
Last active Oct 20, 2017
Linux - Laptop Kernel Config
View sysctl.conf
# Def: 50; Reduce tendency to swap on large RAM system
vm.swappiness=10
# Def: 100; Reduce to retain inode/dentry caches
vm.vfs_cache_pressure=20
# Def: 10; Make it slightly longer to wait longer before writing to HD.
vm.dirty_background_ratio=20
# Def: 20; Make it much larger before starting sync writes
@prasannavl
prasannavl / Set-WindowState.ps1
Created Sep 26, 2015
Set a given window state for any window using WinAPI.
View Set-WindowState.ps1
function Set-WindowState {
<#
.SYNOPSIS
Set a given window state using WinAPI.
.DESCRIPTION
Use the ShowWindowAsync function to set the Window state for
any given window handle or the current powershell process.
.EXAMPLE
Set-WindowState -State "MINIMIZE"
@prasannavl
prasannavl / Clone-AllGitHubRepos.ps1
Created Sep 26, 2015
Clone all the repos for a given GitHub username.
View Clone-AllGitHubRepos.ps1
function Clone-AllGitHubRepos
{
<#
.SYNOPSIS
Clone all GitHub Repositories of a given user.
.DESCRIPTION
Recursively clone all the repos for a given username.
.EXAMPLE
Clone-AllGitHubRepos -User "aspnet"
@prasannavl
prasannavl / Set-DisplayOff.ps1
Created Sep 26, 2015
Powershell script to turn display off
View Set-DisplayOff.ps1
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
Add-Type -TypeDefinition '
using System;
@prasannavl
prasannavl / Update-AutoModuleManifest.ps1
Created Sep 26, 2015
Updates a module manifest automatically with all the files in the powershell scripts in the module directory as scripts to process.
View Update-AutoModuleManifest.ps1
function Update-AutoModuleManifest
{
<#
.SYNOPSIS
Updates a module manifest automatically with all the script files
in the module directory as scripts to process.
.DESCRIPTION
Looks for the given module's path, and then uses New-ModuleManifest to
create a manifest file which includes all the "*.ps1" files in the
folder as "ScriptsToProcess".
@prasannavl
prasannavl / New-FileShortcut.ps1
Last active Dec 21, 2017
Create windows shortcuts from Powershell
View New-FileShortcut.ps1
function New-FileShortcut
{
<#
.SYNOPSIS
Create Windows shortcuts
.DESCRIPTION
Creates shortcuts of the Target in the given location.
Given locations can either be the full path, or just the name in which
case its created on the current path.
If just the target path is given, it creates a shortcut with the same
You can’t perform that action at this time.