hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.2K
active users

#grep

0 posts0 participants0 posts today

You know how you can understand something like Regular Expressions (Grep) well enough to write really complex statements that precisely match the nuanced text patterns you’re hoping to revise, but then 6 months later you look at this RegEx you wrote and can’t parse it at all? Like, literally no idea how it works? As in it-would-be-faster-to-recreate-it-from-scratch-than-to-understand-it-enough-to-change-it-even-slightly?

I feel like that all the time.

[FR]
Arrivée ici début 2025, big up aux @admin de Piaille.fr ! #introduction :
Tombée dans la marmite #OpenSource en 2000, je me nourris de commandes #bash. Fichiers texte, #grep et ses jolies #regex, #ansible, #git, #greasemonkey, les tests auto et la supervision sont tes amis.
Cordes frottées, grattées et frappées, sons soufflés, chantés ou beatboxés, sons électro ou scratchés me touchent. Rien de tel qu'une bonne soirée à jammer / à enregistrer pour un beatmaker / à débarquer sur scène pour accompagner quand il manque un instrumentiste / à repiquer des morceaux entiers sur papier à l'ancienne / à improviser avec les enfants
Engagée #AMAP et pro #CNV

Anybody else download like 1000 TikToks and max out their phones storage and their back up solution? No...yeah...Me Neither.

But if someone did, here's a way to solve it quickly on Android devices.

Since #TikTok names all its video files 32bithexadecimalvalue.mp4, we can us a little #grep and #regex along with #Termux to sort through the #Android #camera roll and delete all the corresponding files.

justinmcafee.com/posts/2025/so

justinmcafee.comJustin McAfee - So You Downloaded a Thousand TikToks

I've mirrored a relatively simple website (redsails.org; it's mostly text, some images) for posterity via #wget. However, I also wanted to grab snapshots of any outlinks (of which there are many, as citations/references). By default, I couldn't figure out a configuration where wget would do that out of the box, without endlessly, recursively spidering the whole internet. I ended up making a kind-of poor man's #ArchiveBox instead:

for i in $(cat others.txt) ; do dirname=$(echo "$i" | sha256sum | cut -d' ' -f 1) ; mkdir -p $dirname ; wget --span-hosts --page-requisites --convert-links --backup-converted --adjust-extension --tries=5 --warc-file="$dirname/$dirname" --execute robots=off --wait 1 --waitretry 5 --timeout 60 -o "$dirname/wget-$dirname.log" --directory-prefix="$dirname/" $i ; done

Basically, there's a list of bookmarks^W URLs in others.txt that I grabbed from the initial mirror of the website with some #grep foo. I want to do as good of a mirror/snapshot of each specific URL as I can, without spidering/mirroring endlessly all over. So, I hash the URL, and kick off a specific wget job for it that will span hosts, but only for the purposes of making the specific URL as usable locally/offline as possible. I know from experience that this isn't perfect. But... it'll be good enough for my purposes. I'm also stashing a WARC file. Probably a bit overkill, but I figure it might be nice to have.

Die #InDesigns #GREP-Engine kann im #Lookbehind nur eine fest definierte Anzahl von Zeichen prüfen – nicht eine beliebige Länge.

Wenn man beispielsweise schließende Klammern nur dann finden möchte, wenn davor ein beliebig langer Text steht, geht das nicht.

(?<=\d{3}) (3 Ziffern) funktioniert.
(?<=\d+) (eine oder mehrere Ziffern) funktioniert nicht.

Selbst wenn man Alternativen mit | kombiniert, müssen alle Optionen die gleiche Zeichenzahl aufweisen.

#Lookahead lässt variable Längen zu.

Нечаянно удалил все файлы в папке сайта на сервере. В прошлый раз я потерял очень ценный рабочий скрипт-файл и это было в позапрошлом году. Extundelete и testdisk ни черта не помогли. Не тогда, не в этот раз. Пришлось опять через grep искать по подстроке на всём жёстком диске содержимое файла.

Вот примерная строка запуска, если кому надо:
grep --binary-files=text --context=1350 'SELECT * FROM posts WHERE post_hidden < 2' /dev/sda1 > found_data1

Ext4 конечно плоха в этом плане. ReiserFS 3.6 раньше позволяла почти все удалённые файлы восстановить. Интересно как в этом плане дела обстоят у BtrFS и XFS?

🎉 Behold, the latest over-engineered solution to a problem nobody had: yet another #string #search utility, because grep's five-decade reign obviously requires an AVX2-fueled #revolution. 🚀 If you believe a 5x speed boost will change your #grep game, brace yourself for a groundbreaking experience that totally justifies its memory-mapped existence. 🙄
davidesantangelo.github.io/kre #overengineered #solutions #AVX2 #speedboost #HackerNews #ngated

davidesantangelo.github.iokrep - Blazing Fast String Search Utility

Nach Zeichenketten greppen, die exakt einen Punkt enthalten.
grep -E '^[^.]*\.[^.]*$' - sieht erstmal komisch aus, aber wenn man es aufdröselt, dann doch nicht. Gehirnschmerzen verursacht allerdings [^.]* - denn [^.] kann natürlich auch eine leere Menge sein, also bedeutet [^.]*auch: "nichts keinmal". Ja, schon klar, das ist formal absolut korrekt. Aber mein Hirn quietscht.

[Archive — 2023] Comment j'ai (presque) foutu en l'air une demi-journée de boulot

Si vous avez viré par erreur un fichier texte, un simple grep peut vous sauver la vie. Une histoire qui commence très mal mais finit très bien grâce à GNU/Linux !

▶️ Lire cet article : studios.ptilouk.net/superflu-r
📗 Le livre best of : editions.ptilouk.net/gb10ans
❤️ Soutien : ptilouk.net/#soutien

#archive #technique #grep #dev #récupération #GNUlinux

studios.ptilouk.net/superflu-r

Superflu Riteurnz BlogComment j'ai (presque) foutu en l'air une demi-journée de boulot
More from Ptilouk.net Studios
Continued thread

... Oh that reminds me: avoid #grep too due to terrible speed issue: bugs.freebsd.org/bugzilla/show ; bugs.freebsd.org/bugzilla/show .

Am partial to "#ugrep(1)" github.com/Genivia/ugrep (port: freshports.org/textproc/ugrep/ ).

(Sure, GNU grep, "ggrep(1)", is better too🤷‍♂️ if want to use same/similar enough options as native grep. So is a search via "perl(1)": perl -n -e 'm{regex} and print'.)

One day regex library (of #FreeBSD) [cw]ould be better. One could also die while holding breath for that day to arrive.

2/2

bugs.freebsd.org254763 – grep very slow with 13.0-RC4

Невидимый вывод grep при поиске, включающим конец строки в файлах с разделителем строк CRLF

На днях столкнулся с такой ситуацией: паттерн, который гарантированно должен обеспечивать непустой вывод, вместо текста производит множество пустых строк. Уже сталкивался с этим, но давно и причину вспомнил не сразу. Пофрустрировав, всё-таки припомнил, разобрался детальнее и решил написать небольшую заметку. TL;DR: Причина – встреча символа возврата каретки CR ( \r ) с управляющей последовательностью \x1B[K : CR возвращает курсор в начало строки, а \x1B[K удаляет всё от курсора до конца строки. ОС - Ubuntu 24.04, терминал Terminator 2.1.3, шелл Bash. Подробности

habr.com/ru/articles/875480/

ХабрНевидимый вывод grep при поиске, включающим конец строки в файлах с разделителем строк CRLFНа днях столкнулся с такой ситуацией: паттерн, который гарантированно должен обеспечивать непустой вывод, вместо текста производит множество пустых строк. Уже сталкивался с этим, но давно и причину...