Skip to main content

Posts

Showing posts from March, 2024

Recover lost files on Windows, free and effective

 Windows File Recovery If necessary, download and launch the app from Microsoft Store. Press the Windows key, enter Windows File Recovery in the search box, and then select Windows File Recovery. When you are prompted to allow the app to make changes to your device, select Yes. In the Command Prompt window, enter the command in the following format:  winfr source-drive: destination-drive: [/mode] [/switches] There are 2 basic modes you can use to recover files: Regular and Extensive.  Regular mode examples Recover your Documents folder from your C: drive to the recovery folder on an E: drive. Don’t forget the backslash (\) at the end of the folder.   winfr C: E: /regular /n \Users\<username>\Documents\  Recover PDF and Word files from your C: drive to the recovery folder on an E: drive.  winfr C: E: /regular /n *.pdf /n *.docx  Extensive mode examples   winfr E: C: /extensive /n *invoice*  Recover jpeg and png photos from your...

Archiving all messages on LinkedIn

Open https://www.linkedin.com/ in a web browser, got to developer option and then paste the script in Console window and clink enter. timer = setInterval(() => { // select all messages items = document.querySelectorAll('div.msg-selectable-entity__checkbox-container > input'); for (let i = 0; i < items.length; i++) { items[i].click(); } setTimeout(() => { // click archive button buttons = document.querySelectorAll('div.display-flex.mvA > button[title="Archive"]'); if (buttons.length == 1) { buttons[0].click(); } }, 1000); }, 5000) Credit to Gaidar Magdanurov

Git: create a patch of the last two commits

 To merge two patch files into a single patch file or create a patch of the last two commits, you can use the `git diff` and `git apply` commands. Here are the steps for each scenario: ### Merge Two Patch Files into a Single Patch File: 1. Suppose you have two patch files named `patch1.patch` and `patch2.patch`. 2. To merge them into a single patch file, you can use the `cat` command:    ```bash    cat patch1.patch patch2.patch > combined.patch    ```    This command concatenates the contents of both patch files into a new file named `combined.patch`. ### Create a Patch of the Last Two Commits: 1. Generate a patch file for the last two commits using the `git diff` command:    ```bash    git diff HEAD~2..HEAD > last_two_commits.patch    ```    This command creates a patch file (`last_two_commits.patch`) that represents the changes introduced in the last two commits. 2. Apply the generated patch fil...

Find files that contain the word 'xxx' but do not contain the word 'yyy' in the same file

  Find files that contain the word 'xxx' but do not contain the word 'yyy' in the same file ```bash grep -rl 'xxx' /path/to/search/* | xargs grep -L 'yyy' ``` This command first searches for files containing 'xxx' using the `-r` (recursive) and `-l` (only file names) options. Then, it pipes the results to `xargs` to search for files that do not contain 'yyy' using the `-L` option. Make sure to replace `/path/to/search/*` with the actual path or file pattern you want to search.