Wednesday, March 17, 2021

Run a job without Crontab/Cron job

 Inorder to run a script to keep on running in active window

countdown()
(
  IFS=:
  set -- $*
  secs=$(( ${1#0} * 3600 + ${2#0} * 60 + ${3#0} ))
  while [ $secs -gt 0 ]
  do
    sleep 1 &
    printf "\r%02d:%02d:%02d" $((secs/3600)) $(( (secs/60)%60)) $((secs%60))
    secs=$(( $secs - 1 ))
    wait
  done
  echo
)
while true; do nj_cc ; echo "----Sleeping----"; countdown "00:10:00" ; clear ; done

Monday, March 15, 2021

Caffeine Customization

caffeine.exe 5 -key:0E (for easy testing)
caffeine.exe 50 -key:0E (for a mandatory screen saver set at 1 minute)


Create a batch file with below content :

cd C:\njabade\Personal\Softwares\caffeine

start caffeine64.exe 50 -key:0E



 https://www.zhornsoftware.co.uk/caffeine/

Thursday, February 4, 2021

Unix Misc

How to get last created/modified 5 files from dir

=> ls -1lhtr | tail -5


How to get number of files in current dir

=> ls | wc -l


Friday, January 29, 2021

Copy file name to all directories in Current Dir

 for dir in */; do

    cp -v filename "$dir";

done


Eg :

for dir in */; do

    cp -v ColtSkuNumbers.xml "$dir";

done

Thursday, December 17, 2020

GIT

 Revert all local Repo changes

Open gitBash and then run below command
git reset --hard origin/<BRANCH_NAME>

Monday, December 14, 2020

Unix Compressed Tar

Compressed Tar with exclude dirs

 tar cvfj Middleware.tar.bz2 Middleware --exclude=Middleware/user_projects

Thursday, March 7, 2019

Admin rights


Computer > Manage > Local Users and Groups > Groups > Admin >