user:sachy:lakatux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:sachy:lakatux [2022/10/09 13:20] – MIDI over USB sachy | user:sachy:lakatux [2023/09/10 09:16] (current) – novy patch sachy | ||
---|---|---|---|
Line 3: | Line 3: | ||
Ani balik neodstranis, | Ani balik neodstranis, | ||
- | ==== Vira duveru prenasi ==== | + | ===== Vira duveru prenasi |
< | < | ||
Line 10: | Line 10: | ||
</ | </ | ||
- | ==== Fixovani hipstrovin ==== | + | ===== Fixovani hipstrovin |
Edit "/ | Edit "/ | ||
Line 24: | Line 24: | ||
- | ==== clubmate ==== | + | ===== clubmate |
< | < | ||
Line 37: | Line 37: | ||
</ | </ | ||
- | ==== Nebezpecny SW pod jinym uzivatelem ==== | + | ===== Nebezpecny SW pod jinym uzivatelem |
Odriznuti prohlizece nebo jineho nebezpecneho SW od dat bezneho uzivatele (sachy) tim, ze se bude spoustet pod vlastnim neprivilegovanym uzivatelem (ffuser). Obdobne pro jiny crapware... | Odriznuti prohlizece nebo jineho nebezpecneho SW od dat bezneho uzivatele (sachy) tim, ze se bude spoustet pod vlastnim neprivilegovanym uzivatelem (ffuser). Obdobne pro jiny crapware... | ||
Line 64: | Line 64: | ||
</ | </ | ||
- | ==== Finch a jeho zavislosti ==== | + | ===== Finch a jeho zavislosti |
Finch je TUI irc/ | Finch je TUI irc/ | ||
Line 117: | Line 117: | ||
Profit! | Profit! | ||
- | ==== mutt ==== | + | ===== mutt ===== |
=== Zvyraznovac dulezitych headeru v muttu === | === Zvyraznovac dulezitych headeru v muttu === | ||
Line 209: | Line 209: | ||
<code diff mutt_save_file_perm.patch> | <code diff mutt_save_file_perm.patch> | ||
- | --- PATCHES~ | + | diff -Naru /s/mutt-2.2.12/ |
- | +++ PATCHES | + | --- / |
- | @@ -1,0 +1 @@ | + | +++ ./ |
- | +patch.1.14.6.ms.sfp.1 | + | @@ -250,6 +250,8 @@ |
- | diff /s/mutt-1.14.6/globals.h ./globals.h | + | WHERE short ScoreThresholdRead; |
- | 234a235 | + | WHERE short ScoreThresholdFlag; |
- | > WHERE short SaveFilePerm; | + | |
- | diff /s/mutt-1.14.6/init.h ./init.h | + | +WHERE short SaveFilePerm; |
- | 3138a3139,3143 | + | + |
- | > { " | + | # |
- | > /* | + | WHERE short SidebarWidth; |
- | > ** This variable controls the permissions of saved attachments. | + | WHERE LIST *SidebarWhitelist; |
- | > ** Use standard POSIX permissions in octal notation, i.e. 0644. | + | diff -Naru /s/mutt-2.2.12/init.h ./init.h |
- | > */ | + | --- /s/mutt-2.2.12/init.h 2023-09-01 08: |
- | diff /s/mutt-1.14.6/main.c ./main.c | + | +++ ./init.h 2023-09-10 10: |
- | 669c669,672 | + | @@ -3460,6 +3460,11 @@ |
- | < umask (077); | + | ** \fBNote:\fP This only applies to mbox and MMDF folders, Mutt does not |
- | --- | + | ** delete MH and Maildir directories. |
- | > if(SaveFilePerm==600) | + | */ |
- | > umask (077); | + | + |
- | > else | + | + |
- | > umask (000); | + | + |
- | diff /s/mutt-1.14.6/muttlib.c ./ | + | + |
- | 2498a2499,2514 | + | + |
- | > /* Convert file permission from decadic to octal */ | + | { " |
- | > unsigned short own=0; | + | /* |
- | > unsigned short grp=0; | + | ** .pp |
- | > unsigned short oth=0; | + | diff -Naru /s/mutt-2.2.12/main.c ./main.c |
- | > unsigned short SFPoct=0; | + | --- / |
- | > own=SaveFilePerm/ | + | +++ ./ |
- | > grp=(SaveFilePerm-own*100)/ | + | @@ -690,7 +690,10 @@ |
- | > oth=SaveFilePerm-(own*100)-(grp*10); | + | mutt_error = mutt_nocurses_error; |
- | > if(own> | + | |
- | > { | + | SRAND (time (NULL)); |
- | > SFPoct=0600; | + | - |
- | > dprint(1, | + | + |
- | > } | + | + |
- | > else | + | + |
- | > SFPoct=own<< | + | + |
- | > | + | |
- | 2510c2526 | + | |
- | < if ((fd = open (mutt_b2s (safe_file), | + | |
- | --- | + | diff -Naru /s/mutt-2.2.12/muttlib.c ./ |
- | > if ((fd = open (mutt_b2s (safe_file), | + | --- / |
- | 2525c2541 | + | +++ ./ |
- | < if ((fd = open (path, flags & ~O_EXCL, 0600)) < 0) | + | @@ -2562,6 +2562,22 @@ |
- | --- | + | BUFFER *safe_file = NULL; |
- | > if ((fd = open (path, flags & ~O_EXCL, SFPoct)) < 0) | + | |
+ | |||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | if (flags & O_EXCL) | ||
+ | { | ||
+ | safe_file = mutt_buffer_pool_get (); | ||
+ | @@ -2573,7 +2589,7 @@ | ||
+ | goto cleanup; | ||
+ | } | ||
+ | |||
+ | - | ||
+ | + | ||
+ | { | ||
+ | rmdir (mutt_b2s (safe_dir)); | ||
+ | goto cleanup; | ||
+ | @@ -2588,7 +2604,7 @@ | ||
+ | } | ||
+ | } | ||
+ | |||
+ | - | ||
+ | + | ||
+ | goto cleanup; | ||
+ | |||
+ | /* make sure the file is not symlink */ | ||
</ | </ | ||
Line 283: | Line 321: | ||
</ | </ | ||
- | ==== URL MitM ==== | + | === Export message as .eml === |
+ | |||
+ | Sometimes third party requires an .eml message to be send as a " | ||
+ | |||
+ | Make sure to have ' | ||
+ | <code muttrc muttrc> | ||
+ | macro index,pager s "| ~/ | ||
+ | set pipe_decode=yes | ||
+ | </ | ||
+ | |||
+ | And now the script to store the email to the /tmp | ||
+ | <code bash file_email.sh> | ||
+ | # | ||
+ | # Save piped email to " | ||
+ | # Make sure commands ' | ||
+ | |||
+ | # Don't overwrite existing file | ||
+ | set -o noclobber | ||
+ | |||
+ | message=$(cat) | ||
+ | |||
+ | maildate=$(<<<" | ||
+ | fdate=$(date -d " | ||
+ | subject=$(<<<" | ||
+ | |||
+ | if [[ " | ||
+ | echo " | ||
+ | exit 1 | ||
+ | elif [[ " | ||
+ | echo " | ||
+ | fi | ||
+ | |||
+ | echo " | ||
+ | |||
+ | exit | ||
+ | </ | ||
+ | |||
+ | ===== URL MitM ===== | ||
Nektera dialogova okna maji klikaci odkaz u ktereho nejde zjistit cilova adresa, nebo se crapware snazi otevrit nejaky web sam od sebe. Resenim je nahradit vychozi browser dialogovym oknem, ktery onen odkaz zobrazi. | Nektera dialogova okna maji klikaci odkaz u ktereho nejde zjistit cilova adresa, nebo se crapware snazi otevrit nejaky web sam od sebe. Resenim je nahradit vychozi browser dialogovym oknem, ktery onen odkaz zobrazi. | ||
Line 314: | Line 389: | ||
</ | </ | ||
- | ==== Zniceni .xsession-errors ==== | + | ===== Zniceni .xsession-errors |
V HOME se tvori zbytecny, obrovsky log .xsession-errors a .xsession-errors.old. Presmerovani do /dev/null nepomaha, Xka si ho zase nahradi za bezny soubor. | V HOME se tvori zbytecny, obrovsky log .xsession-errors a .xsession-errors.old. Presmerovani do /dev/null nepomaha, Xka si ho zase nahradi za bezny soubor. | ||
Line 324: | Line 399: | ||
</ | </ | ||
- | ==== Snizovani zbytecneho IO ==== | + | ===== Snizovani zbytecneho IO ===== |
v /etc/fstab se da pripojovat filesystem s volbami " | v /etc/fstab se da pripojovat filesystem s volbami " | ||
Line 348: | Line 423: | ||
</ | </ | ||
- | ==== Nenazrane pulseaudio ==== | + | ===== Nenazrane pulseaudio |
Pulseaudio si v /dev/shm dela 64MiB binarni bloby (pulseaudio-shm-*) a NEMAZE je po sobe, cimz efektivne zere " | Pulseaudio si v /dev/shm dela 64MiB binarni bloby (pulseaudio-shm-*) a NEMAZE je po sobe, cimz efektivne zere " | ||
Line 360: | Line 435: | ||
</ | </ | ||
- | ==== Nefunkcni suspend (uspani do RAM) ==== | + | ===== Nefunkcni suspend (uspani do RAM) ===== |
Devuan (MATE 1.8) se neumi uspat do RAM i s nainstalovanym acpi a pm-utils. Je potreba vyresit uspani a zaroven zamkuti obrazovky (pm-suspend jen uspi, ale nezamkne). | Devuan (MATE 1.8) se neumi uspat do RAM i s nainstalovanym acpi a pm-utils. Je potreba vyresit uspani a zaroven zamkuti obrazovky (pm-suspend jen uspi, ale nezamkne). | ||
Line 378: | Line 453: | ||
action=/ | action=/ | ||
- | ==== Zakazani diskretni nvidie ==== | + | ===== Zakazani diskretni nvidie |
Kdyz diskretni grafika jenom zere baterku a nani potreba, tak se da defaultne vypnout: | Kdyz diskretni grafika jenom zere baterku a nani potreba, tak se da defaultne vypnout: | ||
Line 394: | Line 469: | ||
</ | </ | ||
- | ==== Firefox searchplugin ==== | + | ===== Firefox searchplugin |
Vyhledavac [[https:// | Vyhledavac [[https:// | ||
Line 430: | Line 505: | ||
Ulozit do .mozilla/ | Ulozit do .mozilla/ | ||
- | ==== Disable USB automount === | + | ===== Disable USB automount === |
echo ' | echo ' | ||
- | ==== Debian/ | + | ===== Debian/ |
Nejaky idiot implementoval default, ze kdyz pri bootu neni link na eth, tak se musi pockat 90s a on se mozna zazracne objevi. | Nejaky idiot implementoval default, ze kdyz pri bootu neni link na eth, tak se musi pockat 90s a on se mozna zazracne objevi. | ||
Line 439: | Line 514: | ||
Reseni je snadne: na zacatek / | Reseni je snadne: na zacatek / | ||
- | ==== Rychlejsi internety ==== | + | ===== Rychlejsi internety |
[[https:// | [[https:// | ||
Line 448: | Line 523: | ||
</ | </ | ||
- | ==== .nanorc ==== | + | ===== .nanorc |
< | < | ||
Line 459: | Line 534: | ||
</ | </ | ||
- | ==== URL v xattr ==== | + | ===== URL v xattr ===== |
Nejaky debil vymyslel a defaultne zapnul ukladani URL stahovaneho souboru do xattr. Informace samotná je uložena jako vlastnost user.xdg.origin.url, | Nejaky debil vymyslel a defaultne zapnul ukladani URL stahovaneho souboru do xattr. Informace samotná je uložena jako vlastnost user.xdg.origin.url, | ||
Line 467: | Line 542: | ||
[[https:// | [[https:// | ||
- | ==== Leading zeros v bc ==== | + | ===== Leading zeros v bc ===== |
" | " | ||
< | < | ||
Line 476: | Line 551: | ||
< | < | ||
- | ==== /tmp a tmpfs ==== | + | ===== /tmp a tmpfs ===== |
Software, which was written with the Abacus in mind, expects that the typical processed data wont fit into available RAM. The /tmp directory is the offloading space for such purpose - save the interproduct there and return to it afterwards. But now we have so much RAM, that there are some rumors spreading about the possibility to run TWO electron applications at once! | Software, which was written with the Abacus in mind, expects that the typical processed data wont fit into available RAM. The /tmp directory is the offloading space for such purpose - save the interproduct there and return to it afterwards. But now we have so much RAM, that there are some rumors spreading about the possibility to run TWO electron applications at once! | ||
Line 487: | Line 562: | ||
- | ==== TODO ==== | + | ===== Strange behavior of touchpad and broken scrolling |
- | + | ||
- | ===== Upgrade Ascii -> Beowulf ===== | + | |
- | + | ||
- | ==== Strange behavior of touchpad and broken scrolling ==== | + | |
X11 migrated from evdev to libinput. Lets go back to the working method... | X11 migrated from evdev to libinput. Lets go back to the working method... | ||
Line 500: | Line 571: | ||
</ | </ | ||
- | ==== Release.pgp unsupported binary format ==== | + | ===== Release.pgp unsupported binary format |
When apt-get update says ^^, it means that just some junk is left in / | When apt-get update says ^^, it means that just some junk is left in / | ||
Line 508: | Line 579: | ||
</ | </ | ||
- | ==== ALSA ==== | + | ===== ALSA ===== |
Well, audio output gets fucked up completely, since " | Well, audio output gets fucked up completely, since " | ||
Line 526: | Line 597: | ||
Restart again... a v " | Restart again... a v " | ||
- | ==== Boot do tty ==== | + | ===== Boot do tty ===== |
Suddenly boots to tty and startx says: | Suddenly boots to tty and startx says: | ||
Line 535: | Line 606: | ||
</ | </ | ||
- | ==== IEEEtran.bst ==== | + | ===== IEEEtran.bst |
Enhancement of popular LaTeX/ | Enhancement of popular LaTeX/ | ||
Line 559: | Line 630: | ||
</ | </ | ||
- | ==== Pychess ==== | + | ===== Pychess |
The new version of pychess (1.0.0) is just crippled compared to the previous versions. Not only calls home on each and every start (lookup on github for new version), but the widget at the end of the game hides the back/forth controls unless the game window is insanely huge. So apply following patches: | The new version of pychess (1.0.0) is just crippled compared to the previous versions. Not only calls home on each and every start (lookup on github for new version), but the widget at the end of the game hides the back/forth controls unless the game window is insanely huge. So apply following patches: | ||
Line 658: | Line 729: | ||
</ | </ | ||
- | ==== Disable hostname change by DHCP ==== | + | ===== Disable hostname change by DHCP |
Someone got a briliant idea of changing system' | Someone got a briliant idea of changing system' | ||
Line 669: | Line 740: | ||
</ | </ | ||
- | ==== redshift ==== | + | ===== redshift |
Recent versions of package redshift comes with crazy dependencies, | Recent versions of package redshift comes with crazy dependencies, | ||
Line 693: | Line 764: | ||
</ | </ | ||
- | ==== exfat on CentOS 5 ==== | + | ===== exfat on CentOS 5 ===== |
So you have prehistoric enterprise/ | So you have prehistoric enterprise/ | ||
Line 788: | Line 859: | ||
No errors? Congratz. | No errors? Congratz. | ||
- | ==== youtube-dl ==== | + | ===== youtube-dl |
If your youtube-dl says: | If your youtube-dl says: | ||
Line 802: | Line 873: | ||
</ | </ | ||
- | ==== df: Operation not permitted ==== | + | ===== df: Operation not permitted |
Someone in GOME decided that it is a great idea to break essential tools like ' | Someone in GOME decided that it is a great idea to break essential tools like ' | ||
Line 812: | Line 883: | ||
</ | </ | ||
- | ==== Speed-up hibernation ==== | + | ===== Speed-up hibernation |
When hibernating the system (storing the state on disk), all RAM content is dumped into the swap area. This includes also caches and other rubbish which can be safely dropped. | When hibernating the system (storing the state on disk), all RAM content is dumped into the swap area. This includes also caches and other rubbish which can be safely dropped. | ||
By default, the pm-utils try to fit the state under 2/5 of the RAM size when hibernating to shorten the store/ | By default, the pm-utils try to fit the state under 2/5 of the RAM size when hibernating to shorten the store/ | ||
- | ==== Custom LiveCD ==== | + | ===== Custom LiveCD |
When you want to have an immutable virtual machine, booting directly the LiveCD of preffered distro is the easiest option. But sometimes one might want to edit some parts of the base ISO. | When you want to have an immutable virtual machine, booting directly the LiveCD of preffered distro is the easiest option. But sometimes one might want to edit some parts of the base ISO. | ||
Line 831: | Line 902: | ||
# cd inside the extracted ISO content and create the isofile somewhere else | # cd inside the extracted ISO content and create the isofile somewhere else | ||
mkisofs -J -l -R -v -o ../ | mkisofs -J -l -R -v -o ../ | ||
+ | </ | ||
+ | |||
+ | Sometimes the former ISO does not boot in a crippled environment. So xorriso to create hybrid EFI/MBR image... | ||
+ | |||
+ | <code bash> | ||
+ | apt-get install xorriso isolinux syslinux | ||
+ | xorriso -as mkisofs -isohybrid-mbr / | ||
</ | </ | ||
Virtualbox got a feature called " | Virtualbox got a feature called " | ||
- | ==== Dokuwiki sidebar everywhere ==== | + | ===== Dokuwiki sidebar everywhere |
For some reason, default dokuwiki shows the sidebar only while reading the pages. In edit/admin mode, the sidebar is not shown. | For some reason, default dokuwiki shows the sidebar only while reading the pages. In edit/admin mode, the sidebar is not shown. | ||
Line 844: | Line 922: | ||
</ | </ | ||
- | ==== Collabora Office ==== | + | ===== Collabora Office |
=== Disable welcome screen === | === Disable welcome screen === | ||
The " | The " | ||
Line 889: | Line 967: | ||
</ | </ | ||
- | ==== ffmpeg capture pulseaudio ==== | + | === Document cannot be saved ... contact storage server administrator === |
+ | |||
+ | Owncloud stores internal locks of files in the database, but have hard time to remove the locks when not needed anymore. As the lock table grows, operations take longer and one day may not arrive before deadline, rendering the file " | ||
+ | |||
+ | The solution is to flush the oc_file_locks table. Be prepared for millions of invalid entries there. | ||
+ | |||
+ | < | ||
+ | DELETE FROM oc_file_locks WHERE 1; | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | ===== ffmpeg capture pulseaudio | ||
<code bash> | <code bash> | ||
pactl list short sources | pactl list short sources | ||
Line 896: | Line 987: | ||
- | ==== MIDI keyboard over USB ==== | + | ===== MIDI keyboard over USB ===== |
To actually listern to MIDI instrument, you need to get a database of sounds and software to bind MIDI events to sounds, and mix multiple sounds together. Such software is called synthetizer. | To actually listern to MIDI instrument, you need to get a database of sounds and software to bind MIDI events to sounds, and mix multiple sounds together. Such software is called synthetizer. | ||
Line 909: | Line 1000: | ||
Additional settings may be needed depending on the MIDI device and software used. | Additional settings may be needed depending on the MIDI device and software used. | ||
+ | |||
+ | ===== JSON in mc ===== | ||
+ | |||
+ | The view function of mc can be enhanced to show JSON files nicely. Just create mcjson.py: | ||
+ | |||
+ | <code python mcjson.py> | ||
+ | # | ||
+ | |||
+ | import json | ||
+ | import sys | ||
+ | |||
+ | gj=json.load(open(sys.argv[1])) | ||
+ | print(json.dumps(gj, | ||
+ | </ | ||
+ | |||
+ | And in mc itself just assign the View function to the proper JSON file: | ||
+ | |||
+ | <code sh .config/ | ||
+ | # json | ||
+ | regex/ | ||
+ | Open=(pluma %f >/ | ||
+ | View=%view{ascii} prettyjson.py %f 2>&1 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== mutt vs Oauth2 ===== | ||
+ | |||
+ | Oauth2 protocol is more and more popular auth mechanism, so mutt - as the least wrong mail client - have support too. Yet the support is a bit tricky... | ||
+ | |||
+ | First, download [[https:// | ||
+ | |||
+ | Then generate new PGP key for encryption of the Oauth secrets. "gpg --gen-key" | ||
+ | |||
+ | Edit the downloaded mutt_oauth2.py and change the following: | ||
+ | |||
+ | <code python> | ||
+ | ENCRYPTION_PIPE = [' | ||
+ | ... | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | If you want to use your own client_id, search faculty/ | ||
+ | |||
+ | Make first contact: | ||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | Follow the instructions, | ||
+ | |||
+ | Copy the whole URL to text editor and copy out the content of code= parameter back to the mutt_oauth2 prompt. Its long, invalid, base64 stuff ending prior "& | ||
+ | |||
+ | < | ||
+ | 0.AQIABsRF82hSsEOxn1hi-mgz-LyUX56k6HNOuL5j-LOTOFGARBAGE-REALLYLOTOFGARBAGE-EVENMOREGARBAGE-vUFlgHtUs6n5bmmRQgQ7AMH8zojnZWycMA | ||
+ | </ | ||
+ | |||
+ | Be sure not to copy newlines from vim/nano. Its one string, no newlines. NO NEWLINES! | ||
+ | |||
+ | If done correctly, the script will respond: | ||
+ | < | ||
+ | Exchanging the authorization code for an access token | ||
+ | NOTICE: Obtained new access token, expires 2023-03-23T12: | ||
+ | Access Token: lot-of-garbage | ||
+ | </ | ||
+ | |||
+ | Now is time to test the Oauth2 SMTP/IMAP connection: | ||
+ | < | ||
+ | $ / | ||
+ | Access Token: garbage... | ||
+ | IMAP authentication succeeded | ||
+ | POP authentication succeeded | ||
+ | SMTP authentication succeeded | ||
+ | </ | ||
+ | |||
+ | Good, the last thing is to edit the .mutt/ | ||
+ | |||
+ | <code muttrc> | ||
+ | set imap_user=" | ||
+ | set folder=" | ||
+ | set smtp_url=" | ||
+ | set imap_authenticators=" | ||
+ | set imap_oauth_refresh_command="/ | ||
+ | set smtp_authenticators=${imap_authenticators} | ||
+ | set smtp_oauth_refresh_command=${imap_oauth_refresh_command} | ||
+ | </ | ||
+ | |||
+ | If you have setup for more mailboxes, dont forget to clean the setting for all the others: | ||
+ | |||
+ | <code muttrc> | ||
+ | # reset Oauth2 to normal | ||
+ | set imap_authenticators=" | ||
+ | set imap_oauth_refresh_command="" | ||
+ | set smtp_authenticators=${imap_authenticators} | ||
+ | set smtp_oauth_refresh_command="" | ||
+ | </ | ||
+ | |||
+ | |||
+ |
user/sachy/lakatux.1665321649.txt.gz · Last modified: 2022/10/09 13:20 by sachy