Commit Graph

319 Commits

Author SHA1 Message Date
Tim Ledbetter
71ddc33fbf find: Print hyperlinks when standard output is attached to a terminal 2023-09-07 11:52:09 -06:00
Tim Ledbetter
0a02c7a926 find: Add the -regex and -iregex options
These options match a given regular expression against the whole file
path. `-iregex` is identical to `-regex` except it is case-insensitive.
2023-08-28 11:51:14 +03:30
Poseydon42
333949894e Userland: Add glsl-compiler utility that prints parsed AST 2023-08-18 15:29:48 +02:00
Liav A
029160fd27 Utilities: Add zcat
This utility is actually a symlink to the gunzip utility.
The gunzip utility is modified to enable writing to stdout when running
through the zcat symlink, to emulate the same behavior on other OSes.

In addition to that, the gunzip utility is now required on a default
installation as it could be a vital utility under some conditions (for
example, downloading source code in a tar.gz file).
2023-08-13 10:16:03 +01:00
Liav A
ccaa423372 Utilities: Add basic Package manager skeleton utility 2023-08-07 13:24:25 -06:00
Zaggy1024
66c9696687 LibGfx: Add initial ISO BMFF parsing and a utility to print file info
Currently, the `isobmff` utility will only print the media file type
info from the FileTypeBox (major brand and compatible brands), as well
as the names and sizes of top-level boxes.
2023-07-27 12:02:37 +01:00
Shannon Booth
e838b6c8cc patch: Add the beginnings of a patch utility
This is still very bare bones, and there is _much_ more to still
handle. However, this implements enough functionality to parse a single
unified patch read from stdin, and apply it to a file.
2023-07-13 10:29:30 +01:00
Nico Weber
c3f78d9561 pdf: Add function to render a page of a PDF to a bitmap
Use like so:

    Build/lagom/bin/pdf --render foo.png --page=50 path/to.pdf
2023-07-12 07:54:28 +01:00
Valtteri Koskivuori
2c6b156803 Userland: Teach the file utility about zip files
It now shows a short description with a file and directory counts, and
the total content size uncompressed.
2023-07-11 17:48:57 +01:00
Caoimhe
f222028f79 zip: Use the helpers in ZipOutputStream for adding files 2023-07-08 13:14:50 +01:00
kleines Filmröllchen
d7a2b5e65b markdown-check: Allow generating a manpage link graph
Using the cross-page links, we can generate a directed graph showing the
topology of which pages refer to other pages. This is not just for fun:
the links show how often a page is linked (since links are not
deduplicated on purpose), which pairs of pages only have links in one
direction (where a link in the other direction may be useful), which
groups of closely-interlinked pages exist, and which pages have few or
no links to other pages.

The EXTRA_MARKDOWN_CHECK_ARGS argument to the check-markdown script can
be used to inject the -g flag for generating the graph on all manpages.
2023-07-05 16:15:42 +01:00
Nico Weber
efad31dac1 Utilities: Add a pdf utility
This utility will learn tricks such as extracting images from PDFs and
dumping tables from PDFs so that we can create code from specs.

It also allows testing LibPDF things in lagom, and allows testing
reading large amounts of PDFs using a shell script.
2023-07-04 06:50:15 +02:00
Cameron Youell
d9ff37e1b1 Utilities: Make mktemp follow the spec directory path resolution
Previously an input like this:

mktemp -d /tmp/dirtest_-XXXXX

Would result in an error when it should have created a temp directory
2023-07-02 11:19:10 -06:00
Jelle Raaijmakers
56da2c5db6 aconv: Remove usage of ancient Core::DeprecatedFile
That'll teach me for merging without waiting for CI :^)
2023-06-22 21:53:00 +02:00
kleines Filmröllchen
57b3858fbc Utilities: Add aconv for converting between audio formats
The intention for this utility is to eventually become a general-purpose
multimedia conversion tool like ffmpeg (except probably not with as many
supported formats, stream mappings and filters). For now, we can not
write any video format so the added complexity is not necessary at the
moment.
2023-06-22 21:45:54 +02:00
kleines Filmröllchen
2e4bb2941d Utilities: Add pixelflut, a Pixelflut protocol client
For the meme and for GPN.
2023-06-20 00:22:03 +02:00
Ben Wiederhake
f20d04726a LibFileSystem+Everything: Remove resolve_executable_from_environment 2023-06-06 23:46:36 +02:00
Andreas Kling
ad6027433d headless-browser: Print a diff when a test failure occurs
This will make it a lot easier to understand what went wrong, especially
when the failure occurs on CI but not at home.

And of course, use LibDiff to generate the diff! :^)
2023-05-28 22:03:57 +02:00
Tim Schumacher
0f2b6345c6 test-fuzz: Add all the missing fuzzers 2023-05-23 06:11:33 +02:00
Tim Schumacher
faa08ef1a1 test-fuzz: Don't include all fuzzers into the same .cpp file
Instead, use the approach from BuggieBox to compile in the .cpp files
separately.
2023-05-23 06:11:33 +02:00
Ben Wiederhake
6055eed5a5 xml: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00
Ben Wiederhake
9e755ccfef wasm: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00
Ben Wiederhake
8afd09b423 shot: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00
Ben Wiederhake
6e08f860f8 open: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00
Ben Wiederhake
c2d26ec541 usermod: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
6c9383ce89 install: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
317cdc32ad readlink: Prefer FileSystem::readlink over DeprecatedFile 2023-05-15 06:50:43 +02:00
Fabian Dellwing
639aee037f Userland+Meta: Add new helper program for network settings
This little program allows us to take the NetworkSettings app away
from being an elevated GUI app.

It receives a JsonObject on STDIN and writes it to the global
Network configuration file.

If the write was successfull it will apply the changes.
2023-05-13 17:59:37 -06:00
Ben Wiederhake
77f021f5f1 pledge: Prefer FileSystem over DeprecatedFile 2023-05-13 17:06:42 +02:00
Ben Wiederhake
8c2cdb7bc7 which: Prefer FileSystem over DeprecatedFile 2023-05-13 17:06:42 +02:00
Ben Wiederhake
25d2828ef5 aplay: Prefer FileSystem over DeprecatedFile 2023-05-13 17:04:05 +02:00
Ben Wiederhake
951b77e04d abench: Prefer FileSystem over DeprecatedFile 2023-05-13 17:04:05 +02:00
kleines Filmröllchen
5ebc741594 sed: Implement in-place file editing
This implements the '-i' flag in the GNU version, without suffix
support.
2023-05-05 02:15:43 +03:30
Rodrigo Tobar
41fa1a1461 Utilities: Add more commands, addresses, spaces, cmdline parsing to sed
The initial version of sed implements only the `s` command (given on the
command line) applied to all lines of the input file. While this is
probably the most common scenario that people use sed with in the wild,
it's limited in several ways:

 * `s` is only one of the many commands that sed is meant to implement.
 * Commands may take one or two addresses that limits its applicability
   to input lines.
 * Commands in general operate over the "pattern" and "hold" spaces
   rather than blindly over input lines.
 * Command line parameters include specifying a script file, and
   optionally input file(s) and/or a script to execute.

This commit implements a big portion of these missing features:

 * It adds support for parsing *almost* all commands and their
   arguments.
 * It also implements the execution of a big portion of the commands.
 * It adds support for parsing the optional addresses that prefix a
   command, and enables/disables commands based on these address ranges.
 * It implements the pattern and hold spaces, which are the source of
   input/output for most of the commands.
 * It improves the command line argument handling to receive a script
   file, potentially multiple execution scripts, and optional input
   files.

Some know missing functionality:

 * The `{` and `}` commands are not supported yet.
 * Pattern-based addresses are not supported yet.
 * Labels and branches are parsed, but not supported at runtime.
2023-04-09 18:09:23 -06:00
Cameron Youell
1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Tim Schumacher
a61c120b3f Utilities: Add an xzcat utility 2023-03-21 10:25:13 +01:00
Tim Schumacher
858c44ae1b Utilities: Add an lzcat utility 2023-03-20 12:15:38 +02:00
kleines Filmröllchen
0563048949 file: Read more metadata from audio files
We can always read the basic format information (sample rate, bit depth,
etc.), but we will also print artist, album, and title if available in
the metadata.
2023-03-13 12:35:17 -04:00
Timothy Flynn
11fe34ce0f headless-browser: Re-implement headless-browser using an OOPWV
headless-browser currently uses its own PageClient to load web pages
in-process. Due to this, it also needs to set up a whole bunch of other
objects needed to run LibWeb, e.g. image decoders, request servers, etc.

This changes headless-browser to instead implement a WebView to launch
WebContent out-of-process. This implementation is almost entirely empty,
but can be filled in as-needed. For example, we may want to print
JavaScript console messages.
2023-03-13 07:21:00 +00:00
Nico Weber
b10ec6743f Userland: Add an image utility
At the moment, all it can do is read all image formats that LibGfx can
read and save to any image format that LibGfx can write (currently bmp,
png, qoi).

Currently, it drops all image metadata (including color profiles).

Over time, this could learn tricks like keeping color profiles,
converting an image to a different color profile, cropping out a part of
an image, and so on.
2023-03-12 12:17:26 +00:00
Ali Mohammad Pur
6b50f23242 LibWasm+LibWeb: Sneak a JS::Completion into Wasm::Result
Imported functions in Wasm may throw JS exceptions, and we need to
preserve these exceptions so we can pass them to the calling JS code.

This also adds a `assert_wasm_result()` API to Result for cases where
only Wasm traps or values are expected (e.g. internal uses) to avoid
making LibWasm (pointlessly) handle JS exceptions that will never show
up in reality.
2023-02-26 10:54:23 +03:30
Nico Weber
e8bbb3d915 LibGfx+icc: Read cicpType
This is a very new tag used for HDR content. The only files I know that
use it are the jpegs on https://ccameron-chromium.github.io/hdr-jpeg/
But they have an invalid ICC creation date, so `icc` can't process them.
(Commenting out the check for that does allow to print them.)

If the CIPC tag is present, it takes precedence about the actual data
in the profile and from what I understand, the ICC profile is
basically ignored. See https://www.color.org/events/HDR_experts.xalter
for background, in particular
https://www.color.org/hdr/02-Luke_Wallis.pdf (but the other talks
are very interesting too).

(PNG also has a cICP chunk that's supposed to take precedence over
iCCP.)
2023-02-08 16:41:58 +00:00
Karol Kosek
039bb4e22d Utilities: Rename special target binaries only if they exist
Before 6490529ef7, all programs in the
SPECIAL_TARGETS list were built because they didn't have an
EXCLUDE_FROM_ALL property set.

That commit set the property for all targets, but because of this, the
minimal "Required" build configuration no longer built, as CMake failed
to rename every special target. Even the not built ones.

This commit makes the rename action run only if the executable exists,
which makes us build Serenity without the `install` utility, and also
by using the minimal configuration set. :^) :^)
2023-02-04 15:53:07 -07:00
Peter Elliott
d50de8e4ef Utilities: Replace fgrep with grep --fixed-strings 2023-01-19 12:22:24 +01:00
Liav A
01db302a33 Utilities: Add new utility for converting images to raw bitmap binaries
I used this utility to check if the possible TGA images' cases for
different origins (explictly the Y origin) are generating the same
bitmap, as I felt that my eyes are not a good-enough measurement tool
for this kind of task.
This might be useful in the future for testing other implementations so
I rather have this nice utility in our codebase.
2023-01-15 12:43:03 +01:00
MacDue
1cf45ee930 Utilities: Add ttfdisasm for disassembling OpenType instructions
This utility when given a .tff font provides options for disassembling:

 - The 'fpgm' table, this a program that's run once when the font is
   loaded. It's used to define instructions and functions used by used
   by other programs.

 - The 'prep' table, this is a general program that's run when ever
   the font size (or other properties) changes.

 - And the programs associated with any individual glyph.

The disassembly is printed in a format that matches the examples from:
https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions

I'm mainly adding this because I think it's neat to be able to look
at these things, and think it'll be helpful for debugging an
interpreter.

With this you can see that all of the LiberationSerif-XXX.tff fonts in
Serenity have these programs ready to go.
2023-01-12 11:27:57 +01:00
Eli Youngs
0ecbc5c02a Userland: Add a sed utility 2023-01-06 13:52:21 -07:00
Nico Weber
7f52f45e9d LibGfx: Start adding a utility for handling ICC color profiles
For now, this dumps file version and device class.

https://github.com/saucecontrol/compact-icc-profiles has good
test inputs.
2022-12-27 07:44:37 -07:00
Thomas Keppler
6805f71a83 pro: Add ability to log request/response metadata for HTTP URLs
In order to debug WebServer and responses we can't handle yet, it's
beneficial to being able to see what we request and what we get back.
As a first measure, we just log URL, response code, reason phrase and
headers.
2022-12-23 23:29:57 +01:00
implicitfield
a520894522 unzip: Verify extracted files against CRC32 checksums
This removes one TODO.
2022-12-20 10:44:02 +01:00