5_years_of_miscellaneous_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
5_years_of_miscellaneous_notes [2025/02/03 17:26] – dougy147 | 5_years_of_miscellaneous_notes [2025/02/03 19:25] (current) – dougy147 | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
- | :!: Those are random | + | :!: 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-u` usually erases everything from start of line and cursor. | + | `C-u` usually erases everything from the start of line to the cursor. |
- | # Make a transparent | + | # Make a transparent |
```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` certificates, I had troubles with some mail client to send mails. |
- | As a temporary solution I have configured `msmtp` (`~/ | + | As a temporary solution I have configured `msmtp` (`~/ |
- | Here is how to check fingerprints: | + | Here is how to check for fingerprints: |
```console | ```console | ||
Line 27: | Line 28: | ||
``` | ``` | ||
- | And in `~/ | + | And in `~/ |
- | In the `/ | + | In `/ |
- | # Upgrade every OpenWrt packages | + | # Upgrade every OpenWrt packages |
```console | ```console | ||
Line 46: | Line 47: | ||
``` | ``` | ||
- | # Dump mysql database | + | # Dump a 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 " | + | |
- | * (require " | + | |
- | * (setq uiop: | + | |
- | * (uiop: | + | |
``` | ``` | ||
- | - [https:// | + | # Filter |
- | # Sort in place and keep unique | + | ``` |
+ | echo "hello world" | tee >(grep -o world >> output.txt) | ||
+ | ``` | ||
- | `sort -uo file.txt{,}` | + | This uses process substitution, and will print "hello world" on the screen, but keep only " |
- | + | ||
- | # 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 " | + | |
# Firefox history command line | # Firefox history command line | ||
- | |||
- | [https:// | ||
```console | ```console | ||
- | # web history sorted by date | + | # display |
- | $ sqlite3 ~/ | + | $ sqlite3 ~/ |
- | # unique | + | # display all unique visited |
- | $ sqlite3 ~/ | + | $ sqlite3 ~/ |
``` | ``` | ||
- | # Convert to binary, then back to original format | + | [https:// |
+ | |||
+ | # Convert | ||
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:// |
- | + | - [https:// | |
- | - https:// | + | |
- | - https:// | + | |
# Add zsh interactive comments option | # Add zsh interactive comments option | ||
Line 131: | Line 122: | ||
Now you can write `echo "this is printed" | Now you can write `echo "this is printed" | ||
- | # Break lines when compiling " | + | # Break lines in code blocks |
Add this to the YAML header options: | Add this to the YAML header options: | ||
Line 180: | Line 171: | ||
``` | ``` | ||
- | https:// | + | [https:// |
# initramfs problem (ERROR: device / | # initramfs problem (ERROR: device / | ||
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 " | ||
+ | * (require " | ||
+ | * (setq uiop: | ||
+ | * (uiop: | ||
+ | ``` | ||
+ | |||
+ | - [https:// | ||
+ | |||
+ | Another (own) way to compile a lisp file: | ||
```console | ```console | ||
Line 363: | Line 364: | ||
``` | ``` | ||
- | or directly `(load (compile-file " | + | Else, directly |
# 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:// | ||
``` | ``` | ||
zcat / | zcat / | ||
``` | ``` | ||
+ | |||
+ | [https:// | ||
# 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:// |
- | # sed replace if a match occured | + | # sed replace |
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 " | To prefix the backup " | ||
- | Source | + | [https:// |
# Useful shortcuts emacs | # Useful shortcuts emacs | ||
- | C-x-; (maintaining the 3 keys) => comment/ | + | `C-x-;` = comment/ |
- | 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: | + | `about: |
# 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 / | + | ``` |
+ | mount / | ||
+ | ``` | ||
# 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=/ | + | ``` |
+ | ssh USER@SERVER_URL "sudo -S dd if=/ | ||
+ | ``` | ||
# 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: | Then in the browser: create a SOCKS proxy with url 127.0.0.1: | ||
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.1738603582.txt.gz · Last modified: by dougy147