Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / setup-fastbook-env.sh
Last active August 11, 2023 09:44
Setup a mamba env with fastai, pytorch, cuda, jupyterlab libraries
#!/bin/bash
# tested with mamba version 1.4.2
# wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
# bash Mambaforge-$(uname)-$(uname -m).sh -b
mamba init
mamba create -n fastbook -y python=3.11.4
source activate fastbook
mamba install --yes -c conda-forge ipywidgets=8.1.0 sentencepiece=0.1.99 nbdev=2.2.10 \
@tabrez
tabrez / python-vscode.md
Last active December 9, 2023 05:36
How to configure vs code for python development
  • Download & Install VSCode for Linux

  • Create a python virtual environment using mamba or python:

    cd/mkdir <project-dir>
    python -v venv .venv
    source activate .venv/bin/activate
  • Install packages using mamba or pip after creating and activating a virtual environment:

@tabrez
tabrez / neovim_configs.md
Last active August 22, 2023 12:50
How to maintain separate neovim configs

How to maintain separate neovim configs

LunarVim

Installation

LunarVim has very little documentation but the creator of the config has many videos on how to create similar vim configurations from scratch.

LunarVim installs its config in a separate folder and doesn't conflict with any neovim config already present.

@tabrez
tabrez / services.md
Last active October 29, 2023 11:26
Paid online services

Paid online services

EMail

  • Mailbox.org
  • ProtonMail

VPN

  • Mullvad

Setup Fedora Kinoite

Install MEGAsync, Mullvad & JetBrains Mono fonts

wget https://gist.githubusercontent.com/tabrez/e70db2f45d2bb7b7ac4ece9f5997e423/raw -O setup_fedora.sh
bash setup_fedora.sh

Configure desktop

@tabrez
tabrez / setup_fedora.sh
Created November 7, 2023 14:41
Setup Fedora Kinoite 39
#!/bin/bash
wget https://mega.nz/linux/repo/Fedora_39/x86_64/megasync-Fedora_39.x86_64.rpm -O megasync.rpm
rpm-ostree install megasync.rpm
rm -rf megasync.rpm
wget --content-disposition https://mullvad.net/download/app/rpm/latest -O mullvad.rpm
rpm-ostree install mullvad.rpm
rm -f mullvad.rpm
rpm-ostree install jetbrains-mono-fonts