Skip to content

Instantly share code, notes, and snippets.

View adityaiitb's full-sized avatar

Aditya Agrawal adityaiitb

View GitHub Profile
@adityaiitb
adityaiitb / svg.md
Last active July 25, 2020 22:39
Convert svg to png without loss of resolution

Use rsvg

rsvg -w 1024 -h 1024 infile.svg outfile.png
@adityaiitb
adityaiitb / convert.md
Created July 25, 2020 22:40
Examples of the linux convert command
convert -rotate 90 -flatten -density 100 *.ps *.png
@adityaiitb
adityaiitb / zip.md
Created July 25, 2020 22:42
Examples of the zip command

To zip directory foo but exclude sub directories bar and baz.

zip -r myarchive.zip foo -x "foo/bar/*" "foo/baz/*"
@adityaiitb
adityaiitb / keytool.md
Last active July 25, 2020 22:48
Examples of the keytool command

To list the contents of a keystore file

keytool -list -keystore .keystore

To list the contents of a specific alias

keytool -list -keystore .keystore -alias foo
@adityaiitb
adityaiitb / color.md
Created July 25, 2020 22:50
Colors by name, hex code and RGB value
@adityaiitb
adityaiitb / cpp.md
Last active July 25, 2020 22:52
C Preprocessor commands
cpp -C -P -I <path> input_file

-C to preserve comments, -P to remove line markers, -I to include a directory path to search

@adityaiitb
adityaiitb / driver_cuda_version.md
Created July 25, 2020 23:19
Nvidia driver and cuda version

To find GPU driver version

nvidia-smi
cat /proc/driver/nvidia/version
modinfo nvidia | grep version

To find CUDA version

nvcc -V
@adityaiitb
adityaiitb / composer.md
Last active July 25, 2020 23:22 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
cd ~
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo ln -s /usr/local/bin/composer /usr/bin/composer

then you can run

sudo composer install
@adityaiitb
adityaiitb / php.md
Created July 25, 2020 23:24
PHP commands

Start a php server locally (in the directory you want)

php -S localhost:8888 &
@adityaiitb
adityaiitb / nsys.md
Last active July 25, 2020 23:25
Nvidia Nsight systems commands
nsys profile \
	-f true \
	-o bert_phase2 \
	-s none \
	--export sqlite bash scripts/run_pretraining.sh