Visualizing a directory structure as a tree map of rectangles

There’s this nice tool called WinDirStat which lets you scan a directory and view files in a rectangular tree map. It looks like this:

windirstat

The size of each block is related to the file size, and blocks are grouped by directory and coloured distinctly according to the top level directory. I’d like to create a map like this in Mathematica. First I get some file names in the tree of my Mathematica installation and calculate their sizes:

fassoc = FileSystemMap[FileSize, File[$  InstallationDirectory], Infinity, IncludeDirectories -> False]; 

Level Infinity ensures it traverses the whole tree. I could also add 1 to ensure the association is flattened, but I want the nesting so I can assign total sizes per directory.

I can find the total size which I’ll need to use to scale the rectangles:

QuantityMagnitude[Total[Cases[fassoc, Quantity[_, _], Infinity]], "Bytes"] 

My idea is to recursively apply this total. In theory I could use this to do something like this with a tree graph and weight the vertices by size, but I want to convert this into a map of rectangles like in WinDirStat. While the colour is obvious – each level 1 association and all its descendants gets a RandomColor[] – I’m not sure how I should go about positioning the rectangles in a Graphics. Any ideas?

Selling a UK Business Directory with over 3.2m listings

About the Business
One of the Locals was custom built-in June 2019, it houses over 3.2 million business listings for businesses all across the UK.

It has been built from the ground up with a focus on SEO, the website has been optimised professionally by myself with nearly 10 years of experience in SEO. It is being indexed well by Google with nearly 70k monthly impressions in Google, this number has been growing monthly.

The website has yet to be monetised but easily has the ability…

Selling a UK Business Directory with over 3.2m listings

Prevent directory traversal vulnerability in bash script

How can I prevent directory traversal attacks in a bash script, where arguments contain directory names?

Example:

$  STAGE=$  1 $  APP=$  2 deploy.sh dist/ /opt/apps/"$  STAGE"/"$  APP" 

The $ STAGE and $ APP variables are set from outside. An attacker could change this to an arbitrary path with "..".

I know the usual solution is to compare the directory string with the result of a function that returns the absolute path. But I couldn’t find a ready solution and don’t want to come up with my own.

I am seeing the error rpcinfo: can’t contact rpcbind: RPC: Remote system error – No such file or directory when running the rpcinfo command

So guys I am new to kali linux, sorry if this is a basic question but I am seeing this error message rpcinfo: can’t contact rpcbind: RPC: Remote system error – No such file or directory whenever I am running the command rpcinfo -p for NFS testing.

What is the best way to create default page when access to a protected directory is Cancelled through onclick?

I have a protected directory on an hosted IONOS server. It correctly works when the correct credentials are entered, but when a user hits cancel, it redirects that user to the hosting provider’s promo default page.

eg. https://initiostar.co.uk/ticker/OmniTicker.7z

eg current htaccess

AuthUserFile /path/to/the/password/file/.htpasswd AuthType Basic AuthName "Protected Page"  <Files "index.php"> Require valid-user </Files> 

If the user hits cancel you are redirected to the host’s default page. Tried adding a default, but I doubt this is the way to it.

DefaultIndex [filename]  

Preferred outcome: popup box opens in a small window on the web page and where cancel is executed, it closes the popup and stays on the same page.

For anyone working with Apache I assume this is standard stuff, but not for me.

Recovery of files from a zip containing a directory (unencrypted) and 3 files (encrypred – ZipCrypto Deflate), possibe use of bkcrack?

I have a zip file, Example.zip consisting of a directory Example and three files *.dat. I can see the names of all 3 files. The dat files are encrypted (ZipCrypto Deflate). I’m interested to know if I can use bkcrack, and am aware of the required:

at least 12 bytes of contiguous plaintext.

My system has a modern 6c/12t CPU, and an older GPU.

  1. Can I use anything about the directory or filenames themselves for the required plaintext?
  2. If 1 is not possible what hints/course of action can I take to derive the 12 (or more) bytes.

I just need the files.

How to write a file from a theme to the “Site Address” directory?

I recently came across a theme which creates a sitemap and attempts to add it to the Site Address directory/root, so https://example.com/sitemap.xml. I believe the way this theme does it makes some bad assumptions about file paths and uses ABSPATH.

$  fp = fopen( ABSPATH . 'sitemap.xml', 'w' ); fwrite( $  fp, $  sitemap ); fclose( $  fp ); 

In most cases, this might work without incident. However, I’m actually using Bedrock which means sitemap.xml ends up in https://example.com/wp/sitemap.xml with /wp/ added and so visiting the expected URI (https://example.com/sitemap.xml) results in a 404.

I’d like to correct this via a child theme or by PR but I frankly have no clue where to begin, so I’ve currently just made some symlinks, but something tells me there’s a more thorough approach.