Thursday, December 3, 2015

Saturday, November 28, 2015

TTY

http://a3nm.net/blog/unbuffering.html
http://technostuff.blogspot.ru/2008/10/some-useful-socat-commands.html
http://rdiez.shoutwiki.com/wiki/Serial_Port_Tips_for_Linux
http://www.linusakesson.net/programming/tty/
http://wiki.bash-hackers.org/howto/redirection_tutorial

Thursday, November 5, 2015

AVR

Extremely useful articles:
http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers-reading-and-writing-data/
http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers/

atmega168/328p: avrdude -c usbasp -p <MCU> -U lfuse:w:0xff:m -U hfuse:w:0xd7:m -U efuse:w:0x07:m -qq

FUSE:
-U lfuse:w:0xFF:m
tick EEPROM
untick BOOTRST, untick BOOTSZ*
untick all BODLEVEL

http://eleccelerator.com/fusecalc/fusecalc.php
http://www.martyncurrey.com/arduino-atmega-328p-fuse-settings/

http://www.appelsiini.net/2011/simple-usart-with-avr-libc

Read comments here: https://github.com/tuupola/avr_demo/blob/master/blog/simple_usart/Makefile

Thursday, October 15, 2015

lmfonts

https://www.tug.org/TUGboat/tb24-1/jackowski.pdf
http://texdoc.net/texmf-dist/doc/fonts/lm/lm-info.pdf

Monday, September 21, 2015

Command to stop torrent(s) downloading: transmission-remote r -AS

Tuesday, August 11, 2015

TeX QUESTIONS

1) only ^^M (i.e., catcode 5) is changed to \par in state N

2) only ^^M (i.e., catcode 5) is changed to space

3) what if catcode of ^^M is changed? Theoretically it may have undesired effects, if it stays before \par - try to find an example which shows this (see http://tex.stackexchange.com/questions/259218/how-tex-reads-what-you-type)

Monday, August 10, 2015

Tuesday, August 4, 2015

TEX_DEBUG

mkdir Work && cd Work
../configure --disable-all-pkgs --enable-shared --with-system-kpathsea --disable-native-texlive-build
make
cd texk/web2c/
pluma Makefile # change CFLAGS and CXXFLAGS to -ggdb
pluma web2c/Makefile # change CFLAGS to -ggdb
pluma lib/Makefile # change CFLAGS and CXXFLAGS to -ggdb
make tex

Saturday, August 1, 2015

how_to_see_symbol

mf cmr10
  see in log output in which file is required symbol
  copy from that file definition of this symbol to ./test.mf
mf rtest

---

mf csbx10
mktextfm gray
mktextfm black
gftodvi csbx10.2602gf
dvipdfmx -l csbx10.dvi

Thursday, July 30, 2015

dmfonts

http://tug.ctan.org/obsolete/fonts/dmfonts.zip # take only dm* files, ignore [o]odm* file[s]
ftp://ctan.org/tex-archive/systems/msdos/sbtex/dvf04.doc

Thursday, June 25, 2015

Literate Programming
See if there is something useful here and delete afterwards:
https://www.tug.org/TUGboat/tb10-3/tb25vulis.pdf
https://www.tug.org/TUGboat/tb16-3/tb48soj1.pdf
ftp://ftp.fi.muni.cz/pub/tex/local/fontware/accents/

Sunday, May 24, 2015

SPACES

\newlanguage\mylang
\def\my{\mylang}
\char\my 2

\char\mylang 2

%*
\def\ym{1}
\char\ym 2

\def\mm{1 }
\char\mm 2

\chardef\yy=1
\char\yy 2

%*
\def\xx{\chardef\zz=1}
\xx 2
\char\zz

\def\aa{\chardef\bb=1 }
\aa 2
\char\bb 3

\def\cc{\chardef\dd=1\relax}
\cc 2
\char\dd

\bye % ---------------------

\language4
\hyphenation{ab-cdef}

\language42
\hyphenation{abc-def}

\def\ff{
  \language4%
}
\ff 2
\showhyphens{abcdef} % language4

\def\gg{
  \language\mylang
}
\gg 2
\showhyphens{abcdef} % language4

\def\hh{\language4 }
\hh 2
\showhyphens{abcdef} % language42

Friday, May 8, 2015

UNICODE

http://www.endmemo.com/unicode/unicodeconverter.php
http://unicodelookup.com/
http://www.ltg.ed.ac.uk/~richard/utf-8.cgi
http://www.rapidtables.com/convert/number/binary-converter.htm

perl -C2 -le 'print pack("U0W*", hex("d0"), hex("81"))'

perl -Mutf8 -le 'print join " ", unpack("U0(H2)*", pack("U", ord "Ё"))'

Friday, March 13, 2015

When making a reserve copy of file, name it not by adding .orig or .old, but instead prepending SAVE, not to inadvertently remove original.

"find" gotcha

if you use -prune, add '-o [ -name .... ] -print' at the end, and instead of -name must be -path ./...

Tuesday, February 17, 2015

gpg -o doc.gpg --symmetric doc
gpg -o doc -d doc.gpg # if you don't specify '-o ...' it will go to stdout

Wednesday, February 11, 2015

Makefile

.PHONY: test.pdf test.dvi fonts

test.pdf: test.dvi
	dvipdfmx $<
	mv $@ /tex_tmp/
	rm $< test.log
	evince /tex_tmp/$@

test.dvi: test.tex
	tex \\let\\pdf+ \\input $<

fonts:
	echo cmtt10 | tex \\input testfont \\table \\end
	dvipdfmx testfont.dvi
	mv testfont.pdf /tex_tmp/cmtt.pdf
	echo cmr10 | tex \\input testfont \\table \\end
	dvipdfmx testfont.dvi
	rm testfont.dvi testfont.log
	mv testfont.pdf /tex_tmp/cmr.pdf
	evince /tex_tmp/cmr.pdf /tex_tmp/cmtt.pdf

Monday, February 9, 2015

TeX example

Understand how this works:
\vbox{
\def\1{\vrule height 0pt depth 2pt}
\def\2{\vrule height 0pt depth 4pt}
\def\3{\vrule height 0pt depth 6pt}
\def\4{\vrule height 0pt depth 8pt}
\def\ruler#1#2#3{\leftline{$\vcenter{\hrule\hbox{\4#1}}\,\,\rm#2\,{#3}$}}
\def\\#1{\hbox to .125in{\hfil#1}}
\def\8{\\\1\\\2\\\1\\\3\\\1\\\2\\\1\\\4}
\ruler{\8\8\8\8}4{in}}
\end

Sunday, February 8, 2015

Set theory axioms.
Construct models for set theory.
Don't work with sentences, work with models.
Read Paul Cohen - Set Theory and the Continuum Hypothesis.

Thursday, February 5, 2015

For explanation of LANG vs. LC_ALL vs. LC_CTYPE see https://www.tug.org/TUGboat/tb19-3/tb60bzyl.pdf

Wednesday, January 28, 2015

Double quotes in TeX

\lq{}\lq\lq\ = \rq\thinspace\rq\rq
\lq\lq\thinspace\lq\ = \rq\rq{}\rq\ = \rq\rq\rq

Run
  tftopl cmr10.tfm cmr10.pl
and in cmr10.pl see KRN and other stuff for characters '42, '47, '140, '134 to understand why spaces after different types of quotes are the way they are. (\lq\lq and \rq\rq form ligatures)

Run this to understand what those numbers mean:
\obeylines
\char'42
\char'47
...
\bye

-----------

To understand how tfm files work, do this:

change something in cmr10.pl, for example in "(LABEL C v)", then generate new cmr10.tfm, then
use this test.tex:

\showboxbreadth \maxdimen
\showboxdepth \maxdimen
\setbox0=\hbox{va}
\showbox0
\bye

and see log file to check how those change worked

TeX QUESTIONS

* Is empty control sequence (\csname\endcsname) of any practical use at all? (see example about empty control sequence in http://tug.org/TUGboat/tb35-1/tb109knut.pdf)
* For what reason \lowercase{} and \uppercase{} is done a savoir in stomach and not in mouth?

Friday, January 23, 2015

Number of days in month

Number of days in current month:
date -d "$(date +%Y-%m)-01 -1 day +1 month" +%d
Number of days in any year and month:
date -d "$YEAR-$MONTH-01 -1 day +1 month" +%d