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 / test.java
Last active August 11, 2022 16:51
Recursive count of all files with differnt extensions
296 .o
322 .xls
352 .sample
357 .cpp
366 .gif
391 .jar
462 .a
632 .txt
673 .json
832 .js

Keybase proof

I hereby claim:

  • I am suchoudh on github.
  • I am suchoudh (https://keybase.io/suchoudh) on keybase.
  • I have a public key whose fingerprint is CDA9 249A 9E45 E33B A392 7B3A 2226 EE91 5B2F 3CA0

To claim this, I am signing this object:

find . -type d -exec touch {}/"${DT}.txt" \;
$DT is variable you have already defined.. my case Date and time
## Does not work for large folder may be taking up softlinks not helpful for me.
This one is more controlled.
for f in *; do if [ -d ${f} ]; then touch $f/_myProgress_$f.txt; fi; done
@suchoudh
suchoudh / pdf2images
Created March 30, 2020 07:44
remove spaces in filenames
for filename in *.pdf ; do pdftoppm -jpeg $filename Social$filename; done
@suchoudh
suchoudh / mv.sh
Created April 14, 2020 03:30 — forked from premek/mv.sh
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
function mv() {
if [ "$#" -ne 1 ]; then
command mv "$@"
return
ls * | sort -t . -k 2
t is for separator
k 2 is for sort by second field.
@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
@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)
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 / 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!