Skip to content

Instantly share code, notes, and snippets.

View mohitt's full-sized avatar
🎯
Focusing

Mohit Thakral mohitt

🎯
Focusing
View GitHub Profile
@mohitt
mohitt / Powershell PSGet Install Proxy
Created February 25, 2015 22:11
Powershell PSGet Install Proxy
$c = (new-object Net.WebClient) ; $p = [System.Net.WebRequest]::GetSystemWebProxy(); $p.Credentials = [System.Net.CredentialCache]::DefaultCredentials; $c.proxy = $p ; $c.DownloadString("http://psget.net/GetPsGet.ps1") | iex
@mohitt
mohitt / Robocopy
Last active August 29, 2015 14:15
RoboCopyBackup
Robocopy M:\ D:\M-Drive /E /z /256 /move /r:3 /w:5 /v /eta /fp /log+:C:\M-driveCopyLog.log
Robocopy C:\ D:\C-Drive /E /z /256 /move /r:1 /w:1 /v /eta /fp /log+:M:\C-driveCopyLog.log /xa:S /XD "C:\Program Files" "C:\Windows" "C:\Documents and Settings" "C:\Program Files (x86)" "C:\ProgramData" "C:\Intel" "C:\logs" "C:\MSOCache" "C:\Nuget" "C:\cygwin64" "C:\Users\mohit_thakral\AppData"
Robocopy C:\Users\mohit_thakral D:\C-Drive\Users\mohit_thakral /E /z /256 /move /r:1 /w:1 /v /eta /fp /log+:M:\C-driveCopyLog.log /xa:S /XD "C:\Program Files" "C:\Windows" "C:\Documents and Settings" "C:\Program Files (x86)" "C:\ProgramData" "C:\Intel" "C:\logs" "C:\MSOCache" "C:\Nuget" "C:\cygwin64" "C:\Users\mohit_thakral\AppData"
# This is with git v1.9.4, make sure to put "C:\Program Files\Perforce" in path
git config --global merge.tool p4merge
git config --global diff.tool p4merge
git config --global --add difftool.prompt false
git config --global --add mergetool.prompt false
@mohitt
mohitt / create_mysql_db
Last active December 15, 2015 12:28
Create a Mysql db with user and grant permissions, replace ##DBNAME## with database name and ##DBUSER## with username and ##DBPASSWORD## with new user password
CREATE DATABASE IF NOT EXISTS ##DBNAME##;
GRANT ALL on ##DBNAME##.* to '##DBUSER##'@'%' identified by '##DBPASSWORD##';
GRANT ALL on ##DBNAME##.* to '##DBUSER##'@'localhost' identified by '##DBPASSWORD##';
USE ##DBNAME##;