Giter Club home page Giter Club logo

borg-ncdu-analyzer's Introduction

Hi there ๐Ÿ‘‹

Welcome to my GitHub profile!

๐Ÿง‘โ€๐Ÿš€ About me

So I am a software developer who actively develops since 2003. Given this quite plenty of time, I managed to learn a multitude of different languages and technologies. I encourage you to browse my public projects. I hope you will find something interesting ๐Ÿค”.

I like everything related to computers (from the transistor to the cloud), but given the extreme shortage of available hours in the day, I can hardly be an expert in everything (doing my best, though!) ๐Ÿ˜ƒ. Nevertheless, I am quite good at implementing and integrating various things, from embedded, through web, mobile & desktop apps, to server-side software. I have also hands-on experience in configuring and managing servers and clouds. Also, I love automating things, both in real and virtual worlds.

On my daily basis, I use Linux with Arch Linux and OpenBox on it, optimized and customized over the years to nanoseconds ๐Ÿ™ƒ performance for the best possible work efficiency ๐Ÿ˜›.

๐Ÿ’ผ Work

I am a freelancer, who is always looking for great opportunities, especially long-term relationships. So if you have anything in mind, feel free to contact me!

๐Ÿ’ฌ Want to talk about my projects? You have something to be done?

Feel free to email me or drop a line on Skype / Discord:

๐Ÿ“ซ Me on the internet

โšก Something else?

Despite being a software developer, I really like hardware and electronics too.

I design and etch PCBs as well as write code for microcontrollers, just to force my code to do something physical actually ๐Ÿ™‚ I encourage you to check my Gallery where I posted a lot of various devices I created as hobby projects ๐Ÿ™‚.

borg-ncdu-analyzer's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

heartshare

borg-ncdu-analyzer's Issues

Crashes on files in /

I used borg-ncdu-analyzer succesfully before, but it crashes on my most recent backup (the JSON output lines are debug output from a print(line) I inserted into the code):

martin borg # python3 /home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py  ./::archive
Dumping and processing archive...
b'{"type": "d", "mode": "drwxr-xr-x", "user": "root", "group": "root", "uid": 0, "gid": 0, "path": ".", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2020-05-24T18:56:04.382781", "size": 0}\n'
b'{"type": "d", "mode": "drwx------", "user": "root", "group": "root", "uid": 0, "gid": 0, "path": "lost+found", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2011-10-24T23:20:06.000000", "size": 0}\n'
b'{"type": "-", "mode": "-rw-------", "user": "root", "group": "root", "uid": 0, "gid": 0, "path": ".bash_history", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2015-10-11T17:48:52.276437", "size": 52}\n'
Received SIGTERM
Traceback (most recent call last):
  File "/home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py", line 179, in <module>
    main()
  File "/home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py", line 143, in main
    analyzer.process_lines(read_lines_from_process(p))
  File "/home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py", line 94, in process_lines
    self._fs_cache[parent_dir].add_entry(entry)
KeyError: ''

I believe it crashes on files that were in / when the backup ran, in this case .bash_history. The parent_dir of these files is "", but as that has never been added as a directory, the code crashes here.

Won't run on Ubuntu 18.04 because Python 3.6 doesn't have dataclasses

I tried this on Ubuntu 18.04, but it won't run:

martin borg # python3 /home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py  ./::archive
Traceback (most recent call last):
  File "/home/martin/borg-ncdu-analyzer/borg_ncdu_analyzer.py", line 6, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

To get it working, I haphazardly removed the dependency:

martin@martin ~/borg-ncdu-analyzer % git diff
diff --git a/borg_ncdu_analyzer.py b/borg_ncdu_analyzer.py
old mode 100644
new mode 100755
index 034264b..2d9b049
--- a/borg_ncdu_analyzer.py
+++ b/borg_ncdu_analyzer.py
@@ -1,18 +1,22 @@
+#!/usr/bin/python3
 import os
 import signal
 import subprocess
 import json
 import tempfile
-from dataclasses import dataclass
 from typing import List, Dict, Iterator, Tuple, Iterable
 
 
-@dataclass
 class FSEntry:
     name: str
     size: int
     sub: List['FSEntry']
 
+    def __init__(self, name: str, size: int, sub: List['FSEntry']):
+        self.name = name
+        self.size = size
+        self.sub = sub
+
     def add_entry(self, entry: 'FSEntry'):
         self.sub.append(entry)
 

Seems to work ยฏ\(ใƒ„)/ยฏ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.