User Tools

Site Tools


5_years_of_miscellaneous_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
5_years_of_miscellaneous_notes [2025/02/03 16:46] – created dougy1475_years_of_miscellaneous_notes [2025/02/03 19:25] (current) dougy147
Line 1: Line 1:
 <!DOCTYPE markdown> <!DOCTYPE markdown>
  
-:!: Those are random notes I took when confronted to unique or recurrent problems.+:!: This is a //pot pourri// of notes I took when confronted to unique or recurrent problems.
 Be careful as some of them could be obsolete. :-? Be careful as some of them could be obsolete. :-?
  
 # Erase password instead of hitting backspace like a monkey # Erase password instead of hitting backspace like a monkey
  
-`C-k` usually erase everything in the command line.+`C-u` usually erases everything from the start of line to the cursor.
  
-# Make a transparent gif from transparent pngs+# Make a transparent GIF from transparent PNGs
  
 ```console ```console
-$ # delay in ms 
 $ magick -delay 10 -loop 0 -dispose Background *.png output.gif $ magick -delay 10 -loop 0 -dispose Background *.png output.gif
 ``` ```
 +
 +Delay is in ms.
  
 # Mail server troubleshooting # Mail server troubleshooting
  
-After the expiration of my `emails.myserver1.com` and `emails.myserver2.com` certificates I had troubles with some mail client to send mails. +After the expiration of my `emails.myserver1.com` and `emails.myserver2.com` certificatesI had troubles with some mail client to send mails. 
-As a temporary solution I have configured `msmtp` (`~/.config/msmtp/config`) to disable the verification of the certificate, but check the fingerprint. +As a temporary solution I have configured `msmtp` (`~/.config/msmtp/config`) disabling certificates verification but keeping fingerprint checking
-Here is how to check fingerprints:+Here is how to check for fingerprints:
  
 ```console ```console
Line 27: Line 28:
 ``` ```
  
-And in `~/.config/msmtp/config` I put `tls_fingerprint <fingerprint>`.+And in `~/.config/msmtp/config` I have put `tls_fingerprint <fingerprint>`.
  
-In the `/etc/cron.d/certbot` I added this : `0 */12 * * * root certbot renew --no-random-sleep-on-renew && systemctl restart postfix dovecot`+In `/etc/cron.d/certbot` I added `0 */12 * * * root certbot renew --no-random-sleep-on-renew && systemctl restart postfix dovecot`
  
-# Upgrade every OpenWrt packages+# Upgrade every OpenWrt packages at once
  
 ```console ```console
Line 46: Line 47:
 ``` ```
  
-# Dump mysql database+# Dump mysql database
  
 ```console ```console
Line 54: Line 55:
 ``` ```
  
-Compile Lisp (another way...)+Sort in place and remove duplicate lines
  
-```console +``` 
-$ sbcl --load hello.lisp +sort -uo file.txt{,}
-* (load "hello.lisp"+
-* (require "asdf"+
-* (setq uiop:*image-entry-point* #'main) ; imagining that entry point is function "main" +
-* (uiop:dump-image "hello.exe" :executable t)+
 ``` ```
  
-- [https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable](https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable)+# Filter an output to file but keep whole output in terminal output
  
-# Sort in place and keep unique+``` 
 +echo "hello world" | tee >(grep -o world >> output.txt) 
 +```
  
-`sort -uo file.txt{,}` +This uses process substitutionand will print "hello world" on the screen, but keep only "world" in output.txt.
- +
-# Process substitution to filter an output to file but keep whole output in terminal output +
- +
-`echo "hello world" | tee >(grep -o world >> output.txt)` +
- +
-This will print "hello world" on screen, but keep only "world" in output.txt.+
  
  
 # Firefox history command line # Firefox history command line
- 
-[https://aurelieherbelot.net/web/read-firefox-history-linux-terminal/](https://aurelieherbelot.net/web/read-firefox-history-linux-terminal/) 
  
 ```console ```console
-# web history sorted by date +display web history sorted by date 
-$ sqlite3 ~/.mozilla/firefox/**xxxx**.default-release-**xxxx**/places.sqlite "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id"|sort+$ sqlite3 ~/.mozilla/firefox/xxxx.default-release-xxxx/places.sqlite "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id"|sort
  
-# unique urls visited +display all unique visited urls 
-$ sqlite3 ~/.mozilla/firefox/**xxxx**.default-release-**xxxx**/places.sqlite "SELECT url FROM moz_places"+$ sqlite3 ~/.mozilla/firefox/xxxx.default-release-xxxx/places.sqlite "SELECT url FROM moz_places"
 ``` ```
  
-# Convert to binarythen back to original format in vim+[https://aurelieherbelot.net/web/read-firefox-history-linux-terminal/](https://aurelieherbelot.net/web/read-firefox-history-linux-terminal/
 + 
 +# Convert file to binary then back to original format with vim
  
 Something I have used to modify firmwares when I was tweaking the NB6VAC. Something I have used to modify firmwares when I was tweaking the NB6VAC.
Line 114: Line 107:
 8) wireshark should start showing traffic 8) wireshark should start showing traffic
  
-Sources: +[https://openmaniak.com/ettercap_arp.php](https://openmaniak.com/ettercap_arp.php) 
- +[https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark](https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark)
-- https://openmaniak.com/ettercap_arp.php +
-- https://stackoverflow.com/questions/9555403/capturing-mobile-phone-traffic-on-wireshark+
  
 # Add zsh interactive comments option # Add zsh interactive comments option
Line 131: Line 122:
 Now you can write `echo "this is printed" # this is not` Now you can write `echo "this is printed" # this is not`
  
-# Break lines when compiling ".md" to ".pdf" with pandoc+# Break lines in code blocks when compiling ".md" to ".pdf" with pandoc
  
 Add this to the YAML header options: Add this to the YAML header options:
Line 180: Line 171:
 ``` ```
  
-https://www.robotstxt.org/robotstxt.html+[https://www.robotstxt.org/robotstxt.html](https://www.robotstxt.org/robotstxt.html)
  
 # initramfs problem (ERROR: device /dev/mapper/xxx not found, skipping fsck) # initramfs problem (ERROR: device /dev/mapper/xxx not found, skipping fsck)
Line 347: Line 338:
 # Compile Common Lisp # Compile Common Lisp
  
-My own way to compile a lisp file then to execute it:+```console 
 +$ sbcl --load hello.lisp 
 +* (load "hello.lisp"
 +* (require "asdf"
 +* (setq uiop:*image-entry-point* #'main) ; imagining that entry point is function "main" 
 +* (uiop:dump-image "hello.exe" :executable t) 
 +``` 
 + 
 +- [https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable](https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable) 
 + 
 +Another (ownway to compile a lisp file:
  
 ```console ```console
Line 363: Line 364:
 ``` ```
  
-or directly `(load (compile-file "my_program.lisp"))`.+Else, directly in a REPL: `(load (compile-file "my_program.lisp"))`.
  
 # Revert to a commit # Revert to a commit
Line 394: Line 395:
  
 # Check kernel config in Arch Linux # Check kernel config in Arch Linux
- 
-https://unix.stackexchange.com/questions/176307/where-can-i-find-the-kernel-configuration-on-each-linux-distribution 
  
 ``` ```
 zcat /proc/config.gz zcat /proc/config.gz
 ``` ```
 +
 +[https://unix.stackexchange.com/questions/176307/where-can-i-find-the-kernel-configuration-on-each-linux-distribution](https://unix.stackexchange.com/questions/176307/where-can-i-find-the-kernel-configuration-on-each-linux-distribution)
  
 # Check if a streamer is live on Twitch # Check if a streamer is live on Twitch
Line 418: Line 419:
 It has vim keybindings! It has vim keybindings!
  
-Source : https://github.com/crosstool-ng/crosstool-ng/issues/1175+[https://github.com/crosstool-ng/crosstool-ng/issues/1175](https://github.com/crosstool-ng/crosstool-ng/issues/1175)
  
-# sed replace if a match occured+# sed replace only if a match occured
  
 I tend to use `grep` and `sed` together : to match, then to replace. But we can match with `sed` : I tend to use `grep` and `sed` together : to match, then to replace. But we can match with `sed` :
Line 451: Line 452:
 To prefix the backup "extension" : `-i'bak.*` will produce `bak.file1.txt`, `bak.file2.txt`, etc. To prefix the backup "extension" : `-i'bak.*` will produce `bak.file1.txt`, `bak.file2.txt`, etc.
  
-Source : https://learnbyexample.github.io/learn_gnused/in-place-file-editing.html+[https://learnbyexample.github.io/learn_gnused/in-place-file-editing.html](https://learnbyexample.github.io/learn_gnused/in-place-file-editing.html)
  
 # Useful shortcuts emacs # Useful shortcuts emacs
  
-C-x-;   (maintaining the 3 keys) =comment/uncomment lines +`C-x-;= comment/uncomment lines. 
-C-x-x -> reselect previous selection+`C-x-x` = reselect previous selection
  
 # Useful commands for git # Useful commands for git
Line 854: Line 855:
 I needed to try `bash-3.2` that is the default shell on macOS. Thanks to Docker it's simple : I needed to try `bash-3.2` that is the default shell on macOS. Thanks to Docker it's simple :
  
-`docker run -it bash:3.2`+``` 
 +docker run -it bash:3.2 
 +```
  
 # Change Firefox URL bar size # Change Firefox URL bar size
  
-`about:config`  `devp`  `layout.css.devPixelsPerPx`  => from `-1` to `1.5` (or less or more)+`about:config` =>  `devp`  => `layout.css.devPixelsPerPx` => replace `-1` with `1.5` (or less or more)
  
 # Recursively download a website with wget # Recursively download a website with wget
Line 877: Line 880:
 # Check size and sort by size # Check size and sort by size
  
-`du -sh -- * | sort -h`+``` 
 +du -sh -- * | sort -h 
 +```
  
 # Mount an ISO # Mount an ISO
  
-`mount /path/to/image.iso /mnt/iso -o loop`+``` 
 +mount /path/to/image.iso /mnt/iso -o loop 
 +```
  
 # Fonts in ArchLinux # Fonts in ArchLinux
Line 898: Line 905:
 Don't forget to change `USER`, `SERVER_URL`: Don't forget to change `USER`, `SERVER_URL`:
  
-`ssh USER@SERVER_URL "sudo -S dd if=/dev/mmcblk0 bs=64k status=progress | gzip -1 -" | dd of=rpiimg.gz bs=64k`+``` 
 +ssh USER@SERVER_URL "sudo -S dd if=/dev/mmcblk0 bs=64k status=progress | gzip -1 -" | dd of=rpiimg.gz bs=64k 
 +```
  
 # Use server as a proxy # Use server as a proxy
  
-`ssh -C2qTnN -D 8080 USER@SERVER_URL`+``` 
 +ssh -C2qTnN -D 8080 USER@SERVER_URL 
 +```
  
 Then in the browser: create a SOCKS proxy with url 127.0.0.1:8080. Then in the browser: create a SOCKS proxy with url 127.0.0.1:8080.
Line 908: Line 919:
 # Print from command line # Print from command line
  
-`lpr file.txt -P PRINTER_NAME #tab to find printer`+``` 
 +lpr file.txt -P PRINTER_NAME #tab to find printer 
 +```
  
5_years_of_miscellaneous_notes.1738601211.txt.gz · Last modified: by dougy147

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki