Skip to content

Instantly share code, notes, and snippets.

@nashid
nashid / PBS_sample.sh
Created January 10, 2022 22:53 — forked from mathsam/PBS_sample.sh
Sample PBS script
# Sample PBS job script
#
# Copy this script, customize it and then submit it with the ``qsub''
# command. For example:
#
# cp pbs-template.sh myjob-pbs.sh
# {emacs|vi} myjob-pbs.sh
# qsub myjob-pbs.sh
#
# PBS directives are fully documented in the ``qsub'' man page. Directives
@nashid
nashid / git-lfs
Last active January 22, 2022 22:11
```
brew install git-lfs
git lfs install
git lfs track "*.png"
git lfs track path/to/some/folders/*
```
Make sure you commit the .gitattributes file.
git add .gitattributes && git commit -m "Add Git LFS attribute dot file" && git push
@nashid
nashid / check-gpu-usage.md
Last active February 11, 2022 00:12
How to check GPU usage
  • Check GPU usage every 5s: watch -n5 nvidia-smi
Every 5.0s: nvidia-smi                                                                                                                                                                                                      Thu Feb 10 16:12:32 2022

Thu Feb 10 16:12:32 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
@nashid
nashid / punctuation.js
Created February 21, 2022 23:48 — forked from davidjrice/punctuation.js
List of punctuation characters
var PUNCTUATION = "" +
"’'" + // apostrophe
"()[]{}<>" + // brackets
":" + // colon
"," + // comma
"‒–—―" + // dashes
"…" + // ellipsis
"!" + // exclamation mark
"." + // full stop/period
"«»" + // guillemets
@nashid
nashid / awk.md
Last active March 10, 2022 01:47
awk shortcuts

Print without the first elemenet:

grep "type" * | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' | grep "\"type\""
@nashid
nashid / gist:5dbac9896e5c5c212c561659a4cfa010
Created March 11, 2022 07:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nashid
nashid / dgl-transformer.py
Created March 12, 2022 00:50 — forked from yzh119/dgl-transformer.py
Efficient Sparse Transformer implementation with DGL's builtin operators
import dgl
import dgl.ops as ops
import numpy as np
import torch as th
import torch.nn as nn
class FFN(nn.Module):
def __init__(self, d_feat, d_ffn, dropout=0.1):
super().__init__()
self.linear_0 = nn.Linear(d_feat, d_ffn)
@nashid
nashid / dgl-transformer.py
Created March 12, 2022 00:50 — forked from yzh119/dgl-transformer.py
Efficient Sparse Transformer implementation with DGL's builtin operators
import dgl
import dgl.ops as ops
import numpy as np
import torch as th
import torch.nn as nn
class FFN(nn.Module):
def __init__(self, d_feat, d_ffn, dropout=0.1):
super().__init__()
self.linear_0 = nn.Linear(d_feat, d_ffn)
@nashid
nashid / directory-stats.sh
Last active March 27, 2022 06:25
directory stats related command
#! /bin/bash
directory=./no_string_change_data_36k
total_size=$(du -h "${directory}" | awk '{print $1}')
echo "DIR SIZE (TOTAL): $total_size"
echo "===================================="
echo "===================================="
echo "LARGEST 10 files:"
du -a "${directory}" | sort -n -r | head -n 10