Skip to content

Instantly share code, notes, and snippets.

View poojithansl's full-sized avatar
🎯
Focusing

Poojitha Nandigam poojithansl

🎯
Focusing
View GitHub Profile
@poojithansl
poojithansl / populate_meetup.py
Created October 17, 2017 15:53
Seed script for systers_portal meetup application
"""
This script can be used to populate seed content for systers portal.
The file goes into systers_portal/meetup/management/commands/populate_meetups.py
To run after copying, use:
python manage.py populate_meetups
"""
@poojithansl
poojithansl / data.sql
Last active January 23, 2019 12:41
Sql - StackExchange
-- Get Question Id, title and Body
select Q.Id, Q.Title, G.Body
from
Posts as G,
(select * from Posts
where ParentId is null
and Title like 'How to%' or Title like 'how to%')
as Q
where G.ParentId = Q.Id
@poojithansl
poojithansl / permissions.py
Last active February 24, 2018 16:31
Authorization on meetups
member_permissions = [
"add_meetup_rsvp",
"add_supportrequest",
"change_supportrequest",
"delete_supportrequest"
]
organizer_permissions = member_permissions + [
"add_meetup",
"change_meetup",
@poojithansl
poojithansl / dance.sh
Created March 16, 2018 14:44
Dancing in the terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@poojithansl
poojithansl / commands.sh
Last active November 1, 2020 15:46
Ada Commands
srun --account research --gres=gpu:1 --mem=64G --pty bash
srun --time 4-00:00:00 --account research --gres=gpu:1 --mem=64G --pty bash
#cpus -c cpus
srun --time 4-00:00:00 -c 40 --account research --gres=gpu:1 --pty bash
pip3 install jupyter --user
jupyter-notebook --no-browser --port 8080
ssh -N -f -R 8080:localhost:8080 poojitha@ip
#use sublime(https://stackoverflow.com/questions/37458814/how-to-open-remote-files-in-sublime-text-3)