Skip to content

Instantly share code, notes, and snippets.

View robinmollah's full-sized avatar
🏠
Working from home

Robin Mollah robinmollah

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am robinmollah on github.
  • I am robinmollah (https://keybase.io/robinmollah) on keybase.
  • I have a public key ASBMh18Xlr2QspJB-8x4hK_EJKrEOmNoRML1h-tnIvo6Ugo

To claim this, I am signing this object:

@robinmollah
robinmollah / call-her.sh
Created May 28, 2022 01:55
Call a target number and put it in loud speaker
for i in {1..1000}
do
adb shell input tap 235 1066
adb shell input tap 927 1098
sleep 30s
done
@robinmollah
robinmollah / path-of-process.js
Last active November 30, 2021 22:33
Prints path of name of process
const { exec, spawn } = require('child_process');
function getProcessPath(process_name){
exec(`powershell "Get-Process ${process_name} | Format-List Path"`, (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
let paths = convertToArray(stdout);
console.log(paths);
@robinmollah
robinmollah / find-subfolder.js
Created September 23, 2021 18:23
Looks for `searchQuery` subdirectory in `folder`
const fs = require("fs");
const path = require("path");
function findFolder(folder, searchQuery) {
if (!fs.existsSync(folder)) {
console.error("dir not found ", folder);
return;
}
let subdirs = fs
@robinmollah
robinmollah / last-modified.js
Created September 19, 2021 20:34
Sort files by last modified date
const fs = require("fs");
function lastModifiedFiles(dir) {
fs.readdir(dir, (err, files) => {
if (err) {
console.error(err);
return;
}
console.log(files);
let tmpFiles = files
/*
* In this video, you will be able to see the code that automates calculation of selected text
* https://www.linkedin.com/posts/robinmollah_scriptwriting-javascript-productivity-activity-6785840697766498304-asBl
/*
function run(input, parameters) {
if(input.length == 0) input.push("robin +11tk\\nrobin +11tk");
let output = input[0].split("\n");
let sum = 0;
for(let line of output){
@robinmollah
robinmollah / aws-search-instance-id.sh
Created June 23, 2021 07:56
Searching for a region of an instance id
# Add executable permission to run it using "chmod +x aws-search-instance-id.sh"
# Example usage ./aws-search-instance-id.sh i-xxxxxxxxxx
regions="ap-southeast-2 us-west-2 us-west-1 us-east-1 us-east-2 ap-east-1 ap-southeast-1 ap-northeast-2 ap-northeast-3 ap-northeast-1 ca-central-1 eu-west-2 af-south-1 eu-central-1 eu-west-1 me-south-1 eu-south-1 eu-west-2 eu-west-3 eu-north-1 sa-east-1"
for region in $regions
do
echo "Checking: " $region
aws ec2 describe-instances --instance-ids $1 --region $region --output table
done