commit 970fc897848dfafb3460005c7a9e1f9e1b5b7865 parent 06e7d4da278f553c4445605452775804db4f635c Author: Martin Kloeckner <mjkloeckner@gmail.com> Date: Sat, 29 Aug 2026 13:01:11 -0300 Fix titles capitalization Diffstat:
10 files changed, 170 insertions(+), 170 deletions(-) diff --git a/blog/bought-a-thinkpad/bought-a-thinkpad.md b/blog/bought-a-thinkpad/bought-a-thinkpad.md @@ -1,9 +1,9 @@ %% -title: "I bought a ThinkPad x200 for $27" +title: "I Bought a ThinkPad X200 for $27" date: "26-Oct-2022" %% -# I bought a ThinkPad x200 for $27 +# I Bought a ThinkPad X200 for $27 A few weeks ago I was scrolling through Facebook marketplace when I saw what It looked like a ThinkPad published for exactly ARS$ 8000 (around USD $27). When I diff --git a/blog/grub-linux-version-fix/grub-linux-version-fix.md b/blog/grub-linux-version-fix/grub-linux-version-fix.md @@ -1,9 +1,9 @@ %% -title: "GRUB menu: Linux version not detected" +title: "GRUB Menu: Linux Version Not Detected" date: "02-Nov-2024" %% -# GRUB menu: Linux version not detected +# GRUB Menu: Linux Version Not Detected If your grub installation doesn't detect the Linux versions properly, and displays it wrong in the prompt menu at boot, like in my case in which appeared diff --git a/blog/imagemagick-use-case-export-and-process-ltspice-schematics/imagemagick-use-case-export-and-process-ltspice-schematics.md b/blog/imagemagick-use-case-export-and-process-ltspice-schematics/imagemagick-use-case-export-and-process-ltspice-schematics.md @@ -1,163 +0,0 @@ -%% -title: "ImageMagick use case: export and process LTSpice schematic images" -date: "19-Nov-2024" -%% - -# ImageMagick use case: export and process LTSpice schematic images - -In this post I explain how I managed to simplify to a 'one-liner' the series of -steps involved in exporting and processing the image of an LTSpice schematic for -further use in a report paper or any similar document. - -> ***TL;DR*** -> -> Copy to clipboard the current view of the schematic in LTSpice: `right click > -> view > copy image to clipboard`, then, using xclip, pipe the content of the -> clipboard to magick and save the image with name `schematic.png`, in black and -> white (`-colorspace grey`) and cropped to the contents of the image (`-trim`) -> -> ```console -> $ xclip -selection clipboard -t image/bmp -o | magick - -colorspace grey -trim schematic.png -> ``` -> <!--`--> - -## Getting an image of the schematic from LTSpice - -First we copy the current schematic view in LTSpice to the clipboard with: -`right click on an empty space of the schematic > view > copy image to -clipboard`. - - - -Others may just take a screenshot of the schematic, this is also a valid way of -getting an image of the schematic but as we'll see later it's more practical to -just copy the image to clipboard since it doesn't require the creation of a new -temporary file. - -## Previous Procedure - -<!-- -First we copy the current schematic view of LTSpice to clipboard with: `right -click on an empty space of the schematic > view > copy image to clipboard`. - - - -Other may just take a screenshot of the schematic, this is also a valid way of -getting an image of the schematic but in my experience it's better, and simpler, -to copy the image to clipboard ---> - -After copying the image to the clipboard from LTSpice as seen in the previous -section, just using a GUI program like gimp, paste the image from the clipboard, -crop the image, apply black and white filters, etc; finally export the image. - -This procedure looks simple, but when doing it with multiple schematics it turns -tedious. In the current procedure the steps after copying the image shrinks to a -one-liner (a single line containing one or more chained commands). - -## Current Procedure - -<!-- -Copying the schematic image from LTSpice is the same as the previous way, the -steps that change are the following ones which involve getting the image from -the clipboard, processing it and finally exporting it to a file. In this new -procedure we use a series of chained command line commands to obtain that. ---> - -Instead of using a GUI program after copying the image to the clipboard from -LTSpice, we use a series of command line tools to process and save the image, in -particular, xclip to manage the clipboard contents (X session) and ImageMagick -to process the image. - -### Getting the image from the clipboard - -To get the image from the clipboard we use xclip (xclip works for an X session, -if you are using Wayland you may use [wl-clipboard](https://github.com/bugaevc/wl-clipboard) -which it may have similar commands to the ones seen on this post). - -<!-- -Then we can query the format of the copied image by specifying the `TARGETS` -target to xclip, as follows: - -After copying the image from LTSpice, you may query the supoorted image formats -of that image, you can do that ---> - -After copying the image from LTSpice, you may query the supported image formats -of the clipboards contents, you can do that by providing the `TARGETS` to the -target flag `-t` as show next. - -```console -$ xclip -selection clipboard -t TARGETS -o -PIXMAP -image/bmp -TARGETS -MULTIPLE -TIMESTAMP -``` - -Notice that we provide the `-selection clipboard` flag, this selects the -clipboard named `clipboard` (there is also `primary` and `secondary`). In this -case we use LTSpice running on wine so it may use a different clipboard for -other installations. - -Specifying the `image/bmp` target to xclip and no filename to the output flag -`-o`, will result in xclip printing the binary data to standard output (this -will probably mess the terminal). By piping the binary data to a file, as shown -next, we can make sure if the data is a bitmap formatted image. - -```console -$ xclip -selection clipboard -t image/bmp -o > schematic_raw -``` - -Executing the `file` command on the new file `schematic_raw` reveals that -effectively it is a bitmap file. - -```console -$ file schematic_raw -schematic_raw: PC bitmap, Windows 3.x format, 1916 x 966 x 32, 3 compression, image size 7403424, cbSize 7403490, bits offset 66 -``` - -The raw schematic image, in bitmap format, looks exactly as shown in the LTSpice -schematic view. - - - -The next step is to convert it to black and white, trim the white margins and -finally convert it to png format. - -### Processing the image using ImageMagick - -Instead of piping the output of the xclip command to a file, we pipe the binary -data to ImageMagick appending a single dash `-` to tell magick to read from -standard input. To apply the desired effects on the image we also append the -flag `-colorspace grey`, to make the image black and white, the flag `-trim`, -to crop the image to the content, and finally we save the resulting image in png -format by appending the extension to the output file name (for example -`schematic.png`). - -```console -$ xclip -selection clipboard -t image/bmp -o | magick - -colorspace grey -trim schematic.png -``` - -The final image results as follows - - - -ImageMagick can also read from a file, for example if you took a screenshot of -the schematic, you can process it by specifying the file name as input, instead -of reading from standard input. - -```console -$ magick schematic_screenshot.png -colorspace grey -trim schematic.png -``` - -<!-- -Simply pipe the output of the clipboard to ImageMagick and add the flag -`-colorspace grey`, to make the image black and white, and the flag `-trim` to -crop the image to the content. - -output of the magick command is the following image, which is in black and -white plus the margins are cropped, resulting in an image ready for inserting in -a paper. ---> diff --git a/blog/imagemagick-use-case-export-and-process-ltspice-schematics/copy_to_clipboard_cropped.png b/blog/imagemagick-use-case-process-ltspice-schematic-images/copy_to_clipboard_cropped.png Binary files differ. diff --git a/blog/imagemagick-use-case-export-and-process-ltspice-schematics/copy_to_clipboard_cropped2.png b/blog/imagemagick-use-case-process-ltspice-schematic-images/copy_to_clipboard_cropped2.png Binary files differ. diff --git a/blog/imagemagick-use-case-process-ltspice-schematic-images/imagemagick-use-case-process-ltspice-schematic-images.md b/blog/imagemagick-use-case-process-ltspice-schematic-images/imagemagick-use-case-process-ltspice-schematic-images.md @@ -0,0 +1,163 @@ +%% +title: "ImageMagick Use Case: Process LTspice Schematic Images" +date: "19-Nov-2024" +%% + +# ImageMagick Use Case: Process LTspice Schematic Images + +In this post I explain how I managed to simplify to a 'one-liner' the series of +steps involved in exporting and processing the image of an LTSpice schematic for +further use in a report paper or any similar document. + +> ***TL;DR*** +> +> Copy to clipboard the current view of the schematic in LTSpice: `right click > +> view > copy image to clipboard`, then, using xclip, pipe the content of the +> clipboard to magick and save the image with name `schematic.png`, in black and +> white (`-colorspace grey`) and cropped to the contents of the image (`-trim`) +> +> ```console +> $ xclip -selection clipboard -t image/bmp -o | magick - -colorspace grey -trim schematic.png +> ``` +> <!--`--> + +## Getting an image of the schematic from LTSpice + +First we copy the current schematic view in LTSpice to the clipboard with: +`right click on an empty space of the schematic > view > copy image to +clipboard`. + + + +Others may just take a screenshot of the schematic, this is also a valid way of +getting an image of the schematic but as we'll see later it's more practical to +just copy the image to clipboard since it doesn't require the creation of a new +temporary file. + +## Previous Procedure + +<!-- +First we copy the current schematic view of LTSpice to clipboard with: `right +click on an empty space of the schematic > view > copy image to clipboard`. + + + +Other may just take a screenshot of the schematic, this is also a valid way of +getting an image of the schematic but in my experience it's better, and simpler, +to copy the image to clipboard +--> + +After copying the image to the clipboard from LTSpice as seen in the previous +section, just using a GUI program like gimp, paste the image from the clipboard, +crop the image, apply black and white filters, etc; finally export the image. + +This procedure looks simple, but when doing it with multiple schematics it turns +tedious. In the current procedure the steps after copying the image shrinks to a +one-liner (a single line containing one or more chained commands). + +## Current Procedure + +<!-- +Copying the schematic image from LTSpice is the same as the previous way, the +steps that change are the following ones which involve getting the image from +the clipboard, processing it and finally exporting it to a file. In this new +procedure we use a series of chained command line commands to obtain that. +--> + +Instead of using a GUI program after copying the image to the clipboard from +LTSpice, we use a series of command line tools to process and save the image, in +particular, xclip to manage the clipboard contents (X session) and ImageMagick +to process the image. + +### Getting the image from the clipboard + +To get the image from the clipboard we use xclip (xclip works for an X session, +if you are using Wayland you may use [wl-clipboard](https://github.com/bugaevc/wl-clipboard) +which it may have similar commands to the ones seen on this post). + +<!-- +Then we can query the format of the copied image by specifying the `TARGETS` +target to xclip, as follows: + +After copying the image from LTSpice, you may query the supoorted image formats +of that image, you can do that +--> + +After copying the image from LTSpice, you may query the supported image formats +of the clipboards contents, you can do that by providing the `TARGETS` to the +target flag `-t` as show next. + +```console +$ xclip -selection clipboard -t TARGETS -o +PIXMAP +image/bmp +TARGETS +MULTIPLE +TIMESTAMP +``` + +Notice that we provide the `-selection clipboard` flag, this selects the +clipboard named `clipboard` (there is also `primary` and `secondary`). In this +case we use LTSpice running on wine so it may use a different clipboard for +other installations. + +Specifying the `image/bmp` target to xclip and no filename to the output flag +`-o`, will result in xclip printing the binary data to standard output (this +will probably mess the terminal). By piping the binary data to a file, as shown +next, we can make sure if the data is a bitmap formatted image. + +```console +$ xclip -selection clipboard -t image/bmp -o > schematic_raw +``` + +Executing the `file` command on the new file `schematic_raw` reveals that +effectively it is a bitmap file. + +```console +$ file schematic_raw +schematic_raw: PC bitmap, Windows 3.x format, 1916 x 966 x 32, 3 compression, image size 7403424, cbSize 7403490, bits offset 66 +``` + +The raw schematic image, in bitmap format, looks exactly as shown in the LTSpice +schematic view. + + + +The next step is to convert it to black and white, trim the white margins and +finally convert it to png format. + +### Processing the image using ImageMagick + +Instead of piping the output of the xclip command to a file, we pipe the binary +data to ImageMagick appending a single dash `-` to tell magick to read from +standard input. To apply the desired effects on the image we also append the +flag `-colorspace grey`, to make the image black and white, the flag `-trim`, +to crop the image to the content, and finally we save the resulting image in png +format by appending the extension to the output file name (for example +`schematic.png`). + +```console +$ xclip -selection clipboard -t image/bmp -o | magick - -colorspace grey -trim schematic.png +``` + +The final image results as follows + + + +ImageMagick can also read from a file, for example if you took a screenshot of +the schematic, you can process it by specifying the file name as input, instead +of reading from standard input. + +```console +$ magick schematic_screenshot.png -colorspace grey -trim schematic.png +``` + +<!-- +Simply pipe the output of the clipboard to ImageMagick and add the flag +`-colorspace grey`, to make the image black and white, and the flag `-trim` to +crop the image to the content. + +output of the magick command is the following image, which is in black and +white plus the margins are cropped, resulting in an image ready for inserting in +a paper. +--> diff --git a/blog/imagemagick-use-case-export-and-process-ltspice-schematics/schematic.png b/blog/imagemagick-use-case-process-ltspice-schematic-images/schematic.png Binary files differ. diff --git a/blog/imagemagick-use-case-export-and-process-ltspice-schematics/schematic_raw.png b/blog/imagemagick-use-case-process-ltspice-schematic-images/schematic_raw.png Binary files differ. diff --git a/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.md b/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.md @@ -1,5 +1,5 @@ %% -title: "Spending money on thinkpads" +title: "Spending Money On Thinkpads" date: "14-Oct-2023" %% diff --git a/blog/testing-syntax-highlight/testing-syntax-highlight.md b/blog/testing-syntax-highlight/testing-syntax-highlight.md @@ -1,9 +1,9 @@ %% -title: "Testing code syntax highlight" +title: "Testing Code Syntax Highlight" date: "21-Oct-2022" %% -# Testing code syntax highlight +# Testing Code Syntax Highlight This is a testing page for a script that I'm using to highlight code blocks within an html file.
