Usual #school in #china? #lenin
【【城】一行代码让整个网站瘫痪,永不过时的黑客技术】https://www.bilibili.com/video/BV1ZXE4ziEgf?vd_source=bb5efb0fc5b9ab1f523b5e6d0a9f0a2f

Usual #school in #china? #lenin
【【城】一行代码让整个网站瘫痪,永不过时的黑客技术】https://www.bilibili.com/video/BV1ZXE4ziEgf?vd_source=bb5efb0fc5b9ab1f523b5e6d0a9f0a2f

Про #викиданные/#wikidata (открытая база данных на #SPARQL), #wikimedia, #wikipedia
Моя #лекция/митап в Лаборатории (это бар в Батуми).
https://www.wikidata.org/wiki/User:Vitaly_Zdanevich
Все линки на видео https://share.evernote.com/note/73621155-4b57-e6c1-1c69-8ee7b423b252
👍 1
#videoI wrote, with #ai, a nice #script to #find top #biggest #folders - that has no other subfolders (#leaf folders):
find . -type d -links 2 -exec du -sh {} + | sort -hr | head
Output example:
6.3G ./ДА Житомирської області/01 Ф - фонди дорадянського періоду/0118/010118-14/010118-14-00018
5.3G ./ЦДІАЛ/0080/010020-10-00088
4.8G ./ДА Закарпатської області/Перепис Закарпаття 1921 року/024/Beregszasz
4.3G ./ДА Закарпатської області/Перепис Закарпаття 1921 року/054
4.3G ./ДА Закарпатської області/Перепис Закарпаття 1921 року/045
4.1G ./ДА Закарпатської області/Перепис Закарпаття 1921 року/026/Beregszasz
3.8G ./ДА Закарпатської області/Перепис Закарпаття 1921 року/044
3.5G ./ДА Харківської області/01/0031/010031-141-00523
3.4G ./ДА Донецької області/01/0020/010020-01-00007
3.3G ./ДА Харківської області/01/0040/0105/010040-105-00969
Explanation:
On most Linux filesystems (like ext4), a directory with no subdirectories has exactly 2 #hardlink (. and its entry in the parent). This is much faster but may not work on Btrfs or XFS.
This command is an efficient way to find "leaf" directories (folders containing only files) and sort them by size. Here is the step-by-step breakdown:
find . -type d -links 2 This is the "brain" of the command that identifies folders without subfolders.. Start searching from the current directory-type d Look only for directories.-links 2 This is a clever trick for most Linux filesystems (like ext4):-exec du -sh {} + This calculates the size of the folders found.du -sh Disk Usage. -s (summary) gives the total size of the folder, and -h (human-readable) converts it to KB, MB, or GB.{} This is a placeholder for the list of folders found by find.+ This tells find to group as many folders as possible into a single du command. This is much faster than running du separately for every single folder.| sort -hr This organizes the output.| The pipe takes the output of the previous command and feeds it into sort.-h Human-numeric sort. It understands that "2G" is larger than "500M". Without this, a standard sort would think "500" is larger than "2" because of the first digit.-r Reverse. This puts the largest folders at the top of the list.Important Limitation
This command is extremely fast because it doesn't have to "peek" inside folders to see if they are empty; it just checks the filesystem metadata. However, it may not work on modern filesystems like Btrfs or XFS, as they don't use the standard hard-link counting method for directories.