HNHacker News
TopNewBestAskShowJobs

pgtan

328 karma · joined November 5, 2014

TeX, Emacs, netpbm, Imagemagick, Gentoo
submissionscomments
pgtan··on TIL: You can make HTTP requests without curl using Bash /dev/TCP
It is a KornShell feature since ca. 1997

https://github.com/ksh93/ast-open-archive/blame/master/src/c...

pgtan··on Do you even need a database?
Here are two checks using joins, one with sqlite, one with the join builtin of ksh93:

  check_empty_vhosts () {
    # Check which vhost adapter doesn't have any VTD mapped
    start_sqlite
    tosql "SELECT l.vios_name,l.vadapter_name FROM vios_vadapter AS l
        LEFT OUTER JOIN vios_wwn_disk_vadapter_vtd AS r
    USING (vadapter_name,vios_name)
    WHERE r.vadapter_name IS NULL AND
      r.vios_name IS NULL AND
   l.vadapter_name LIKE 'vhost%';"
    endsql
    getsql
    stop_sqlite
  }

  check_empty_vhosts_sh () {
    # same as above, but on the shell
    join  -v 1  -t , -1 1 -2 1 \
   <(while IFS=, read vio host slot; do 
  if [[ $host == vhost* ]]; then
      print ${vio}_$host,$slot 
  fi
     done < $VIO_ADAPTER_SLOT | sort -t , -k 1)\
   <(while IFS=, read vio vhost vtd disk; do
  if [[ $vhost == vhost* ]]; then        
    print ${vio}_$vhost
  fi
     done < $VIO_VHOST_VTD_DISK | sort -t , -k 1)
  }
pgtan··on Random Font – a typographic experiment exploring randomness [pdf]
Someone is reinventing PostScript and Metafont

https://www.moma.org/collection/works/139326

https://www.tug.org/TUGboat/tb09-2/tb21knut.pdf

pgtan··on Spotlight on pdfly, the Swiss Army knife for PDF files
Actually pdftex or luatex, but you are completely right, it can load a pdf file and do a lot of things with it.
pgtan··on EU to mobilize 200B Euros to invest in AI
socialism's new excuse to grab other people's money
pgtan··on Will better superconductors transform the world?
Does someone have stock portfolio of superconductor manufacturer to share? I watch Furukawa, Sumitomo, and AMSC and they are performing not bad.
pgtan··on Exploring Bauhaus: Revolutionary design school that shaped modern world
That article not even mention Bauhaus in Tel Aviv!

https://bauhaus-center.com/bauhaus-in-tel-aviv/

pgtan··on Intel QuickAssist Technology Zstandard Plugin for Zstandard
Well, POWER9 and later CPUs have builtin hardware compression using the 8-4-2 algorithm.

https://en.wikipedia.org/wiki/842_(compression_algorithm)

https://github.com/plauth/lib842

pgtan··on Simple Unix Chat
for builtin security see for example https://unix.stackexchange.com/questions/102746/how-to-invok...
pgtan··on Simple Unix Chat
OK, for starter the while loop. Main rule of writing shell scripts is, Use The Shell, Luke. Don't start external programs, if your shell (which is already running) can do it. "while /usr/bin/true" is nonsense, every time an external program gets executed for nothing. There are plenty of bash (since this shell is used in the example) internals, which evaluate to true, like ":", "test 1", "(( 1 ))", maybe others too. So "while :" should be better. But why even use dummy true statement, since the loop terminates with read? You can put the read as argument to while directly: "while read -r line; do" ... Same with echo and date. Just use one single printf builtin.

while read -r line ; do printf '%(%FT%T%z)T %-9s %s' -1 "$(/usr/bin/id --user --name --real)" "$line" ; done

pgtan··on Simple Unix Chat
This bash code is a parade example how NOT to write scripts.
pgtan··on The Case for Bash (2021)
Well, Kornshell (ksh93) has some nice programming features, much better than bash.
pgtan··on 21y ex Ukrainian math olympiad team member killed by Russian shelling of Charkiv
Yuliya Zdanovska, here in an old team picture:

https://euromaidanpress.com/2017/04/13/ukrainian-schoolgirls...

pgtan··on X Window System on a Floppy
I for myself get annoyed every time I see this misspell. The name is X Window. Even microserfs can learn it.
pgtan··on IBM mainframe beats other platforms for cost and performance
[edit] sorry, I've mistaken the concepts. The name is active memory deduplication, which sits on top on memory sharing.

http://www.redbooks.ibm.com/redpapers/pdfs/redp4827.pdf

[old]

It is called active memory sharing in the POWER world

https://www.ibm.com/docs/en/power9/9080-M9S?topic=sharing-ma...

http://www.redbooks.ibm.com/redpapers/pdfs/redp4470.pdf

pgtan··on Rediscovering Logo with Bob the Turtle
This has nothing to do with Logo, the programming language. It's Python all the way down.
pgtan··on An Opinionated Guide to Xargs
Yes, you are right. Bash 5 on AIX 7.2 works with process substitution. Thanks for the advise!
pgtan··on An Opinionated Guide to Xargs
No, process substitution must be provided by the kernel/syslibs, it is not feature of bash. For example there is bash on AIX, but process substitution is not possible because the OS do not support it.
pgtan··on An Opinionated Guide to Xargs
No idea how old this command is. Most of the AIX/Linux admins I knew were very bad shell programmers, skills end with awfull for-loops, useless use of cat, and awk '{print $3}'.
pgtan··on An Opinionated Guide to Xargs
FWIW AIX also has an apply command

https://www.ibm.com/docs/en/aix/7.2?topic=apply-command

pgtan··on Closing 45% of the open Emacs bugs
I'm disturbed by this awful loop, every time I see `setq' gives me the heretic though, that most of the eslip code is just Perl with parentheses.

  (cl-loop
    for sum = 0 then (+ sum (* total 0.1))
    for total = 100 then (* total 0.9)
    repeat 10
    finally (return (list sum total)))
pgtan··on The LaTeX Font Catalogue
Thanks for sharing! Those must be exciting times. I remember tweaking the fonts only once for printing my diploma thesis back in the 90s; but contrary to the most opinions, I made the fonts even lighter, because of the ultra white paper, we were obliged to print to. It was a very big file due to the 1200dpi rasterized fonts, but the result was better than any print shop could produce at that time.
pgtan··on The LaTeX Font Catalogue
If you have a certain printer to use, you can tweak the Metafont mode for the fonts and create your preferred look. The definitions for various printers are in the file modes.mf

For example:

% From {\tt stsmith@ll.mit.edu}, 10 May 93.

% With |fillin=0|, the diagonal of {\tt cmtt10}'s `z' is too thin.

% |blacker=.8| too thin, 2 too thick.

mode_def docutech = %\[ Xerox 8790 or 4045 (600dpi)

mode_param (pixels_per_inch, 600);

  mode_param (blacker, 1);

  mode_param (fillin, .1);

  mode_param (o_correction, 0.9);

  mode_common_setup_;
enddef;
pgtan··on IBM's 18-month company-wide email system migration has been a disaster: sources
Ha! I saw a very big multinational F500 company completely reorganize its AD, because users were unable to login to Office 365 with their standard accounts user@<location>.company.com. After weeks of complete disasters the company decided to switch to user@company.com just for O365.

It's a hard life as microserf.

pgtan··on KolibriOS
> remember to cut down your kernel.

yes, my Linux kernel is 3.4M, bz2 compressed. Unfortunately, some things are no more possible to get removed from the kernel, like the xattr in ext4.

pgtan··on Using Computer Modern on the web (2013)
Go, learn some (scientific) typography, then try Word, then come again.
pgtan··on Using Computer Modern on the web (2013)
It is you. CM is based on the Modern fonts used in scientific typesetting decades before Knuth made a MF version of it. I had often chance to give non-TeX (coming from humanities) proofreaders and copy-editors the choice between Times and CM. Almost all of them choosed CM.
pgtan··on Guix 1.3
I really would like to see a Gentoo equivalent based on Lisp/Scheme, but as far Guix seems to be not even near. I just looked for no-multilib option (only 64bit of libc), custom compile flags or similar, but didn't find anything.
pgtan··on Why Generation X will save the web
well, Coupland preserved even that aspect of our gen in "Microservs" and "JPod".
pgtan··on History of Logo (2020) [pdf]
this is a brilliant example how awful ugly python with its loops is (also compared to logo)
Page 1 of 6Next →