Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on some basic debian things # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/debian.e> # or at <http://angg.twu.net/e/debian.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.sudo» (to "sudo") # «.sudo-src» (to "sudo-src") # «.debian-menus» (to "debian-menus") # «.debconf» (to "debconf") # «.diversions» (to "diversions") # «.update-mime» (to "update-mime") # «.debhelper-deb-src» (to "debhelper-deb-src") # «.debian-via-pen-drive» (to "debian-via-pen-drive") # «.debian-pen-drive-2020» (to "debian-pen-drive-2020") # «.udeb» (to "udeb") # «.tasksel» (to "tasksel") # «.prep-Contents» (to "prep-Contents") # «.mailcap» (to "mailcap") # «.www-browser» (to "www-browser") # «.alternatives» (to "alternatives") # «.diversions» (to "diversions") # «.debian-version» (to "debian-version") # «.shared-mime-info» (to "shared-mime-info") # «.debian-reference» (to "debian-reference") # Everything related to making or inspecting .debs or moving them to # the right places was moved to dpkg.e. # (find-es "dpkg") # (find-esgrep "grep -nH -e sources.list *.e") # (find-fline "/etc/apt/sources.list") ##### # # sudo # 2000nov17 # ##### # «sudo» (to ".sudo") # (find-es "sudo") # (find-es "cdd" "sudo") # (find-status "sudo") # (find-vldifile "sudo.list") # (find-fline "/usr/doc/sudo/") # (find-man "5 sudoers") # (find-fline "/usr/doc/sudo/examples/sudoers") # (find-fline "/etc/sudoers") ## Edrx changes: ## (find-es "debian" "sudo") ## (find-fline "/usr/share/doc/sudo/examples/sudoers" "User_Alias") ## (find-fline "/usr/share/doc/sudo/examples/sudoers" "\nFULLTIMERS") #* id sudo -u aleph id cat > $EEG <<'---' id sudo id sudo pwd sudo -u aleph id --- eeg su - edrx # done. #* # (find-man "8 visudo") # (find-man "8 visudo" "ENVIRONMENT") # This is a cheap way to make visudo check the syntax of /etc/sudoers. EDITOR=echo visudo EDITOR=touch visudo #* EDITOR=nano visudo #* # (find-man "8 sudo") # (find-man "5 sudoers") # (find-man "5 sudoers" "NOPASSWD and PASSWD") # (find-man "5 sudoers" "\nEXAMPLES") # (find-man "8 visudo") # (find-es "debian" "sudo") User_Alias FULLTIMERS = edrx, aleph, beth FULLTIMERS ALL = NOPASSWD: ALL #* # A problem: edrx can sudo root without password, but not sudo # aleph... # (...) # And the naive way of gdb'ing sudo fails because gdb can't trace suid # processes, I think. Where do the docs say that?? # (find-es "gdb" "zcatinfo-gdb") ##### # # single-stepping through dpkg-source # ##### # debsource $DEBIAN/hamm/hamm/source/utils makepatch 1.13 -3 function debsource () { rm -Rv /usr/src/$2-$3 cd /usr/src/ dpkg-source -x $1/$2_$3$4.dsc cd /usr/src/$2-$3/ } debian/main/source/base/modutils_2.1.85-11.dsc rm -Rv /usr/src/modutils-2.1.85/ cd /usr/src/ rm -Rv ~/modutils-2.1.85/ # (perldb "perl /usr/bin/dpkg-source -x /debian/main/source/base/modutils_2.1.85-11.dsc") # (find-fline "/usr/bin/dpkg-source") # (find-fline "/usr/lib/dpkg/controllib.pl") # (find-fline "/usr/lib/dpkg/") ##### # # lintian # ##### pdsc $SDEBIAN/dists/potato/main/source/devel/lintian_0.9.5.dsc dpkg -i $SDEBIAN/dists/potato/main/binary-all/devel/lintian_0.9.5.deb # (find-fline "/usr/doc/lintian/") # (find-fline "/usr/doc/packaging-manual/") lynx /usr/doc/packaging-manual/packaging.html/index.html lynx /usr/doc/debian/FAQ/debian-faq.html ##### # # First things on ifigenia (to be done by hand) # 00jan31 # ##### # Install slink on /dev/hdb1; select zsh, emacs19 and smail, deselect # everything that is useless. mkdir /home/root emacs /etc/passwd # then remove root's password, copy to a "broot" login, set root's # home to /home/root, set shell to /usr/bin/zsh. cd /home/root mkdir public_html mcopy a:page.tgz cd public_html/ tar -xvzf ../page.tgz cd a/ cp .emacs .. cp eev.el .. cp .zshrc .. # log as root (now using zsh and /home/root). ##### # # On ifigenia, after the slink install, after page.tgz # 00jan30 # ##### mkdir /C mount /dev/hda1 /C -t vfat mkdir -p /C/edrx mount /dev/cdrom /cdrom cd /cdrom/tools/lodlin16/ cp -v loadlin.exe /C/edrx/ cp -v /vmlinuz /C/edrx/k20xx cat > /C/edrx/b1.bat <<'---' smartdrv /C c:\edrx\loadlin c:\edrx\k20xx root=/dev/hdb1 ro vga=1 --- cat > /C/edrx/README <<'---' Use F8 to boot DOS instead of Windows cd \edrx b1 --- # (find-fline "/cdrom/tools/lodlin16/") # (find-fline "/C/edrx/") # Prepare for telnets: # (find-fline "~/EXPECT/ifigenia") adduser edrx emacs /etc/passwd ##### # # dict # 99dec15 # ##### Pgrep m/dictionary/i dmissing usr/dict apti dict dictd dict-foldoc dict-jargon # (find-vldifile "dictd.list") # (find-vldifile "dictd.postinst" "uncomment") # (find-fline "/etc/dictd.conf" "database jargon") /etc/init.d/dictd restart dict hacker # (find-vldifile "dict.list") # (find-fline "/usr/doc/dict/") # (find-vldifile "dict-foldoc.list") # (find-fline "/usr/doc/dict-foldoc/") # (find-vldifile "dictd.list") # (find-fline "/usr/doc/dictd/") gzip -cd < /usr/share/dictd/foldoc.dict.dz > /tmp/foldoc.dict # (find-fline "/tmp/foldoc.dict") ##### # # The Debian menu system # 2000apr15 # ##### # «debian-menus» (to ".debian-menus") # (find-node "(menu)Top") # (find-node "(menu)Top" "update-menus") # (find-node "(menu)Section 3.1" "Location" "~/.menu/") # (find-node "(menu)Section 7.1" "The update-menus program") # (find-zsh "dmissing menu-policy") # (find-sh "locate /menu/") # (find-fline "/usr/share/doc/menu/") # (find-fline "/usr/share/menu/") # (find-udfile "menu/") # (find-udfile "menu/examples/") # (find-udfile "menu/menu.txt.gz") # (find-fline "/usr/share/doc/debian-policy/menu-policy.txt.gz") # (find-fline "/usr/lib/menu/") # (find-fline "/usr/doc/menu/") ##### # # debconf # 2001aug02 # ##### # «debconf» (to ".debconf") # (find-status "debconf-tiny") # (find-vldifile "debconf-tiny.list") # (find-fline "/var/lib/debconf") # (find-status "debconf") # (find-vldifile "debconf.list") # (find-fline "/usr/doc/debconf/") # (find-fline "/usr/doc/debconf/introduction.txt.gz") # (find-fline "/usr/doc/debconf/introduction.txt.gz" "suppress the questions") # (find-fline "/usr/doc/debconf/usersguide.txt.gz") # (find-fline "/usr/doc/debconf/usersguide.txt.gz" "libterm-readline-gnu-perl") # (find-fline "/usr/doc/debconf/usersguide.txt.gz" "DEBCONF_FRONTEND=") # (find-fline "/usr/doc/debconf/tutorial.txt.gz") # (find-fline "/usr/doc/debconf/specification.txt.gz" "The configuration space") dpkg -l --root=/var/_subdebian # (find-subdebfile " # (eeman "3 confmodule") # (eeman "3 Debian::Debconf::Client::ConfModule") # (eeman "8 dpkg-reconfigure") # (eeman "8 dpkg-preconfigure") ##### # # diversions # 2004oct16 # ##### # «diversions» (to ".diversions") # (find-status "pentium-builder") # (find-vldifile "pentium-builder.list") # (find-udfile "pentium-builder/") # (find-vldifile "pentium-builder.preinst") # (find-vldifile "pentium-builder.postinst") # (find-vldifile "pentium-builder.prerm") # (find-vldifile "pentium-builder.postrm") # (find-man "8 dpkg-divert") # (find-fline "/var/lib/dpkg/diversions") # (find-man "1 builder-cc") # (find-man "1 builder-c++") # (find-udfile "pentium-builder/changelog.gz") # (find-udfile "pentium-builder/copyright") # (find-udfile "pentium-builder/README.Debian") # (find-fline "/usr/bin/builder-c++") # (find-fline "/usr/bin/builder-cc") # (find-fline "/usr/bin/gcc") # (find-fline "/usr/bin/g++") ##### # # debhelper (from the debian sources) # 2008sep02 # ##### # «debhelper-deb-src» (to ".debhelper-deb-src") # http://ftp.debian.org/debian/pool/main/d/debhelper/ # http://ftp.debian.org/debian/pool/main/d/debhelper/debhelper_7.0.17.dsc # http://ftp.debian.org/debian/pool/main/d/debhelper/debhelper_7.0.17.tar.gz #* rm -Rv ~/usrc/debhelper/ mkdir ~/usrc/debhelper/ cd $S/http/ftp.debian.org/debian/pool/main/d/debhelper/ cp -v debhelper_7.0.17* ~/usrc/debhelper/ cd ~/usrc/debhelper/ dpkg-source -sn -x debhelper_7.0.17.dsc cd ~/usrc/debhelper/debhelper-7.0.17/ dpkg-buildpackage -us -uc -b -rfakeroot |& tee odb # dpkg-buildpackage -d -us -uc -b -rfakeroot |& tee odb #* # (find-fline "~/usrc/debhelper/") * (eepitch-shell) cd ~/usrc/debhelper/ sudo dpkg -i *.deb #* # (code-c-d "debhelper" "~/usrc/debhelper/debhelper-7.0.17/") # (find-debhelperfile "") # Unfinished: hard to compile on etch :-\ ##### # # Installing Debian via an ISO in a pen drive # 2012may23 # ##### # «debian-via-pen-drive» (to ".debian-via-pen-drive") # http://wiki.debian.org/BootUsb # http://wiki.debian.org/StandardPendrive # http://www.debian.org/CD/faq/ # http://www.debian.org/CD/faq/#write-usb # (find-fline "/sda5/torrents/" "debian-6.0.4-i386-CD-1.iso") # (find-fline "/sda5/torrents/" "debian-6.0.4-i386-DVD-1.iso") # Test the ISO image (as a .iso file in the HD): * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd sudo umount /tmp/loop/ mkdir /tmp/loop/ #sudo mount -o loop,ro /sda5/torrents/debian-6.0.4-i386-CD-1.iso /tmp/loop/ sudo mount -o loop,ro /sda5/torrents/debian-6.0.4-i386-DVD-1.iso /tmp/loop/ # (find-fline "/tmp/loop/") cd /tmp/loop/ && time md5sum -c md5sum.txt |& tee /tmp/o # time: 13:55.20 total cd sudo umount /tmp/loop/ # Record the DVD image into the pen drive: # (find-sh "dmesg") # * (eepitch-shell2) * (eepitch-kill) * (eepitch-shell2) sudo umount /tmp/pen/ #sudo dd if=/sda5/torrents/debian-6.0.4-i386-CD-1.iso of=/dev/sdb bs=4M; sync #sudo dd if=/sda5/torrents/debian-6.0.4-i386-DVD-1.iso of=/dev/sdb bs=4M; sync sudo dd if=/sda7/DVDs/debian-7.0.0-i386-DVD-1.iso of=/dev/sdb bs=4M; sync # 4695957504 bytes (4.7 GB) copied, 1348.72 s, 3.5 MB/s # Test the iso image in the pen drive: # * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) mkdir /tmp/pen/ sudo mount -o ro /dev/sdb /tmp/pen/ # (find-fline "/tmp/pen/") # (find-fline "/tmp/pen/pool/main/l/") # (find-fline "/tmp/pen/pool/main/l/" "linux") cd /tmp/pen/ time md5sum -c md5sum.txt |& tee /tmp/o2 cd sudo umount /tmp/pen/ # cpu 4:45.24 total (with some stuff cached) # 2013jun21: # (find-sh "locate debian-7") cp -v /sda7/DVDs/debian-7.0.0-i386-DVD-1.iso /tmp/pen/ ##### # # debian-pen-drive-2020 # 2020feb11 # ##### # «debian-pen-drive-2020» (to ".debian-pen-drive-2020") # https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso # https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/MD5SUMS # (find-debian-version-links) * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) mount sudo umount /dev/sdb laf /dev/sd* cd $S/https/cdimage.debian.org/debian-cd/current/amd64/iso-cd/ md5sum -c MD5SUMS sudo dd if=debian-10.3.0-amd64-netinst.iso of=/dev/sdb status=progress sudo sync # (find-man "dd") ##### # # What is a udeb? # 2012nov01 # ##### # «udeb» (to ".udeb") # http://d-i.alioth.debian.org/doc/talks/debconf6/paper/ # http://en.wikipedia.org/wiki/Deb_(file_format) ##### # # Tasksel # 2013jul08 # ##### # «tasksel» (to ".tasksel") # (find-es "print" "task-print-server") # (find-sh "sudo tasksel --help") # (find-sh "sudo tasksel --list-tasks") # (find-sh "sudo tasksel --task-packages print-server") # (find-man "8 tasksel") # (find-zsh "dmissing tasksel") # (find-status "tasksel") # (find-vldifile "tasksel.list") # (find-udfile "tasksel/") # (find-status "tasksel-data") # (find-vldifile "tasksel-data.list") # (find-udfile "tasksel-data/") # (find-fline "/usr/lib/tasksel/tests/") # (find-fline "/usr/bin/tasksel") ##### # # Download the Contents-i386 file (for dmissing) # 2013aug06 # ##### # «prep-Contents» (to ".prep-Contents") # (find-angg ".zshrc" "dmissing") # http://ftp.debian.org/debian/dists/wheezy/Contents-i386.gz * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd $S/http/ftp.debian.org/debian/dists/wheezy/ zcat Contents-i386.gz > Contents-i386 dmissing pm-suspend ##### # # update-mime # 2008sep01 # ##### # «update-mime» (to ".update-mime") # (find-status "evince") # (find-vldifile "evince.list") # (find-udfile "evince/") # (find-vldifile "evince.postinst") # (find-vldifile "evince.prerm") # (find-vldifile "evince.postrm") # (find-vldifile "evince.postrm" "update-mime") # (find-vldifile "evince.md5sums") # (find-vldifile "evince.shlibs") # (find-fline "/usr/share/gconf/schemas/evince-thumbnailer-djvu.schemas") # (find-fline "/usr/share/gconf/schemas/evince-thumbnailer-dvi.schemas") # (find-fline "/usr/share/gconf/schemas/evince-thumbnailer.schemas") # (find-fline "/usr/share/gconf/schemas/evince.schemas") # (find-fline "/usr/lib/mime/packages/evince") # (find-fline "/usr/lib/mime/packages/") # (find-fline "/usr/lib/mime/packages/texlive-base-bin") # (find-fline "/usr/lib/mime/packages/xpdf-reader") # (find-man "8 update-mime") # (find-fline "/etc/mailcap") # (find-man "5 mailcap.order") # (find-fline "/etc/mailcap.order") # (find-fline "/etc/mime.types") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) R update-mime exit # (find-status "mime-support") # (find-vldifile "mime-support.list") # (find-udfile "mime-support/") # (find-man "1 see") # (find-man "1 edit") # (find-man "1 compose") # (find-man "1 print") # From bug-gnu-emacs: # https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg01552.html This seems to be working as designed. The mimetypes come from `mailcap-parse-mimetypes' that parses a bunch of different files, including "/etc/mime.types", where on my system I find this line: text/x-perl pl pm So I think you should raise this with your GNU/Linux distribution to get the "application/x-perl" line added, if that's the right thing to do. You can also add such a line to "~/.mime.types" and it will work as expected. ##### # # mailcap # 2013sep04 # ##### # «mailcap» (to ".mailcap") # (find-es "ps" "default-pdf-viewer") # (find-es "ps" "see") # https://wiki.debian.org/Manual-Howto # https://wiki.debian.org/Manual-Howto#Change_default_editor # https://wiki.debian.org/Manual-Howto#Change_default_pdf_viewer # http://lists.debian.org/debian-user/2011/11/msg01265.html # http://forums.mozillazine.org/viewtopic.php?t=405019 # http://forums.debian.net/viewtopic.php?f=10&t=1720 # (find-debpkg-links "evince") # (find-vldifile "evince.postinst") # (find-status "evince" "pdf-viewer") # (find-fline "/usr/lib/mime/packages/evince") # (find-fline "/usr/bin/sensible-browser") # (find-fline "/usr/bin/sensible-editor") # (find-fline "/usr/bin/sensible-pager") # (find-fline "/usr/lib/mime/packages/sensible-utils") # (find-man "5 mailcap") # (find-man "5 mailcap.order") # (find-man "5 mailcap.order" "~/.mailcap") # (find-man "1 run-mailcap") # (find-man "8 update-mime") # (find-fline "/etc/mailcap") # (find-fline "/etc/mailcap.order") # (find-sh "grep pdf /etc/mailcap") # (find-fline "~/.mailcap") # (find-man "1 see") # (find-fline "/usr/bin/see") # (find-sh "see --norun --debug ~/LATEX/rrj.pdf") # (find-man "8 apt-cache") # (find-sh "apt-cache showpkg pdf-viewer") # This seems to be an OK way to force a default - for example, to make # evince the default for viewing PDFs... # 1) grep the relevant lines from /etc/mailcap # 2) copy all of them to ~/.mailcap # 3) comment out the ones that mention other programs that are not # evince # 4) test with "see --norun" or "see --norun --debug" # (find-sh "grep pdf /etc/mailcap") # (find-fline "~/.mailcap") # (find-sh "see --norun ~/LATEX/rrj.pdf") # (find-sh "see --norun --debug ~/LATEX/rrj.pdf") ##### # # www-browser # 2017ago01 # ##### # «www-browser» (to ".www-browser") # (find-sh "apt-cache search www-browser") # (find-sh "locate browser") # (find-fline "/etc/alternatives/") # (find-fline "/etc/alternatives/x-www-browser") # (find-fline "/usr/bin/" "gnome-www-browser") # (find-fline "/usr/bin/" "infobrowser") # (find-fline "/usr/bin/" "sensible-browser") # (find-fline "/usr/bin/" "x-www-browser") ##### # # alternatives # 2017ago01 # ##### # «alternatives» (to ".alternatives") # (find-fline "/etc/alternatives/README") # (find-fline "/etc/alternatives/") # (find-man "1 update-alternatives") # (find-sh "update-alternatives --help") # (find-sh "update-alternatives --get-selections") # (find-sh "update-alternatives --get-selections --verbose") # (find-sh "update-alternatives --display cc") # (find-vldifile "") # (find-vldigrep "grep -nH -e update-alternatives *") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) update-alternatives --get-selections update-alternatives --get-selections | awk '{print $1}' | uniq | tee /tmp/og for i in $(cat /tmp/og); do echo; update-alternatives --display $i; done |& tee /tmp/og2 # (find-fline "/tmp/og2") ##### # # diversions # 2022sep03 # ##### # «diversions» (to ".diversions") # (find-sh "locate diversions") # (find-fline "/var/lib/dpkg/diversions") # (find-fline "~/LOGS/2022sep03.emacs" "dpkg -S /usr/bin/cdecl") # (find-man "1 dpkg") # (find-man "1 dpkg" "-S, --search") # (find-sh "dpkg -S /usr/bin/cdecl") # https://www.debian.org/doc/debian-policy/ap-pkg-diversions.html # https://wiki.debian.org/DpkgDiversions # (find-man "1 dpkg-divert") ##### # # debian-version # 2020feb11 # ##### # «debian-version» (to ".debian-version") # https://linuxize.com/post/how-to-check-your-debian-version/ # https://linuxconfig.org/check-what-debian-version-you-are-running-on-your-linux-system # https://www.debian.org/releases/ # https://www.debian.org/doc/manuals/debian-faq/ # https://www.debian.org/doc/manuals/debian-faq/getting-debian.en.html#version # https://en.wikipedia.org/wiki/Debian_version_history # (find-status "lsb-release") # (find-vldifile "lsb-release.list") # (find-udfile "lsb-release/") # (find-fline "/usr/bin/lsb_release") # (find-man "1 lsb_release") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cat /etc/issue cat /etc/debian_version cat /etc/os-release lsb_release -da hostnamectl # (find-fline "/usr/bin/lsb_release") # (find-fline "/usr/lib/python2.7/dist-packages/") # (find-fline "/usr/lib/python3/dist-packages/") # (find-fline "/usr/share/bug/lsb-release") # (find-udfile "lsb-release/README.Debian") # (find-udfile "lsb-release/changelog.gz") # (find-man "1 lsb_release") # (find-fline "/usr/share/pyshared/lsb_release.py") # (find-fline "/usr/lib/python2.7/dist-packages/lsb_release.py") # (find-fline "/usr/lib/python3/dist-packages/lsb_release.py") ##### # # Why "Processing triggers for shared-mime-info (2.0-1)" takes so long # 2021sep10 # ##### # «shared-mime-info» (to ".shared-mime-info") # (find-status "shared-mime-info") # (find-vldifile "shared-mime-info.list") # (find-udfile "shared-mime-info/") ##### # # debian-reference # 2023feb05 # ##### # «debian-reference» (to ".debian-reference") # (find-status "debian-reference") # (find-vldifile "debian-reference.list") # (find-udfile "debian-reference/") # (find-status "debian-reference-en") # (find-vldifile "debian-reference-en.list") # (find-udfile "debian-reference-en/") # (find-status "debian-reference-common") # (find-vldifile "debian-reference-common.list") # (find-udfile "debian-reference-common/") # file:///usr/share/doc/debian-reference/docs/index.en.html # file:///usr/share/doc/debian-reference/docs/debian-reference.en.pdf # (find-vldifile "auctex.templates") # (find-vldifile "base-config.templates") # (find-vldifile "clanlib0-common.templates") # (find-vldifile "cvs.templates") # (find-vldifile "debconf.templates") # (find-vldifile "esound-common.templates") # (find-vldifile "gmc.templates") # (find-vldifile "gnuplot.templates") # (find-vldifile "lynx.templates") # (find-vldifile "mysql-server.templates") # (find-vldifile "netbase.templates") # (find-vldifile "ppp.templates") # (find-vldifile "setserial.templates") # (find-vldifile "ssh.templates") https://debian-handbook.info/browse/stable/ # Local Variables: # coding: utf-8-unix # End: