Skip to content

Instantly share code, notes, and snippets.

@bps
bps / git_ps1.sh
Created March 23, 2011 14:29
Sometimes __git_ps1 takes too long. This disables it when we ^C.
# via https://gist.github.com/623371
if [[ $(declare -f __git_ps1) ]]; then
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
git_ps1_disable ()
{
_skip_git_ps1=1
@shovon
shovon / increase_swap.sh
Created April 10, 2015 15:18
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active July 22, 2024 04:44
Reverse Mouse Wheel scroll in Windows 11 (Natural Mode like MacOS)

Reverse Mouse Wheel scroll in Windows 11

Chose between natural mode like MacOS or Windows default mode.

Step 1: Open Windows PowerShell in Administrator Mode.

You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.

Step 2: Copy the following code and paste it in the command line of Windows PowerShell:

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }