Skip to content

Instantly share code, notes, and snippets.

View MiteshShah's full-sized avatar
💻
Let's Automate it!

Mitesh Shah MiteshShah

💻
Let's Automate it!
View GitHub Profile
@MiteshShah
MiteshShah / tmux-cheatsheet.markdown
Created November 1, 2023 12:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@MiteshShah
MiteshShah / chrome-psat.bat
Last active October 25, 2023 10:27
chrome-psat.bat
curl -s https://gist.githubusercontent.com/MiteshShah/bbec249643dc6067ff8974602452c1d1/raw/3edb83a17fc4e72c813ff09ac70d59ba99c651c6/chrome-default.bat -o chrome-default.bat
curl -s https://gist.githubusercontent.com/MiteshShah/7a1fbbb852c35939c7d2f3ed09638bde/raw/55f293e2447e9603d21e92022efa1cd5f5738f68/chrome-3pcd.bat -o chrome-3pcd.bat
curl -s https://gist.githubusercontent.com/MiteshShah/42263b575213fc5f1563a6fcf05dec02/raw/40f8a7c4ca7cd399ca3eb5b66b53dbfa8d981b3f/chrome-default-ps.bat -o chrome-default-ps.bat
curl -s https://gist.githubusercontent.com/MiteshShah/af6058954f3240a9b2e1d489c2dfc2d6/raw/973f8f6410460f016c8d60d91c4fdc2814f9b983/chrome-3pcd-ps.bat -o chrome-3pcd-ps.bat
curl -s https://gist.githubusercontent.com/MiteshShah/444684ace368d63b28a64d3bbe7d44f1/raw/e84e7969f87c228635401ed402162d1c1d69c28c/chrome-chip.bat -o chrome-chip.bat
@MiteshShah
MiteshShah / chrome-chip.bat
Created October 25, 2023 09:28
chrome-chip.bat
:: Chrome Chip
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe"
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%"
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="150,220,150" --partitioned-cookies=true https://example.com >nul 2>&1
rmdir /s /q "%DATA_DIR%" >nul
@MiteshShah
MiteshShah / chrome-3pcd-ps.bat
Last active October 25, 2023 10:26
chrome-3pcd-ps.bat
:: Chrome 3pcd with PS Extension
:: Download PS Extension
set "ps_analysis_tool_version=v0.3.1"
cd /d %TEMP%
if not exist %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% (
mkdir %TEMP%\ps-analysis-tool-%ps_analysis_tool_version%
curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis-tool/releases/download/%ps_analysis_tool_version%/extension-%ps_analysis_tool_version%.zip
tar -xf extension-%ps_analysis_tool_version%.zip -C %TEMP%\ps-analysis-tool-%ps_analysis_tool_version%
)
@MiteshShah
MiteshShah / chrome-default-ps.bat
Last active October 25, 2023 10:26
chrome-default-ps.bat
:: Default Chrome with PS Extension
:: Download PS Extension
set "ps_analysis_tool_version=v0.3.1"
cd /d %TEMP%
if not exist %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% (
mkdir %TEMP%\ps-analysis-tool-%ps_analysis_tool_version%
curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis-tool/releases/download/%ps_analysis_tool_version%/extension-%ps_analysis_tool_version%.zip
tar -xf extension-%ps_analysis_tool_version%.zip -C %TEMP%\ps-analysis-tool-%ps_analysis_tool_version%
)
@MiteshShah
MiteshShah / chrome-3pcd.bat
Last active October 25, 2023 09:12
chrome-3pcd.bat
:: Chrome 3pcd
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe"
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%"
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="255,51,51" --test-third-party-cookie-phaseout --enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI" https://example.com >nul 2>&1
rmdir /s /q "%DATA_DIR%" >nul
:: Default Chrome
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe"
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%"
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="150,220,150" https://example.com >nul 2>&1
rmdir /s /q "%DATA_DIR%" >nul
@MiteshShah
MiteshShah / readme.md
Created June 18, 2020 09:32 — forked from troyfontaine/readme.md
Logging SFTP interactions on a Chrooted User in Ubuntu 14.04

How to setup SFTP Logging on Ubuntu 14.04 for a Chrooted User

Prerequisites: Using internal-sftp for sftp; rsyslog for logging

Step 1. Set up your chrooted directories

sudo mkdir /sftp/myshare
sudo mkdir /sftp/myothershare

Step 2. Create your groups for your chrooted users

@MiteshShah
MiteshShah / pr.md
Created January 29, 2020 06:09 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

SET GLOBAL slow_query_log = ON;
SET GLOBAL slow_query_log_file = '/var/log/mysql/mysql-slow.log';
SHOW GLOBAL VARIABLES LIKE 'slow\_%';