Skip to content

Instantly share code, notes, and snippets.

View arumoy's full-sized avatar

Arumoy Chakraborty arumoy

View GitHub Profile
@arumoy
arumoy / cut_call.ps1
Last active January 23, 2021 07:15
Make a call through ADB connected android phone from powershell
adb shell input keyevent KEYCODE_ENDCALL
@arumoy
arumoy / MailConfig.md
Created April 5, 2020 10:45
Mail.com Manual Configs
Parameter Value
Incoming (IMAP) server imap.mail.com
Port (Incoming server) 993
Incoming server requires SSL Yes (check box)
Outgoing (SMTP) server smtp.mail.com
Port (outgoing server) 587
Outgoing Server requires SSL No (uncheck)
@arumoy
arumoy / renameFoldersRegex.ps1
Created December 26, 2019 14:27
Rename folder by regex - PowerShell
Get-ChildItem -Directory -Filter "*2019" | Rename-Item -newname { $_.Name -replace "([0-9]{2})-([0-9]{2})-([0-9]{4})", "`$3`-`$2`-`$1` "}
@arumoy
arumoy / round_to_mondya.sql
Created May 27, 2019 09:25
Round any date to nearest Monday
date_sub(date(date), interval MOD(TO_DAYS(date) -2, 7) day)
@arumoy
arumoy / darkify_slack.sh
Created May 13, 2019 06:10 — forked from ryanpcmcquen/darkify_slack.sh
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
if [ "`uname -s`" = "Darwin" ]; then
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
else
SLACK_INTEROP_JS="/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js"
fi
@echo off
:processargs
SET NUMBER=%1
IF DEFINED NUMBER (
adb shell am start -a android.intent.action.CALL -d tel:%NUMBER%
) ELSE (adb shell input keyevent KEYCODE_ENDCALL)
@echo off
for /f "usebackq tokens=*" %%a in (`docker ps -aq`) do docker rm %%a
@arumoy
arumoy / clipmod.py
Created September 26, 2018 06:26
pyperclip snippet to mod clipboard text - make script shortcut and invoke
import pyperclip, re
text = pyperclip.paste()
text = re.sub(r"(\{|\})",r"\\\1",text)
pyperclip.copy(text)
@arumoy
arumoy / merge-pdf-ghostscript.md
Created August 4, 2018 09:46 — forked from brenopolanski/merge-pdf-ghostscript.md
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

import re
import os
import sys
sa = os.listdir(sys.argv[1])
def show1to5(sl):
for i in range(0, len(sl)):
try: