This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
PhonePe mails a PDF wih name PhonePe_Transaction_Statement.pdf. Open, Copy-all | |
and paste it into a text file. | |
Now call the script with input files listed out or with shell wildcards. | |
python %s PhonePe_Text_File_1.txt PhonePe_Text_File_2.txt ... | |
For each input file, a corresponding .psv file will be created. The content of these | |
have the following format. | |
ts|payee|txnid|utr|source|kind|currency|amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### this has some bugs w.r.t statement wrapping on long amounts, credits, HH24 etc. Use pure Python3 version below instead. | |
### https://gist.github.com/vsbabu/37275c9e45b8a496ed987e801950991a | |
#### retaining this for memory and not for use | |
############### DEPRECATED ################################## | |
# You need gnu awk and standard unix text tools | |
# PhonePe mails a PDF wih name PhonePe_Transaction_Statement.pdf. Open, Copy-all and paste it into a text file PhonePe_Transaction_Statement.txt | |
# If you are doing this in Windows, convert line endings first by running | |
# dos2unix PhonePe_Transaction_Statement.txt | |
# Output of the script is a pipe separated file | |
# timestamp|payee|txnid|utr|source|amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is how I got Leo Outliner (https://leo-editor.github.io/leo-editor/) installed and usable in Windows 11, with dependencies. | |
### Step 1 - Anaconda | |
# install anaconda from https://www.anaconda.com/download | |
# Start -> Anaconda Powershell prompt | |
### Step 2 - get Leo | |
# get leo git repository into apps/leo-editor home directory | |
# if you don't have git, download from URL below as zip and extract | |
cd $HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in "$@" | |
do | |
inp="$f" | |
oup=`echo "$inp".gpg` | |
gpg -e -r "CHANGE_MY_KEY_NAME" "$inp" | |
echo "$inp -> $oup" | |
done | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~/code | |
for d in `find . -type d -name '.git' -exec dirname {} \;`; | |
do | |
cd $d && pwd | |
git fetch --all && git pull && git gc | |
cd - | |
done | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Pure python3 implementation to merge two csv files. Useful for getting incremental data | |
and updating existing large file. | |
Arguments: | |
Mandatory: | |
old file | |
new file | |
field separator: default is ,. Quoting is not handled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################### | |
# | |
# 1. adjust MAXQ and MAXFS below. | |
# 2. Adjust process inside process_one_file.sh | |
# here is an example file to simulate sleep and a CPU intensive processing | |
# #!/bin/bash | |
# sleep $[ ( $RANDOM % 10 ) + 1 ]s | |
# bzip2 $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAIL_PARTBOUNDARY="`tr -dc A-Za-z0-9 </dev/urandom | head -c 16`" | |
/usr/sbin/sendmail -t <<EOF | |
From: ${MAIL_FROM} | |
To: ${MAIL_TO} | |
Cc: ${MAIL_CC} | |
Subject: ${MAIL_SUBJECT} | |
Content-Type:multipart/mixed; boundary="${MAIL_PARTBOUNDARY}" | |
--${MAIL_PARTBOUNDARY} | |
Content-Type: text/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import numpy as np | |
import datetime as dt | |
import sys | |
HOLIDAYS = [ | |
"2020-01-01", | |
"2020-02-21", | |
"2020-04-10", | |
"2020-05-01", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This assumes it is being run inside tmux | |
# Demo is at https://youtu.be/Kc7wJkg1mlI | |
NOTETHIS() { | |
#tmux send-keys -t .1 C-z 'clear && git log --graph --decorate --date=relative --oneline --all' Enter | |
set +x | |
tmux send-keys -t .2 'R' | |
#tmux send-keys -t .1 C-z 'clear && git viz' Enter | |
tmux send-keys -t .0 C-z "clear && toilet -f wideterm $@ --gay" Enter | |
echo ">>> $@" |
NewerOlder