Skip to content

Instantly share code, notes, and snippets.

Understanding Binary Numbers

Before diving into signed and unsigned representations, it's essential to grasp the basics of binary numbers. Binary is a base-2 numeral system, meaning it only uses two digits: 0 and 1. Each digit in a binary number is called a bit. In a 4-bit binary number, there are four positions, each representing a power of 2, starting from the right (which is (2^0)).

Example of a 4-bit binary number:

1 0 1 1

Calculating its decimal equivalent: [

@prateekrajgautam
prateekrajgautam / uninstall remove nix from wsl.md
Last active February 6, 2025 07:57
Commands to uninstall nix

uninstall remove nix from wsl

 sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
 sudo mv /etc/profile.d/nix.sh.backup-before-nix /etc/profile.d/nix.sh
 sudo mv /etc/bashrc.backup-before-nix /etc/barhrc
 sudo mv /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc
 sudo rm -rf /nix
@prateekrajgautam
prateekrajgautam / How to use Jupterlab with tensorflow.md
Last active February 26, 2024 11:38
How to use jupyterlab on CAS server instead of googlecolab

First login to server

  • Linux users: Use any linux terminal
  • Windows users: install mobaterm
ssh -X -L 8888:127.0.0.1:8888 [email protected]
@prateekrajgautam
prateekrajgautam / How to create a docker container and connect to jupyterlab.md
Last active February 6, 2024 05:36
Steps to connect to docker server using tailscale

You need a bash terminal of linu or windown users need to install git bash

after installation rightclick and select git bash here Now you have bash on windows

ssh in to server with

# define server IP
@prateekrajgautam
prateekrajgautam / AI Lab Updates.md
Last active February 24, 2024 08:49
Required AI Lab Update

Graphical or CLI

Identify the current target sudo systemctl get-default The result will likely display either the multi-user.target or graphical.target.

@prateekrajgautam
prateekrajgautam / Guide: Cloudflare Tunnel with Nginx Proxy Manager.md
Last active March 5, 2025 23:26
Guide: Cloudflare Tunnel with Nginx Proxy Manager

Thought I should post my guide on how to do this, as I've struggled with this for quite some time now. I wanted something to bypass the NAT/router as I did not have the option of port-forwarding. I will also be moving quite some in the upcoming year, so dynamic IP was almost a given. And obviously I wanted it to be cheap. This does it all.

This is free, no port-forwarding required and no static IP required. Wildcard domain and SSL certificate supported. It works with Cloudflare tunnels, Cloudflare DNS, Nginx Proxy Manager and obviously TrueNAS SCALE.

I am not a professional, if you see a flaw in this design, please let me know!

Requirements:

  • Domain name at Cloudflare
@prateekrajgautam
prateekrajgautam / cloudflared zero trust tunnel and ssh.md
Last active January 27, 2024 07:50
cloudflared zerotrust tunnel and ssh

cloudflared zero trust tunnel and ssh

SSH conncetion over cloudflared tunnel

create tunnel on cloudflare dashboard zero trust >> access >> tunnels

|subdomain|ssh| |domain|example.com|

@prateekrajgautam
prateekrajgautam / default.md
Last active January 27, 2024 07:56
nix-shell for python eel

default.nix

nix-shell for python eel

with import <nixpkgs> { };

mkShell {
    name = "pybids-dev-env";
    
    buildInputs = with python3Packages; [
        python3
@prateekrajgautam
prateekrajgautam / syntax-patterns.txt
Created October 2, 2023 14:07
Texworks Darkmode color config
# location ~/.TeXworks/configuration/syntax-patterns.txt
# TeXworks: Patterns for syntax coloring
# Each entry consists of three whitespace-separated fields:
# <style> <spell?> <regex>
# <style> is a combination of color and style flags
# Valid syntax:
# <fgcolor>
# <fgcolor>/<bgcolor>