Skip to content

Instantly share code, notes, and snippets.

View yashkumaratri's full-sized avatar
☂️
:)

Yash Kumar Atri yashkumaratri

☂️
:)
View GitHub Profile
@yashkumaratri
yashkumaratri / git-lfs-install.md
Created August 12, 2024 02:12 — forked from pourmand1376/git-lfs-install.md
Single User Installation of Git-LFS without sudo

I wanted to install GIT-Lfs on my user account without access to server root account. I write this to my future self.

  1. Download tar.gz file from git-lfs website.
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz

2.Untar it

tar xvf git-lfs-linux-amd64-v3.2.0.tar.gz
@yashkumaratri
yashkumaratri / repaire-damaged-ext-drive.sh
Created July 5, 2024 15:21 — forked from kabacs/repaire-damaged-ext-drive.sh
Repairing damaged external drive (flash drive) on OS X
# If "Disk Utility" can't erase a demaged disk and throw errors, like these:
# a) "-69888: Couldn't unmount disk";
# b) "Couldn't modify partition map".
# You can repair disk (if it is damaged partially, just by a program error, while changing partition map of a disk in) by
# FULL ERASING OF A DISK - you can do that ONLY in A COMMAND LINE, using "diskutil" command (on OS X)
# 1. Firstly you must get path of a drive in a system, like this:
diskutil list
# Than complete erasing of a disk:
diskutil eraseDisk free EMPTY /dev/disk4
@yashkumaratri
yashkumaratri / BSNL_DND
Created August 4, 2021 16:27
BSNL DND (Do Not Disturb) Activation and Deactivation
https://www.ucc-bsnl.co.in/
@yashkumaratri
yashkumaratri / mount_hdd.txt
Last active March 9, 2021 07:10
mount drive via terminal in ubuntu
sudo lshw -C disk
sudo mkfs.ext4 /dev/sdb1
sudo mkdir /mnt/hdd1
sudo mount /dev/sde /mnt/hdd1
sudo chmod -R 777 /mnt/hdd1/
@yashkumaratri
yashkumaratri / tmux-cheatsheet.markdown
Created February 8, 2021 12:32 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yashkumaratri
yashkumaratri / runner.pl
Created November 1, 2020 12:50
Reading a csv file of city distance in prolog.
Assuming the CSV looks something like :
"Distance","E","G","C","B"
"A","3","5","7","3"
"B","4","5","6","0"
"C","4","1","0","6"
"D","5","8","3","6"
Code:
@yashkumaratri
yashkumaratri / pdfminer_run.py
Created August 16, 2020 16:54
PDFMINER no spaces between words
#https://stackoverflow.com/questions/49457443/python-pdfminer-converts-pdf-file-into-one-chunk-of-string-with-no-spaces-betwee
#
#According to this thread some pdfs mark the entire text as figure and by default PDFMiner doesn't try to perform layout analysis for figure text. To override this behavior the all_texts parameter needs to be set to True.
#
import io
import pdfminer
from pdfminer.converter import TextConverter
def make_heatmap(text, values, save=None, polarity=1):
cell_height=.325
cell_width=.15
n_limit = 74
text = list(map(lambda x: x.replace('\n', '\\n'), text))
num_chars = len(text)
total_chars = math.ceil(num_chars/float(n_limit))*n_limit
mask = np.array([0]*num_chars + [1]*(total_chars-num_chars))
text = np.array(text+[' ']*(total_chars-num_chars))
values = np.array(values+[0]*(total_chars-num_chars))
@yashkumaratri
yashkumaratri / wget_gdrive.sh
Created May 20, 2020 15:28
Download google drive files by wget
For small files
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ' -O transformer_semeval.clf
For large files
wget --load-cookies cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1rC6LWGNkHaZkuojCEWDqSKcDGwFMBTYZ" -O transformer_semeval.clf
Learning Structured Representation for Text Classification
via Reinforcement Learning
https://github.com/keavil/AAAI18-code