Billie · @Billie
385 followers · 4420 posts · Server social.tchncs.de

to compose a 15x10 cm image with 600 dpi for printing 8 passport photos, each of them exactly 35x45 mm

#!bin/bash
montage $1 $1 $1 $1 $1 $1 $1 $1 -geometry 827x1063 -tile 4x2 -pointsize 31 -title 'print as 15x10 cm => 600 dpi, each photo will be 35x45 mm. Use 2nd line as stencil to cut 1st line.' $2

usage: command source target

#bash #oneliner

Last updated 1 year ago

Marcos Dione · @mdione
21 followers · 426 posts · Server en.osm.town

* `systemctl link` allows you to start using unit files in any place of the filesystem. This can be used for products that install in `/opt/`.

* not really TIL, just a to get python3's current version:

python3 -c 'import sys; print(".".join(sys.argv[2].split(".")[:2]))' $(python3 --version)

[get the text from python --version as positional arguments, take the second one, split by dots ('.'), take the first two elements, join again with dots, *pant*, *pant*]

#til #oneliner #systemd #python

Last updated 1 year ago

Mark Gardner ‍:sdf: · @mjgardner
668 followers · 4200 posts · Server social.sdf.org

@www.jvt.me Because I’m a guy I turned that into a with the power of @mojolicious:

perl -Mv5.20 -Mojo -E 'for my $url (@ARGV) { say j(g($url)->dom("head link[rel=alternate]")->map( sub { $_->{type} =~ m{^application/(rss|atom)\+xml$} ? { href => l( $_->{href} )->to_abs( l($url) ), $_->%{"title", "type"} } : () } )->TO_JSON) }'

#perl #oneliner

Last updated 1 year ago

Mark Gardner ‍:sdf: · @mjgardner
667 followers · 4168 posts · Server social.sdf.org

@jxyzn @barubary @Perl Note that’s not best practice *code* in that . It uses the = assignment operator when you almost always want the == comparison operator.

The point is that perl v5.36 and later’s implicit `use warnings` won’t get triggered. If you wrote it like this, you *would* get warnings and errors to STDERR and a non-zero exit code indicating failure:

perl -Mv5.36 -e ‘say “hello” if $foo = 1’

#perl #oneliner

Last updated 1 year ago

Mark Gardner ‍:sdf: · @mjgardner
667 followers · 4168 posts · Server social.sdf.org

@jxyzn @barubary @Perl Yep, basically don’t use `perl -E` unless you want your to pick up the current feature bundle for your installation:

perldoc.perl.org/perlrun#-E-co
perldoc.perl.org/feature#IMPLI

scripts with `perl -E` one-liners may *break* if you upgrade or run them somewhere else with a different installed version.

Here’s a way to enable a specific feature bundle without implicitly enabling `use strict` or `use warnings`:

perl -Mfeature=:5.36 -e ‘say “hello” if $x = 1’

#oneliner #shell #perl

Last updated 1 year ago

Matt Hodgkinson · @mattjhodgkinson
1142 followers · 2581 posts · Server scicomm.xyz

Jimmy Carr reeled the audience in.

#standupcomedy #oneliner #jimmycarr #COVID19

Last updated 2 years ago

Markus Feilner :verified: · @mfeilner
567 followers · 2855 posts · Server mastodon.cloud
İstanbul'da Ale! · @ale
139 followers · 969 posts · Server mstdn.io

DOI='10.1145/3356903'
curl "api.crossref.org/works/${DOI}" \
| jq -r '.message.abstract' \
| { \
echo '<article xmlns:mml="w3.org/1998/Math/MathML" dtd-version="1.2"><body>'
cat
echo '</body></article>'
} \
| pandoc --from jats --to commonmark

# Given DOI, get the article abstract (if it is available)

#oneliner #shell #cli

Last updated 2 years ago

Renaud Lifchitz :verified: · @nono2357
259 followers · 1924 posts · Server infosec.exchange

RT @onyphe
of the day:

onyphe -search 'domain:example.com | uniq ip | search category:vulnscan -exists:cve ip:$ip'

That's a correlation search: it takes output from datascan and feeds vulnscan with IPs.

Download and play:

github.com/onyphe/training/blo

#oneliner

Last updated 2 years ago

screwtape · @screwtape
145 followers · 855 posts · Server mastodon.sdf.org
вrυnυѕ · @brunus
345 followers · 8452 posts · Server mamot.fr

Détecter des pixels noirs, ou de niveaux de gris juqu'à -50% du noir, dans une ligne de pixels, avec Image Magic

convert -colorspace rgb image.png -background white -flatten -crop WIDTHxLIGNE+0+0 -threshold 50% txt:- | grep "#000000" | cut -d "," -f1

Bon bha j'ai ce vient trick à recoder en Python parce qu'il parait que c'est trop "barbu/chevelu" dans un shell-scipt ... 😜

#imagemagic #trick #oneliner #cli #python #shellscript

Last updated 2 years ago

🎀𝐚𝐤𝐢🎀 · @trlfgrl
15 followers · 32 posts · Server mastodon.social

Missing sea? Here are the waves. Another by Ian Witham. ⌨️🌊〰️

#commodore64 #oneliner

Last updated 2 years ago

🎀𝐚𝐤𝐢🎀 · @trlfgrl
15 followers · 31 posts · Server mastodon.social

Some for the windy morning 🍃 ⌨️

#commodore64 #oneliner

Last updated 2 years ago

MAT64 · @mat64
90 followers · 65 posts · Server livellosegreto.it

Caro Livello Segreto,
visto che al supermercato mi hanno chiesto di "TIRARE" dei è arrivato il momento che ti racconti dei miei in 79 caratteri in .

Per l'occasione ho scritto due righe qua:
mat64.org/dancing-with-the-bas

BONUS STAGE: Find the easter-eggs in the basic code.

#c64 #oneliner #basic

Last updated 2 years ago

Flop Error · @FlopError
22 followers · 256 posts · Server mstdn.party

Substack, more like Substandard and Subhuman, amirite? 🤣 :BlobfoxThinking:

#antivax #conspiracy #oneliner

Last updated 2 years ago

Calyo Delphi · @dragonarchitect
339 followers · 2403 posts · Server rubber.social

Useful that I found today, to get the names of your RS232 serial COMx ports, for when you need to do serial communications and don't want to go digging through Device Manager:

[System.IO.Ports.SerialPort]::GetPortNames()

#powershell #oneliner #sysadmin #devops

Last updated 2 years ago

ovan · @ovan
137 followers · 290 posts · Server social.olstrom.be

Dummy

#oneliner

Last updated 2 years ago

ovan · @ovan
137 followers · 287 posts · Server social.olstrom.be

Dummy

#oneliner

Last updated 2 years ago

kevin ✨ (he/him) · @KevinGimbel
9 followers · 3 posts · Server fosstodon.org
Stewart Russell · @scruss
144 followers · 386 posts · Server xoxo.zone

My favourite BBC Micro game is a BASIC one-liner from 1984 called "Asterisk Tracker". You can play it here - but you should probably know before you start that you need to hold RETURN to go up, or press SPACE to start a new game:

bbc.godbolt.org/?autorun&loadB

#onebutton #game #basic #oneliner #bbcmicro

Last updated 2 years ago