Skip to content

Instantly share code, notes, and snippets.

View Nivratti's full-sized avatar

Nivratti Boyane Nivratti

View GitHub Profile
@Nivratti
Nivratti / directory-structure-deep-learning
Last active April 10, 2025 08:46
Directory structure for deep learning projects
project_name/
├── data/ # All data-related directories and files
│ ├── raw/ # Original, immutable data dump
│ ├── processed/ # Data transformed for modeling, such as TFRecords or HDF5
│ ├── interim/ # Temporary processed datasets, possibly smaller or for prototyping
├── docs/ # Project documentation
│ ├── api/ # API reference
│ ├── design_docs/ # Design documents, architectural choices
@Nivratti
Nivratti / timer.py
Last active August 1, 2021 10:50
Python timer class
# timer.py
"""
Usage:
>>> from timer import Timer
>>> t = Timer() ## or for logger: t = Timer(logger=logger.info)
>>> t.start()
>>> t.stop() # A few seconds later
Elapsed time: 3.8191 seconds
"""
@Nivratti
Nivratti / ssh_password_auth.md
Created July 4, 2021 12:40
force ssh client to use only password auth

For people receiving the Permission denied (publickey) error despite the other solutions here, the problem is likely that the server is set not to accept passwords. To change this, you need to get into the server (many services will allow you to access with a password via a virtual console on their management console) and:

  1. nano /etc/ssh/sshd_config

  2. Find PasswordAuthentication no and change it to yes, and uncomment it.

  3. Run sudo service sshd restart (or sudo systemctl restart sshd if using systemd services)

  4. Now try to log in, from a remote server, using one of the methods, such as ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected] or ssh user:@host_ip colon after username.

@Nivratti
Nivratti / prevent-colab-random-disconnects.md
Last active June 25, 2021 10:40
Prevent Google Colab random disconnects

Run the following code in the console and it will prevent you from disconnecting.

  1. Ctrl+ Shift + i to open inspector view .
  2. Then go to console.
  3. Paste this below and press enter.
var startClickConnect = function startClickConnect(){
 var clickConnect = function clickConnect(){

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz

Unzip, Bootstrap and Install

tar -xzf boost_1_71_0.*
@Nivratti
Nivratti / xrdp-setup.md
Last active February 13, 2022 07:32
Setup Remote Desktop (RDP) on Ubuntu 18.04

How to Install Xrdp Server (Remote Desktop) on Ubuntu 18.04

  1. Install Xfce package:
sudo apt update
sudo apt install -y xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
  1. Installing Xrdp:
@Nivratti
Nivratti / postgres_manager.py
Created December 17, 2019 09:06 — forked from valferon/postgres_manager.py
Python script to take care of postgres backup and restore of data
#!/usr/bin/python3
import argparse
import logging
import subprocess
import os
import tempfile
from tempfile import mkstemp
import configparser
import gzip