Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
commands-general-tools [2019/10/31 18:10]
alex [Network Stuff] reworked DNSSEC chasing
commands-general-tools [2020/07/11 11:22] (aktuell)
alex [Conversion Stuff] add rounded corners to an image (for app icon with rounded corners in the style of iPhone‘s SpringBoard)
Zeile 33: Zeile 33:
 clang++ -dM -E -x c /dev/null clang++ -dM -E -x c /dev/null
 </code> </code>
 ==== OpenSSL ==== ==== OpenSSL ====
Zeile 217: Zeile 218:
 </code> </code>
 [[|7z(1)]] [[|7z(1)]]
 +=== view contents of ZIP or TAR files without complete extracting ===
 +<code bash>
 +### example of "Android Package Kit" which is actually a ZIP file
 +unzip -l SomeAndroidApp.apk
 +unzip -p SomeAndroidApp.apk META-INF/MANIFEST.MF
 +### example of an "Open Virtual Appliance" which is actually a TAR file
 +tar -tf SomeAppliance.ova
 +tar -xfO SomeAppliance.ova SomeAppliance.ovf
 +[[|unzip(1)]] [[|tar(1)]]
 ==== Disk and Partition Stuff ==== ==== Disk and Partition Stuff ====
Zeile 232: Zeile 245:
 ssh "cat /backup/basil-sda.img.lz4" | lz4cat | pv | dd of=/dev/sda bs=1048576 ssh "cat /backup/basil-sda.img.lz4" | lz4cat | pv | dd of=/dev/sda bs=1048576
 </code> </code>
 ==== Conversion Stuff ==== ==== Conversion Stuff ====
-=== make a big image small with ImageMagick ===+=== convert image file using ImageMagick ===
 <code bash> <code bash>
 +## make a big image small
 convert big_input.tif -resize 256x256 small_output.png convert big_input.tif -resize 256x256 small_output.png
 +## make an image grayscale and remove any transparency
 +convert input.png -alpha deactivate -colorspace Gray output.png
 +## create PNG with transparency from SVG, determine it's pixel dimensions from a DPI parameter
 +convert -background none -density 1200 input.svg output.png
 +## create PNG with transparency from SVG, specify it's pixel dimensions directly
 +convert -background none -size 512x512 input.svg output.png
 </code> </code>
 [[|convert(1)]] [[|ImageMagick(1)]] [[|convert(1)]] [[|ImageMagick(1)]]
-=== make an image grayscale and remove any transparency with ImageMagick === +=== batch convert images in a directory: rename by creation date and resize to width === 
-<code> +<code bash
-convert input.png -alpha deactivate -colorspace Gray output.png+### for JPGs 
 +exiftool -ext jpg '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e . 
 +mogrify -resize 375 -define preserve-timestamp=True *.JPG 
 +### for PNGs 
 +exiftool -ext png '-FileName<DateCreated' -d %Y%m%d_%H%M%S%%-c.%%e . 
 +mogrify -resize 375 -define preserve-timestamp=True *.PNG 
 +### Comments: 
 +## the "%%-c" in the filename template is for a numerical suffix, in case of multiple images with the same date 
 +## the "-define preserve-timestamp=True" is for keeping file attributes for timestamps 
 +## for case-sensitive filesystems in the "mogrify" command the glob pattern must be adjusted
 </code> </code>
-[[|convert(1)]] [[|ImageMagick(1)]]+[[|exiftool(1)]] [[|mogrify(1)]] [[|ImageMagick(1)]] 
 +=== add rounded corners to an image (for app icon with rounded corners in the style of iPhone‘s SpringBoard) === 
 +<code bash> 
 +### Adjust the corner radius (in pixel) to your needs. 
 +### For a 1024x1024 image a value of 128 looks good. 
 +### The whole ImageMagick command is quite complex. The resulting rounded image is written to a new file.  
 +### The cascade of parenthesized options defines the operations to cut out the transparent arcs in the corners. 
 +convert AppIconRaw.png \( +clone -alpha extract \ 
 +  \( -size ${RADIUS}x${RADIUS} xc:black -draw "fill white circle ${RADIUS},${RADIUS} ${RADIUS},0" -write mpr:arc +delete \) \ 
 +  \( mpr:arc \) -gravity northwest -composite \ 
 +  \( mpr:arc -flip \) -gravity southwest -composite \ 
 +  \( mpr:arc -flop \) -gravity northeast -composite \ 
 +  \( mpr:arc -rotate 180 \) -gravity southeast -composite \) \ 
 +  -alpha off -compose CopyOpacity -composite AppIconRounded.png 
 +[[|convert(1)]] [[|ImageMagick(1)]] [[|ImageMagick - Command-line Processing]] [[|ImageMagick - Command-line Options]]
 === Unix timestamp to human readable time === === Unix timestamp to human readable time ===
Zeile 297: Zeile 345:
 </code> </code>
 [[|recode(1)]] [[|recode(1)]]
 ==== Process Stuff ==== ==== Process Stuff ====
commands-general-tools.1572541851.txt.gz · Zuletzt geändert: 2019/10/31 18:10 von alex