All the question that scared me now i am trying to scare them .. so that they cant scare others :)
Friday, February 9, 2024
#Bash #Prompt Generator
#BashPromptGenerator Websites In the realm of command line interfaces, the #Bash prompt serves as an essential tool for developers and system administrators alike. While its default appearance offers functionality, many users seek to personalize their Bash prompt to boost productivity and aesthetics. Enter #BashPromptGenerator websites, providing users with the means to craft custom prompts tailored to their preferences and workflow. #BashPromptGenerator websites, such as Bashrcgenerator.com, Ezprompt.net, and Bash-Prompt-Generator.com, offer intuitive interfaces for designing and generating Bash prompts. These platforms boast a plethora of customization options, allowing users to tweak various aspects of their prompt, including colors, fonts, symbols, and display information. One of the standout features of these websites is the interactive preview functionality, enabling users to visualize changes in real-time. This instant feedback loop empowers users to experiment with different configurations until they achieve the desired look and feel for their prompt. Additionally, #BashPromptGenerator websites often provide pre-defined themes and templates, catering to users who prefer a quick and hassle-free customization experience. These templates span a wide range of styles, from sleek and minimalist designs to elaborate and eye-catching layouts, appealing to diverse user preferences. Beyond aesthetics, #BashPromptGenerator websites offer practical features to enhance functionality and usability. Users can incorporate dynamic elements into their prompt, such as displaying the current directory, Git branch, username, hostname, or system information. These dynamic prompts offer valuable context and information, streamlining workflow and improving productivity. Furthermore, #BashPromptGenerator websites cater to users of all skill levels, from novices to seasoned Bash enthusiasts. Beginners can leverage the user-friendly interface and pre-defined templates to create customized prompts effortlessly, while advanced users can delve into the generated code, fine-tuning and customizing it to their specific requirements. In conclusion, #BashPromptGenerator websites empower users to personalize their command line experience, offering a plethora of customization options, intuitive interfaces, and practical features. Whether you're aiming for a minimalist design or a feature-rich prompt, these websites provide the tools and resources to create a Bash prompt that reflects your individual style and boosts your productivity.
Wednesday, February 7, 2024
Starting the output failed. Please check the log for details, NOTE: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.
If you are facing this error
Go to settings :
Trying changing this setting:
click on star menu search for "Game Mode" and the dialog box that opens disable this setting:
#Startingtheoutputfailed, #Failed To #StartRecording - #NVENC #Encoder : #OBS #Streaming #Recordong
Thursday, February 1, 2024
Move files found using find command to another directory with struture of source
To move files found using the find command to another directory while maintaining the source directory structure, you can use the cp (copy) command along with the --parents option and then rm (remove) to delete the original files. Here's an example:
find /path/to/search -type f -name "*.txt" -exec sh -c 'cp --parents "{}" /path/to/destination/ && rm "{}"' \;
In this command:
- /path/to/search is the directory where you want to start the search.
- -type f specifies that you are looking for files (not directories).
- -name "*.txt" specifies the pattern to match for file names (replace with your desired file extension or pattern).
- -exec sh -c 'cp --parents "{}" /path/to/destination/ && rm "{}"' \; executes a shell command for each file found. This command copies the file to the destination directory while preserving the directory structure using --parents and then removes the original file.
Finding files with extensions using find command and files which are 90 days old
find /path/to/search -mtime +90 -type f \( -name "*.txt" -o -name "*.pdf" -o -name "*.doc" \)
This will find all the files in directory /path/to/search which are 90 days old and files having extention as txt, pdf, doc.
Like this you can add many extention and specify time accordingly to find specified days old files.
Monday, January 22, 2024
Which JRE or JDK am I using?
Here are some examples using which you can get java versions on linux systems:
- java -version
- java -XshowSettings:properties -version
- ls -l $(which java)
- ll /usr/lib/java*
- ls -l /etc/alternatives/java
- dirname $(readlink -f $(which java))
- alternatives --display java
- rpm -qa | grep jdk
- ll /usr/lib/j*
Thursday, January 18, 2024
.Xauthority does not exist
Here are a few steps to address this issue:
1. Check for the Existence of .Xauthority:
Ensure that the `.Xauthority` file exists in the home directory of the user attempting to start the X session. You can check using the following command:
---------------------------------------------------------------------------------
ls -la ~/.Xauthority
---------------------------------------------------------------------------------
If the file doesn't exist, it may need to be created.
2. Create .Xauthority File:
If the `.Xauthority` file is missing, you can create it using the following command:
---------------------------------------------------------------------------------
touch ~/.Xauthority
---------------------------------------------------------------------------------
If it still doesn't exist or there are permission issues, you can try to recreate it by running the following commands:
---------------------------------------------------------------------------------
xauth generate :0 . trusted
---------------------------------------------------------------------------------
3. Check Permissions:
Ensure that the user has the correct permissions for the `.Xauthority` file. The file should be owned by the user, and the user should have read and write permissions. You can adjust the permissions using the `chmod` command:
---------------------------------------------------------------------------------
chmod 600 ~/.Xauthority
---------------------------------------------------------------------------------
4. Ensure xauth Package is Installed:
In some cases, the `xauth` package may not be installed. Install it using the package manager specific to your distribution. For example, on Debian/Ubuntu-based systems, you can use:
---------------------------------------------------------------------------------
sudo apt-get install xauth
---------------------------------------------------------------------------------
5. Check for Disk Space:
Ensure that there is sufficient disk space on the system. A lack of disk space could potentially prevent the creation or access of the `.Xauthority` file.
6. Check for Multiple Users:
If you are switching between users, make sure that you have proper permissions and that the `.Xauthority` file is accessible to both users.
After performing these steps, try restarting the X session or running the X application again. If the problem persists, there may be specific details about your system configuration or usage scenario that need further investigation.
The `.Xauthority` file plays a crucial role in X Window System (X11) sessions on Unix-like operating systems. Its primary purpose is to manage authorization and security for X client-server communication. Here's a breakdown of its significance:
1. Authorization:
-- When an X client (an application that displays its user interface using X11) attempts to connect to an X server (a program that manages the display), the server needs to authenticate the client's identity.
-- The `.Xauthority` file stores authorization data that allows X clients to prove their identity to the X server.
2. Security:
-- The X Window System relies on a client-server model where X clients request services (e.g., displaying windows) from an X server.
-- To prevent unauthorized access to the X server, the `.Xauthority` file ensures that only authorized clients can connect to the server.
3. Cookie-Based Authentication:
-- The `.Xauthority` file contains "cookies," which are random data strings shared between the X server and authorized X clients.
-- When a client attempts to connect, it provides the server with its cookie. If the cookie matches the entry in the `.Xauthority` file, the connection is authenticated.
4. Per-User Basis:
-- Each user has their own `.Xauthority` file located in their home directory (`~`). This ensures that authorization information is kept separate for each user.
5. Dynamic Generation:
-- The `.Xauthority` file is typically dynamically generated and managed by the `xauth` utility. The `xauth` command allows users to view, add, and remove entries in the `.Xauthority` file.
In summary, the `.Xauthority` file is a key component in the X11 security model, providing a mechanism for authenticating X clients and ensuring secure communication between clients and servers. It helps prevent unauthorized access to the graphical user interface and contributes to the overall security of X Window System sessions on Unix-like systems.
Friday, December 22, 2023
Difference between #BIOS and #UEFI for someone new to computers:
BIOS stands for Basic Input/Output System. It's like the computer's first language—it tells your computer how to start up when you press the power button. It's been around for a long time and works with older systems. Imagine it as an old, reliable but somewhat limited way of starting your computer.
UEFI stands for Unified Extensible Firmware Interface. It's like a newer and more versatile version of BIOS. UEFI does the same job as BIOS but in a more modern way. It's like upgrading from an older phone to a newer one with better features. UEFI is more flexible, faster, and can handle bigger and newer hard drives.
One key difference is that BIOS uses a simple text-based interface, while UEFI has a graphical interface that's easier to navigate. Also, UEFI supports more security features, like Secure Boot, which helps protect your computer from certain types of malware during startup.
So, think of BIOS as the old but reliable way your computer starts up, and UEFI as the newer, more advanced method that offers better features and security.
Thursday, December 21, 2023
How to i see list of only file and sort by type and see count of each type of files
find . -type f -printf "%f\n" | awk -F. '{print $NF}' | sort | uniq -c
find . -type f -printf "%f\n": This finds all files (-type f) in the current directory (.) and prints only their names (%f) followed by a newline.awk -F. '{print $NF}': This usesawkto extract the file extensions by splitting each filename at the dot (.) and printing the last field ($NF).sort: This sorts the file extensions alphabetically.uniq -c: This counts the occurrences of each unique file extension.
This command will output a list showing the count of each file type in the current directory. Adjust the starting directory in the find command (. in this example) if you want to search in a different directory.
Display both head and tail of a file or a ls command output or anyother command
Following Commands will basically show head and tail of a command or a file at once, basically it will sho the start and end of a file or a command.
Combining head and tail using cat
cat filename | head && echo "..." && cat filename | tail
Using sed command to display both head and tail:
sed -n -e '1,10p' -e '$p' filename
To view both the head and tail of the output from an ls command, you can combine head and tail commands together with a pipe (|) to display both at the same time.
ls -l | { head; echo "..."; tail; }
ls -l > temp_file && { head temp_file; echo "..."; tail temp_file; } && rm temp_file
Featured Posts
How to Auto-Terminate Frozen and Hung Apps in Windows
We have all been there. You are in the middle of an important project or a gaming session, and suddenly, your screen freezes. The dreaded ...
-
public struct CoOrds { public int x, y; public CoOrds( int p1, int p2) { x = p1; y = p2; } }
-
LM Studio Overview LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs)...