Skip to content

Instantly share code, notes, and snippets.

View noelmathewisaac's full-sized avatar
🎯
Focusing

Noel Mathew Isaac noelmathewisaac

🎯
Focusing
View GitHub Profile
@noelmathewisaac
noelmathewisaac / python-commands.md
Last active December 17, 2022 14:24
Python Virtual Environment Commands

#Python Commands

Python Virtual Environment on Linux

  1. Create the virtual environment. (The required python version can be specified)
    python3.8 -m venv venv-name
  2. Activate the enviroment
    source venv-name/bin/activate

Importing files from folder in parent directory

@noelmathewisaac
noelmathewisaac / soc-print.sh
Created August 18, 2022 16:48
SOC Sunfire Print Commands
# Credits: https://gist.github.com/AaronCQL/3ee6bbb1999402b558c942eb8f50cf29#file-sunfire-print-sh
# Login to Sunfire
ssh noel@sunfire.comp.nus.edu.sg
# Copy a local file to Sunfire
scp some_file.txt e0123456@sunfire.comp.nus.edu.sg:/home/e/e0123456/
scp some_file.txt noel@sunfire.comp.nus.edu.sg:/home/n/noel/ # Try with username if above line doesn't work
# Copy a local directory to Sunfire
@noelmathewisaac
noelmathewisaac / docker-commands.md
Last active January 28, 2024 16:29
Docker Commands

Dockerfile

COPY

  • COPY is used to copy contents from the local directory to the container.
  • This is necessary as without it the container will not have any files. Files in .dockerignore are not copied
  • Copy everything to the home container directory: COPY . .

WORKDIR

  • WORKDIR is similar to cd and is used to change the working directory inside the container.
@noelmathewisaac
noelmathewisaac / useful-commands.md
Last active June 6, 2021 17:08
Useful Commands

Download a file from a shared Google Drive link

Replace the id with the id of the file to be downloaded

!wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1SCh8gSoyvrJ7N9OwlRcWc65zo1qf6SAy' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1SCh8gSoyvrJ7N9OwlRcWc65zo1qf6SAy" -O zipfile.zip && rm -rf /tmp/cookies.txt
@noelmathewisaac
noelmathewisaac / git-commands.md
Last active April 12, 2022 04:28
Git Commands

Git Commands

Reference for some common git commands

Initial Commit

  1. Initialise a new repo (only done once at the beginning of the project)
    git init
  2. Stage changes
    git add .
  3. Commit changes
    git commit -m "Initial commit"
@noelmathewisaac
noelmathewisaac / offenders.py
Last active May 24, 2021 12:10
A wedding is being held in a huge conference hall attended by a massive number of people. The organiser has given you a list of people with their location in the conference hall at a certain snapshot. Your task is to find out, in that snapshot, who in that list has disobeyed social distancing measure and mingled with more than 8 people within a …
from typing import List, Tuple
import random
# Question: A wedding is being held in a huge conference hall attended by a massive number of people. The organiser has given you a list of people with their location in the conference hall at a certain snapshot. Your task is to find out, in that snapshot, who in that list has disobeyed social distancing measure and mingled with more than 8 people within a 2-metre radius.
class Person:
"""
Class represeting a person
...
@noelmathewisaac
noelmathewisaac / Movie_Document.json
Last active December 15, 2020 12:15
The data scraped for a single movie showing from Shaw Theatres (GitHub Repo: https://github.com/PopcornData/popcorn-data-website)
{
"theatre":"Nex",
"hall":"nex Hall 5",
"movie":"Jumanji: The Next Level",
"date":"18 Jan 2020",
"time":"1:00 PM+",
"session_code":"P00000000000000000200104",
"seats":[
{
"seat_status":"AV",
{
"basics":{
"name":"Noel Mathew Isaac",
"label":"Student",
"image":"https://avatars0.githubusercontent.com/u/42365024?v=4",
"email":"noelmathewisaac@gmail.com",
"phone":"",
"url":null,
"summary":"I enjoy using tech to automate stuff and solve real-world problems. I am passionate about Machine Learning and Cybersecurity and regularly take part in hackathons to learn new skills. When I am away from my 'techie' side I am usually engrossed in learning about investing and playing chess.",
"profiles":[