From a5c65a3694f5ee02d38c193d781b499940e8bb4a Mon Sep 17 00:00:00 2001 From: Gasper Spagnolo Date: Mon, 27 Feb 2023 21:59:02 +0100 Subject: [PATCH] Update of the site --- config.toml | 4 +- content/posts/Clipboard.md | 2 +- content/posts/Compression.md | 2 +- content/posts/Curl.md | 2 +- content/posts/Dig.md | 2 +- content/posts/Find.md | 2 +- content/posts/GIT.md | 68 +++++++++++- content/posts/Locate.md | 2 +- content/posts/MPI.md | 2 +- content/posts/Networking.md | 4 +- content/posts/SSH.md | 22 +++- content/posts/Tracks.md | 2 +- content/posts/VFS.md | 2 +- content/posts/VIM.md | 24 ++++- content/posts/address_space.md | 2 +- content/posts/ansible.md | 2 +- content/posts/autorandr.md | 15 +++ content/posts/bash.md | 2 +- content/posts/binary-patching.md | 2 +- content/posts/binary_vs_text_files.md | 2 +- content/posts/burpsuite.md | 2 +- content/posts/certs.md | 2 +- content/posts/disk-usage.md | 2 +- content/posts/disk-utils.md | 2 +- content/posts/docker.md | 8 +- content/posts/emacs.md | 2 +- content/posts/exec.md | 2 +- content/posts/ffmpeg.md | 2 +- content/posts/forensics.md | 2 +- content/posts/fork.md | 2 +- content/posts/gcc.md | 2 +- content/posts/gdb.md | 2 +- content/posts/hardware.md | 12 +++ content/posts/hydra.md | 2 +- content/posts/lxc.md | 2 +- content/posts/milvus_db.md | 44 ++++++++ content/posts/mosquitto.md | 2 +- content/posts/mount.md | 2 +- content/posts/multiprocessing.md | 102 +++++++++++++++++- content/posts/named_pipes.md | 2 +- content/posts/nmap.md | 2 +- content/posts/os_flashing.md | 2 +- content/posts/pdf.md | 2 +- content/posts/permissions.md | 2 +- content/posts/pipewire.md | 2 +- content/posts/powerusage.md | 2 +- content/posts/proces_sorting_algorithms.md | 2 +- content/posts/proxmox.md | 2 +- content/posts/pwn.md | 2 +- content/posts/python_specifics.md | 2 +- content/posts/qemu.md | 2 +- content/posts/regex.md | 2 +- content/posts/rstudio.md | 2 +- content/posts/rust.md | 2 +- .../posts/services-and-process-management.md | 2 +- content/posts/squid.md | 2 +- content/posts/symlinks.md | 2 +- content/posts/system-information.md | 2 +- content/posts/tmux.md | 8 +- content/posts/uart.md | 2 +- content/posts/ufw.md | 2 +- content/posts/vim_tutor.md | 2 +- content/posts/wasm.md | 2 +- content/posts/wl-mirror.md | 2 +- content/posts/yaml.md | 2 +- scripts/move.py | 2 +- 66 files changed, 354 insertions(+), 67 deletions(-) create mode 100644 content/posts/autorandr.md create mode 100644 content/posts/hardware.md create mode 100644 content/posts/milvus_db.md diff --git a/config.toml b/config.toml index e2c2323..056e397 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseurl = "https://blog.spanskiduh.xyz/" +baseurl = "https://blog.spanskiduh.dev/" languageCode = "en-us" # Add it only if you keep the theme in the `themes` directory. # Remove it if you use the theme as a remote Hugo Module. @@ -79,7 +79,7 @@ paginate = 5 missingBackButtonLabel = "Back to home page" [languages.en.params.logo] - logoText = "blog.spanskiduh.xyz" + logoText = "blog.spanskiduh.dev" logoHomeLink = "/" [languages.en.menu] diff --git a/content/posts/Clipboard.md b/content/posts/Clipboard.md index bb04077..6740d4d 100644 --- a/content/posts/Clipboard.md +++ b/content/posts/Clipboard.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Clipboard" description="click to read about Clipboard" diff --git a/content/posts/Compression.md b/content/posts/Compression.md index 82f06f0..835914d 100644 --- a/content/posts/Compression.md +++ b/content/posts/Compression.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Compression" description="click to read about Compression" diff --git a/content/posts/Curl.md b/content/posts/Curl.md index 964e22a..91b2fbc 100644 --- a/content/posts/Curl.md +++ b/content/posts/Curl.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Curl" description="click to read about Curl" diff --git a/content/posts/Dig.md b/content/posts/Dig.md index 7b0abc6..ba6338d 100644 --- a/content/posts/Dig.md +++ b/content/posts/Dig.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Dig" description="click to read about Dig" diff --git a/content/posts/Find.md b/content/posts/Find.md index 78c4e46..7461ad1 100644 --- a/content/posts/Find.md +++ b/content/posts/Find.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Find" description="click to read about Find" diff --git a/content/posts/GIT.md b/content/posts/GIT.md index 61fa570..bfcd06e 100644 --- a/content/posts/GIT.md +++ b/content/posts/GIT.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-17" author="spanskiduh" title="GIT" description="click to read about GIT" @@ -38,3 +38,69 @@ You can also add `-v` flag to increase verbosity to get more details about liste ### Switch to remote branch that is not on local computer `git switch ` + + +### I had many reduntant commits on this branch how would I squash them? +- If you have many redundant commits on your local branch and you want to squash them into a single commit, you can use the git rebase command with the interactive mode to rewrite the commit history. +Here are the steps to squash redundant commits on your local branch: + +First, switch to your local branch by running the following command: + +git checkout your_local_branch +Use the following command to start an interactive rebase: + +``` +git rebase -i HEAD~n +``` + +Replace n with the number of commits you want to include in the rebase. For example, if you want to squash the last five commits into a single commit, you would use git rebase -i HEAD~5. + +This will open a text editor with a list of your recent commits. The word "pick" will appear before each commit. To squash the redundant commits, replace "pick" with "squash" or "s" for the commits that you want to squash into a single commit. + +Save and close the file. Git will apply the changes and open another text editor to allow you to edit the commit message for the new squashed commit. + +Edit the commit message as needed, then save and close the file. + +Git will apply the changes and create a new commit with the squashed changes. If there are any conflicts, Git will pause the rebase process and prompt you to resolve them manually. + +After you've resolved all conflicts, run the following command to continue the rebase: + +``` +git rebase --continue +``` +If you encounter any issues during the rebase process, you can use the git rebase --abort command to abort the process and return your local branch to its original state. +Once the rebase is complete, your local branch will contain a single commit with the changes from the redundant commits squashed into it. You can then push your changes to your remote repository if needed. + + +### I have a local branch, but the main git branch was recently updated and I want those changes to be included into my local branch. How would I do that? +Here are the steps to follow to update your local branch using git rebase: + +First, switch to your local branch by running the following command: +``` +git checkout your_local_branch +``` + +Fetch the latest changes from the main Git branch by running: +``` +git fetch origin +``` +This command will update your local copy of the main Git branch to match the version on the remote repository. + +Use the following command to start the rebase process: +``` +git rebase origin/main +``` + +This will take the changes in the main branch and apply them to your local branch by replaying your local changes on top of them. + +Resolve any conflicts that may arise during the rebase process. When there are conflicts, Git will pause the rebase process and show you which files have conflicts. You can then use a merge tool or a text editor to resolve the conflicts manually. + +After you've resolved all conflicts, run the following command to continue the rebase: +``` +git rebase --continue +``` +This will apply the remaining changes and complete the rebase process. + +If you encounter any issues during the rebase process, you can use the git rebase --abort command to abort the process and return your local branch to its original state. + +Once the rebase is complete, your local branch will contain the changes from the main Git branch, and your local commits will be replayed on top of them. You can then push your changes to your remote repository if needed. diff --git a/content/posts/Locate.md b/content/posts/Locate.md index 903bd1d..490a189 100644 --- a/content/posts/Locate.md +++ b/content/posts/Locate.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Locate" description="click to read about Locate" diff --git a/content/posts/MPI.md b/content/posts/MPI.md index 2ccb4bc..4c666e1 100644 --- a/content/posts/MPI.md +++ b/content/posts/MPI.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="MPI" description="click to read about MPI" diff --git a/content/posts/Networking.md b/content/posts/Networking.md index efcdda5..51443d0 100644 --- a/content/posts/Networking.md +++ b/content/posts/Networking.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Networking" description="click to read about Networking" @@ -29,7 +29,7 @@ description="click to read about Networking" | ifconfig enp6s0 192.168.2.24 | ip addr add 192.168.2.24/24 dev enp6s0 | | ifconfig enp6s0 netmask 255.255.255.0 | ip addr add 192.168.1.1/24 dev enp6s0 | | ifconfig enp6s0 mtu 9000 | ip link set enp6s0 mtu 9000 | -| ifconfig enp6s0:0 192.168.2.25 | ip addr add 192.168.2.25/24 dev enp6s0 | +| ifconfig enp7s0:0 192.168.2.25 | ip addr add 192.168.2.25/24 dev enp6s0 | | netstat | ss | | netstat -tulpn | ss -tulpn | | netstat -neopa | ss -neopa | diff --git a/content/posts/SSH.md b/content/posts/SSH.md index e0ed8b3..e4f095d 100644 --- a/content/posts/SSH.md +++ b/content/posts/SSH.md @@ -1,6 +1,6 @@ +++ -date="2022-12-25" +date="2023-02-03" author="spanskiduh" title="SSH" description="click to read about SSH" @@ -29,7 +29,7 @@ ssh-keygen -t ed25519 -f ~/.ssh/keys/id_ed2552_devel_server ### Copy to remote ```bash -ssh-copy-id devel@devel.hsrv -i ~/.ssh/keys/id_ed25519_devel_server +ssh-copy-id -i ~/.ssh/keys/id_ed25520_devel_server devel@devel.hsrv ``` ### FAIL2BAN @@ -67,3 +67,21 @@ oli@bert:~$ ssh tim oli@tim:~$ export DISPLAY=:0 oli@tim:~$ firefox ``` + +### Reverse SSH tunnel +If you want some port that is behind the firewall, but exposed on the server. +You can spawn a reverse ssh tunnel to that port issuing this command: + +```bash +ssh -L 8888:localhost:8888 -f -N hsrv_devel +``` + +or: `ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER` + +read [here](https://linuxize.com/post/how-to-setup-ssh-tunneling/) more. + +or forcily: + +```bash +ssh -L 8888:localhost:8888 -f -N hsrv_devel -o ClearAllForwardings=yes +``` diff --git a/content/posts/Tracks.md b/content/posts/Tracks.md index a432fb4..e9d7a01 100644 --- a/content/posts/Tracks.md +++ b/content/posts/Tracks.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="Tracks" description="click to read about Tracks" diff --git a/content/posts/VFS.md b/content/posts/VFS.md index 5572d6f..02f3892 100644 --- a/content/posts/VFS.md +++ b/content/posts/VFS.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="VFS" description="click to read about VFS" diff --git a/content/posts/VIM.md b/content/posts/VIM.md index f3c1642..49f8f8d 100644 --- a/content/posts/VIM.md +++ b/content/posts/VIM.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-04" author="spanskiduh" title="VIM" description="click to read about VIM" @@ -48,3 +48,25 @@ Comment Multiple Lines ### Nvim tree mappings ` :help nvim-tree-default-mappings` + + +## Marks + +Add mark with `ma` + +And then list them with `:marks` + +Select the mark with `'x` where x is the character thas is next to the mark listed using `:marks` command. + + +| Command | Description | +|:---------:|:-------------------------------------------------------------:| +| ma | set mark a at current cursor location | +| 'a | jump to line of mark a (first non-blank character in line) | +| `a | jump to position (line and column) of mark a | +| d'a | delete from current line to line of mark a | +| d`a | delete from current cursor position to position of mark a | +| c'a | change text from current line to line of mark a | +| y`a | yank text to unnamed buffer from cursor to position of mark a | +| :marks | list all the current marks | +| :marks aB | list marks a, B | diff --git a/content/posts/address_space.md b/content/posts/address_space.md index 15bf5bc..6cfebcf 100644 --- a/content/posts/address_space.md +++ b/content/posts/address_space.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="address_space" description="click to read about address_space" diff --git a/content/posts/ansible.md b/content/posts/ansible.md index e1e3080..aa43986 100644 --- a/content/posts/ansible.md +++ b/content/posts/ansible.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="ansible" description="click to read about ansible" diff --git a/content/posts/autorandr.md b/content/posts/autorandr.md new file mode 100644 index 0000000..9c2a1c9 --- /dev/null +++ b/content/posts/autorandr.md @@ -0,0 +1,15 @@ + ++++ +date="2023-02-06" +author="spanskiduh" +title="autorandr" +description="click to read about autorandr" ++++ +# Autorandr + +## Save current display setup +`autorandr --save laptop` + +## Automatically reload setup +`autorandr --change` or `autorandr ` + diff --git a/content/posts/bash.md b/content/posts/bash.md index 89462b4..7ad7ee0 100644 --- a/content/posts/bash.md +++ b/content/posts/bash.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="bash" description="click to read about bash" diff --git a/content/posts/binary-patching.md b/content/posts/binary-patching.md index 73cc2d3..caa4b5d 100644 --- a/content/posts/binary-patching.md +++ b/content/posts/binary-patching.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="binary-patching" description="click to read about binary-patching" diff --git a/content/posts/binary_vs_text_files.md b/content/posts/binary_vs_text_files.md index aaf06ab..96e8adb 100644 --- a/content/posts/binary_vs_text_files.md +++ b/content/posts/binary_vs_text_files.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="binary_vs_text_files" description="click to read about binary_vs_text_files" diff --git a/content/posts/burpsuite.md b/content/posts/burpsuite.md index 7df588e..08a7a4f 100644 --- a/content/posts/burpsuite.md +++ b/content/posts/burpsuite.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="burpsuite" description="click to read about burpsuite" diff --git a/content/posts/certs.md b/content/posts/certs.md index 7991f0c..c5c9f74 100644 --- a/content/posts/certs.md +++ b/content/posts/certs.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="certs" description="click to read about certs" diff --git a/content/posts/disk-usage.md b/content/posts/disk-usage.md index 023e81b..53190f2 100644 --- a/content/posts/disk-usage.md +++ b/content/posts/disk-usage.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="disk-usage" description="click to read about disk-usage" diff --git a/content/posts/disk-utils.md b/content/posts/disk-utils.md index 9c2d09c..ceb0f23 100644 --- a/content/posts/disk-utils.md +++ b/content/posts/disk-utils.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="disk-utils" description="click to read about disk-utils" diff --git a/content/posts/docker.md b/content/posts/docker.md index f453031..dc2f036 100644 --- a/content/posts/docker.md +++ b/content/posts/docker.md @@ -1,6 +1,6 @@ +++ -date="2022-12-25" +date="2023-02-09" author="spanskiduh" title="docker" description="click to read about docker" @@ -257,3 +257,9 @@ basically add this segment to file `/etc/ufw/after.rules`. COMMIT # END UFW AND DOCKER ``` + + +## Best flag for debugging dockerfile +`docker compose --verbose up --build` +But do not fuck up the order of the arguments! + diff --git a/content/posts/emacs.md b/content/posts/emacs.md index 3aadc0d..bfe6274 100644 --- a/content/posts/emacs.md +++ b/content/posts/emacs.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="emacs" description="click to read about emacs" diff --git a/content/posts/exec.md b/content/posts/exec.md index 1f30a78..0442f54 100644 --- a/content/posts/exec.md +++ b/content/posts/exec.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="exec" description="click to read about exec" diff --git a/content/posts/ffmpeg.md b/content/posts/ffmpeg.md index 7845ba4..e32e1ed 100644 --- a/content/posts/ffmpeg.md +++ b/content/posts/ffmpeg.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="ffmpeg" description="click to read about ffmpeg" diff --git a/content/posts/forensics.md b/content/posts/forensics.md index bb79cf9..56c2c81 100644 --- a/content/posts/forensics.md +++ b/content/posts/forensics.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="forensics" description="click to read about forensics" diff --git a/content/posts/fork.md b/content/posts/fork.md index e833b44..768e3ce 100644 --- a/content/posts/fork.md +++ b/content/posts/fork.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="fork" description="click to read about fork" diff --git a/content/posts/gcc.md b/content/posts/gcc.md index fb100e1..6058ade 100644 --- a/content/posts/gcc.md +++ b/content/posts/gcc.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="gcc" description="click to read about gcc" diff --git a/content/posts/gdb.md b/content/posts/gdb.md index b5d4b88..a4adc75 100644 --- a/content/posts/gdb.md +++ b/content/posts/gdb.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="gdb" description="click to read about gdb" diff --git a/content/posts/hardware.md b/content/posts/hardware.md new file mode 100644 index 0000000..5bbb6af --- /dev/null +++ b/content/posts/hardware.md @@ -0,0 +1,12 @@ + ++++ +date="2023-02-03" +author="spanskiduh" +title="hardware" +description="click to read about hardware" ++++ +# Hardware + +## Display information about graphics cards + +`sudo lshw -c video` diff --git a/content/posts/hydra.md b/content/posts/hydra.md index 71e168c..08f0311 100644 --- a/content/posts/hydra.md +++ b/content/posts/hydra.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="hydra" description="click to read about hydra" diff --git a/content/posts/lxc.md b/content/posts/lxc.md index ae6a1c8..a3ca7fa 100644 --- a/content/posts/lxc.md +++ b/content/posts/lxc.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="lxc" description="click to read about lxc" diff --git a/content/posts/milvus_db.md b/content/posts/milvus_db.md new file mode 100644 index 0000000..204862b --- /dev/null +++ b/content/posts/milvus_db.md @@ -0,0 +1,44 @@ + ++++ +date="2023-02-26" +author="spanskiduh" +title="milvus_db" +description="click to read about milvus_db" ++++ +# Milvus DB + +Milvus is a powerful open-source vector database that is designed to handle large-scale machine learning and deep learning applications. Some of the best use cases for Milvus include: + +- Image and Video Search: Milvus can store and retrieve large amounts of image and video data quickly and accurately. It can be used to power search engines for online marketplaces, social media platforms, and other applications where visual search is important. +- Natural Language Processing: Milvus can be used to store and retrieve large amounts of text data, making it ideal for natural language processing applications. It can be used for sentiment analysis, chatbots, and other text-based applications. +- Anomaly Detection: Milvus can be used to detect anomalies in large datasets. It can be used in fraud detection, network intrusion detection, and other applications where identifying outliers is important. +- Recommendation Systems: Milvus can be used to power recommendation systems, providing users with personalized recommendations based on their past behavior and preferences. +- Facial Recognition: Milvus can be used to store and match facial recognition data quickly and accurately. It can be used for security systems, access control, and other applications where facial recognition is important. + + +### Milvus cli + +#### Installation + +```bash +pip install milvus-cli +``` + +``` +:: fedora > milvis_cli + __ __ _ _ ____ _ ___ + | \/ (_) |_ ___ _ ___ / ___| | |_ _| + | |\/| | | \ \ / / | | / __| | | | | | | + | | | | | |\ V /| |_| \__ \ | |___| |___ | | + |_| |_|_|_| \_/ \__,_|___/ \____|_____|___| + +Milvus cli version: 0.3.2 +Pymilvus version: 2.2.1 + +Learn more: https://github.com/zilliztech/milvus_cli. + + +milvus_cli > +``` + + diff --git a/content/posts/mosquitto.md b/content/posts/mosquitto.md index e6f151c..3a564cf 100644 --- a/content/posts/mosquitto.md +++ b/content/posts/mosquitto.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="mosquitto" description="click to read about mosquitto" diff --git a/content/posts/mount.md b/content/posts/mount.md index 089f206..1a81571 100644 --- a/content/posts/mount.md +++ b/content/posts/mount.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="mount" description="click to read about mount" diff --git a/content/posts/multiprocessing.md b/content/posts/multiprocessing.md index 2d5e5d2..cd0f9bc 100644 --- a/content/posts/multiprocessing.md +++ b/content/posts/multiprocessing.md @@ -1,6 +1,6 @@ +++ -date="2022-12-31" +date="2023-02-03" author="spanskiduh" title="multiprocessing" description="click to read about multiprocessing" @@ -535,3 +535,103 @@ and to enable the efficient exchange of data between them. - `MPI_Gatherv` and `MPI_Scatterv` - Same as Scatter and gather, but you have control over displacenents and send counts for each process - basically you can control how larg chunk everey process will handle + +## CUDA C + +Cuda program consists: +- Code thet runs on host(CPU) +- Kernel that runs on GPU +- Threads are organized in block, which make up grid +- Every kernel executes single grid + +Code execution: +- Copy data to GPU +- request for computation +- compute +- copu data from GPU memory to main system memory + +### Streaming multiprocessor(SM) + +``` +| I cache | +| MT issue | +| C cache | +| SP | SP | +| SP | SP | +| ... | ... | +| SP | SP | +| SFU | SFU | +| registers | +| Shared Memory | +| Local Memory | +``` + +Consists of: +- `SP` ~ streaming processors -> 2times the clock speed (fast clock) +- `SFU` ~ special function units +- `Shared memory` +- `cache` + +Properties: +- A block of thread is executed by single streaming multiprocessor. +- SM can process many blocks concurrently. +- Threads that are in the same block are easily synchronized. +- Threads that are executed on different SM **cannot** be synchronized ((efficently)) -> hence faster computation! +- All the threads in the same block execute the same code +- Every SM has 8 SP, and a warp has 32 threads, so threads are executed in four steps (pipeline) +- Each instruction in ALE/MAD unit takes about 4 ticks(fast clock), So it lines up with warp pipeline execution (each fast tick 8 threads are created and computed) + +Function units: +- 8 32bit FP(floating point) ALU/MAD(multiply and add) +- 8 integer units for jump instructions +- 2 SFUs, trigonometric functions,.. +- 1 64 bit MAD unit (allows 64 bit operations), that means that computation with 64bit values will be at least 8-12 times slower than 32bit + +Shared memory: +- Really fast memory, but very limited in size. +- It is meant for communication between threads in the same SM. +- Meant for saving some value (example counter sum for all threads) +- All data is lost when the kernel finishes. +- Data from and into shared memory is transfered to and from registers using `LOAD/STORE`. + +Registers: +- Each SM has a few registers(static), faster than shared memory +- Then each SP has a few dynamically allocated registers + +Local memory: +- private for each thread +- used when there are no registers left +- a bit slower + +Warp (micro architecture): +- consists of 32 parallel threads, that execute the same code +- each SM can execute 32 warps + + +### Global & constant & texture memory: +- It is slower +- All threads can access it +- CPU can write and read from it. +- Memory stays there when the kernel finishes (You must clean it up after usage). +- constant memory: small, around 64KB, used for instructions +- texture memory: used for storing constatns and textures in graphichal applications + + +### CUDA kernel + +- Does not return anything +- Accepts arguments, but pointers from device memory + +Compiler function labels: + - `__global__` ~ Function is ran on device, and the one calling it is the host + - `__device__` ~ Function is ran on device, and can be called only from within device + - `__host__` ~ Function is ran on the host ( default ) + +### Some CUDA functions + +- `cudaMalloc()` + - Allocate memory on the GPU +- `cudaFree()` + - Free memory on the GPU +- `cudaMemcpy(p1, p2, ssize_t, cudaMemcpyDeviceToHost | cudaMemcpyHostToDevice)` + - Copy from main memory to gpu memory and vice versa. diff --git a/content/posts/named_pipes.md b/content/posts/named_pipes.md index 32208cf..947b9ab 100644 --- a/content/posts/named_pipes.md +++ b/content/posts/named_pipes.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="named_pipes" description="click to read about named_pipes" diff --git a/content/posts/nmap.md b/content/posts/nmap.md index 81cc37e..390a603 100644 --- a/content/posts/nmap.md +++ b/content/posts/nmap.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="nmap" description="click to read about nmap" diff --git a/content/posts/os_flashing.md b/content/posts/os_flashing.md index b83d399..fda1b35 100644 --- a/content/posts/os_flashing.md +++ b/content/posts/os_flashing.md @@ -1,6 +1,6 @@ +++ -date="2022-12-25" +date="2023-02-03" author="spanskiduh" title="os_flashing" description="click to read about os_flashing" diff --git a/content/posts/pdf.md b/content/posts/pdf.md index c125d7c..76bff1c 100644 --- a/content/posts/pdf.md +++ b/content/posts/pdf.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="pdf" description="click to read about pdf" diff --git a/content/posts/permissions.md b/content/posts/permissions.md index 4726145..390171c 100644 --- a/content/posts/permissions.md +++ b/content/posts/permissions.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="permissions" description="click to read about permissions" diff --git a/content/posts/pipewire.md b/content/posts/pipewire.md index eb17b50..9d1cc01 100644 --- a/content/posts/pipewire.md +++ b/content/posts/pipewire.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="pipewire" description="click to read about pipewire" diff --git a/content/posts/powerusage.md b/content/posts/powerusage.md index e0c38db..2c7827c 100644 --- a/content/posts/powerusage.md +++ b/content/posts/powerusage.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="powerusage" description="click to read about powerusage" diff --git a/content/posts/proces_sorting_algorithms.md b/content/posts/proces_sorting_algorithms.md index 1cf25b7..a766757 100644 --- a/content/posts/proces_sorting_algorithms.md +++ b/content/posts/proces_sorting_algorithms.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="proces_sorting_algorithms" description="click to read about proces_sorting_algorithms" diff --git a/content/posts/proxmox.md b/content/posts/proxmox.md index 3390b24..e3e30dc 100644 --- a/content/posts/proxmox.md +++ b/content/posts/proxmox.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="proxmox" description="click to read about proxmox" diff --git a/content/posts/pwn.md b/content/posts/pwn.md index 567fc67..d7c814f 100644 --- a/content/posts/pwn.md +++ b/content/posts/pwn.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="pwn" description="click to read about pwn" diff --git a/content/posts/python_specifics.md b/content/posts/python_specifics.md index 337a466..9a6b3ae 100644 --- a/content/posts/python_specifics.md +++ b/content/posts/python_specifics.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="python_specifics" description="click to read about python_specifics" diff --git a/content/posts/qemu.md b/content/posts/qemu.md index b3872d4..af1eafb 100644 --- a/content/posts/qemu.md +++ b/content/posts/qemu.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="qemu" description="click to read about qemu" diff --git a/content/posts/regex.md b/content/posts/regex.md index 7c100d4..83e3c3e 100644 --- a/content/posts/regex.md +++ b/content/posts/regex.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="regex" description="click to read about regex" diff --git a/content/posts/rstudio.md b/content/posts/rstudio.md index 53cc2c4..bd289b1 100644 --- a/content/posts/rstudio.md +++ b/content/posts/rstudio.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="rstudio" description="click to read about rstudio" diff --git a/content/posts/rust.md b/content/posts/rust.md index 1dd976a..87205b9 100644 --- a/content/posts/rust.md +++ b/content/posts/rust.md @@ -1,6 +1,6 @@ +++ -date="2022-12-25" +date="2023-02-03" author="spanskiduh" title="rust" description="click to read about rust" diff --git a/content/posts/services-and-process-management.md b/content/posts/services-and-process-management.md index 125eabe..278ab9a 100644 --- a/content/posts/services-and-process-management.md +++ b/content/posts/services-and-process-management.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="services-and-process-management" description="click to read about services-and-process-management" diff --git a/content/posts/squid.md b/content/posts/squid.md index a676618..03899e9 100644 --- a/content/posts/squid.md +++ b/content/posts/squid.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="squid" description="click to read about squid" diff --git a/content/posts/symlinks.md b/content/posts/symlinks.md index d9ff33e..2d5d3ef 100644 --- a/content/posts/symlinks.md +++ b/content/posts/symlinks.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="symlinks" description="click to read about symlinks" diff --git a/content/posts/system-information.md b/content/posts/system-information.md index 669437a..d058423 100644 --- a/content/posts/system-information.md +++ b/content/posts/system-information.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="system-information" description="click to read about system-information" diff --git a/content/posts/tmux.md b/content/posts/tmux.md index 76b4e97..97902bf 100644 --- a/content/posts/tmux.md +++ b/content/posts/tmux.md @@ -1,12 +1,11 @@ +++ -date="2022-12-24" +date="2023-02-04" author="spanskiduh" title="tmux" description="click to read about tmux" +++ # Tmux - ### Window operations - `ctrl+b c` - spawn new window - `ctrl+b n` - move to next window @@ -60,3 +59,8 @@ tmux new-session ssh "${ssh_list[0]}" ';' \ set-option -w synchronize-panes ``` [source](https://unix.stackexchange.com/a/533673) + + +## Source updated config file? + +`:source-file ~/.tmux.conf` diff --git a/content/posts/uart.md b/content/posts/uart.md index 08fb214..f72a0bf 100644 --- a/content/posts/uart.md +++ b/content/posts/uart.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="uart" description="click to read about uart" diff --git a/content/posts/ufw.md b/content/posts/ufw.md index cc65ce0..6d87fc5 100644 --- a/content/posts/ufw.md +++ b/content/posts/ufw.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="ufw" description="click to read about ufw" diff --git a/content/posts/vim_tutor.md b/content/posts/vim_tutor.md index 7a8a0ba..aab4427 100644 --- a/content/posts/vim_tutor.md +++ b/content/posts/vim_tutor.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="vim_tutor" description="click to read about vim_tutor" diff --git a/content/posts/wasm.md b/content/posts/wasm.md index 223d23f..9ee1c9c 100644 --- a/content/posts/wasm.md +++ b/content/posts/wasm.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="wasm" description="click to read about wasm" diff --git a/content/posts/wl-mirror.md b/content/posts/wl-mirror.md index dd51641..3261369 100644 --- a/content/posts/wl-mirror.md +++ b/content/posts/wl-mirror.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="wl-mirror" description="click to read about wl-mirror" diff --git a/content/posts/yaml.md b/content/posts/yaml.md index 50be5a7..5714108 100644 --- a/content/posts/yaml.md +++ b/content/posts/yaml.md @@ -1,6 +1,6 @@ +++ -date="2022-12-24" +date="2023-02-03" author="spanskiduh" title="yaml" description="click to read about yaml" diff --git a/scripts/move.py b/scripts/move.py index b545104..2c0b964 100644 --- a/scripts/move.py +++ b/scripts/move.py @@ -5,7 +5,7 @@ header = { "author": "spanskiduh", } -MD_NOTES_DIR = "../../md-notes/" +MD_NOTES_DIR = "../../../md-notes/" POSTS_DIR = "../content/posts/" def main():