Skip to content

Instantly share code, notes, and snippets.

@tabrez
tabrez / cloud-config.yml
Created August 8, 2023 13:08
cloud init config file to setup a workstation vm
#cloud-config
packages:
- ansible
users:
- default
- name: tabrez
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_import_id:
- gh:tabrez
@tabrez
tabrez / .vimrc
Last active August 5, 2023 04:08
minimal vim config
"
" A (not so) minimal vimrc.
"
" You want Vim, not vi. When Vim finds a vimrc, 'nocompatible' is set anyway.
" We set it explicitely to make our position clear!
set nocompatible
filetype plugin indent on " Load plugins according to detected filetype.
@tabrez
tabrez / install_roles.sh
Created August 1, 2023 13:27
Bash script that allows picking what roles to install on a machine using ansible
#!/bin/bash
# Define an array of roles
roles=(
"ansible",
"copy-private-ssh-key",
"copy-public-ssh-key",
"password-less-sudo",
"ssh-config",
"config-local",
@tabrez
tabrez / playbook.yml
Created August 1, 2023 13:25
Playbook to setup a headless Ubuntu VM
---
- name: setup command line utilities in ubuntu vm(tested 22.04 & 22.10)
hosts: all
become: true
gather_facts: false
vars:
user: tabrez
home: "/home/{{ user }}"
vars_files:
@tabrez
tabrez / Dockerfile
Last active July 29, 2023 09:17
Dockerfile to build Jupyter Lab container with fastai support
ARG OWNER=tabrez
ARG BASE_CONTAINER=jupyter/base-notebook
FROM $BASE_CONTAINER
LABEL maintainer="Tabrez Iqbal <tabrez@mailbox.org>"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
@tabrez
tabrez / git_google_colab.txt
Last active July 27, 2023 10:53
work with Github repositories in Google Colab
# first cell: mount google drive folder on currect virtual machine of google colab
from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)
%cd /content/gdrive/MyDrive/Colab Notebooks
!pwd && ls
# upload your private ssh key as id_ed25519 from left sidebar to 'Colab Notebooks' folder
# or modify below code to provide it in another way
# second cell: need to run on every new Google Colab session before interacting with Github
!mkdir -p /root/.ssh

minimal linux box on windows

Install multipass on windows

Help

setup using cloudinit.yaml:

#cloud-config
@tabrez
tabrez / id_rsa.pub
Created November 28, 2022 13:18
tabrez public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTR8xPD+LB3PajsMmKcJFH/1m7byXOdH1skB8EmgnlaHdh9kyg6/XnsB/JzCzn1LtwKfzxHIz7kIKlB4IaHQHP/OYq76ZesSyyUlRgBw94//7Oq/Xmjun2+HWorMbIxzlswsrlnp/JumERqJqrhWz5rxG4Ex20gqbIJn87dy/gBpK12QiVyZkKToB694K8reL+vLDyhayw5Wgpdl/gjmtD9vT8K+gzSkbSEyL+IFFD/gb2MZqR43/uRDPi6JQyCuLuJtfIuHsC4B9kY7+B2MsSl+tzOqmADBYsOS+V1sJNTqPKrioM5OFwj0lphAwtXtgdsZdU05MK4bZlBp/l/oR3 tabrez.iqbal@gmail.com
@tabrez
tabrez / .bashrc
Last active October 29, 2022 05:57
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Control bash history
# http://www.biostat.jhsph.edu/~afisher/ComputingClub/webfiles/KasperHansenPres/IntermediateUnix.pdf
# https://unix.stackexchange.com/questions/48713/how-can-i-remove-duplicates-in-my-bash-history-preserving-order
# don't put duplicate lines or lines starting with space in the history.