Skip to content

Instantly share code, notes, and snippets.

View suchoudh's full-sized avatar
💭
Applying Technology to real world problems.

Sunil Choudhary suchoudh

💭
Applying Technology to real world problems.
View GitHub Profile
@suchoudh
suchoudh / decimalsPercentageCalculation.sh
Created April 27, 2024 09:34
time left % calculation
echo Predicted is $PREDICTED
COUNTER=0
PREDICTED=$1
PREDICTED="${PREDICTED:=12}"
TEST="$(($PREDICTED*60))"
while true
do
echo test is $TEST
COUNTER=$((COUNTER+1))
@suchoudh
suchoudh / main.rs
Created April 4, 2024 07:22 — forked from antuneza/main.rs
One Billion Row Challenge, Part I: The Basics
use std::collections::{BTreeMap};
use std::fs::File;
use std::io::{self, BufRead, Read, Seek, SeekFrom};
use std::ops::AddAssign;
use fnv::FnvHashMap;
#[derive(Debug, Clone, Copy)]
struct TemperatureStats {
min: f32,
max: f32,
@suchoudh
suchoudh / gist:cb038052e94924c00b8c717924a73a3b
Created May 29, 2023 07:51
add prefix or suffix to all files in a folder (including folders)
ls | xargs -I {} mv {} PRE_{}
ls | xargs -I {} mv {} {}_SUF
# can use filering with ls in $0
@suchoudh
suchoudh / gist:7527cb15336b4799f2b839fcdbaa5b41
Created February 27, 2023 05:28
usings options in a bash script for BoD and EoD processes
#!/bin/bash
usage() { echo "$0 usage:" && grep " .)\ #" $0; exit 0; }
[ $# -eq 0 ] && usage
while getopts ":hs:b:e:" arg; do
case $arg in
b) # Specify b value.
echo "runningBoD is ${OPTARG}"
./BoD.sh
;;
e) # Specify e value.
@suchoudh
suchoudh / taskcontext.sh
Last active July 21, 2022 07:18
readme_context.md
for context in Personal InterfaceWith Healthify HP FP EnjoyBy Delegated2 DailyDo DRAMAL ; do tc $context; tp > readme_$context.md; tt>readme_$context.md; ts >> readme_$context.md; tcn; echo $context; done
@suchoudh
suchoudh / Setup.md
Created February 7, 2022 06:23 — forked from looselytyped/Setup.md
Containers in 3 weeks - Set up

Containers in 3 weeks — Week 1/2 setup

Installation

You will need Docker installed! Here is a link to get you started. Proceed after you are done installing.

Warm up your engines!

ls | sort | awk '{ print "alias " $0"=cd $HBox/"$0";cat readme*.md"}'
alias Upskillin=cd $HBox/Upskillin;cat readme*.md
alias UrgentlyGet=cd $HBox/UrgentlyGet;cat readme*.md
alias Whatis=cd $HBox/Whatis;cat readme*.md
alias WorkingWith=cd $HBox/WorkingWith;cat readme*.md
@suchoudh
suchoudh / ebert_amazon.py
Created June 10, 2020 04:39 — forked from linstantnoodles/ebert_amazon.py
Get amazon prime information on Roger Ebert Great Movies
import requests
import csv
import os
import json
import re
from bs4 import BeautifulSoup
import mechanize
from random import choice
user_agents = ['Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Debian/1.6-7','Konqueror/3.0-rc4; (Konqueror/3.0-rc4; i686 Linux;;datecode)','Opera/9.52 (X11; Linux i686; U; en)']
random_user_agent = choice(user_agents)
@suchoudh
suchoudh / recursive_actions.sh
Created June 5, 2020 11:51
find and replace recursively in direcoty
74 Script done on 2020-06-04 12:57:09+0530
75 find . -name *.txt -not -path '*/\.*' -print0 | xargs -0 -exec l s -la {} +
76 find . -name *.txt -not -path '*/\.*' -print0 | xargs -0 sed -i 's/#/~/g'
77
78 -exec rename _dbg.txt .txt '{}' \;
79
80
81
82 Find txt files and rename them to be md
83