مرحباً بك, ضيف
يجب عليك التسجيل حتى تتمكن من المشاركة في المنتدى.

إسم المستخدم
  

كلمة المرور
  





البحث في المنتديات

(البحث المتقدم)

احصائيات المنتدى
» الأعضاء: 3
» آخر عضو: fly
» مواضيع المنتدى: 13
» مشاركات المنتدى: 14

الإحصائية الكاملة

المتواجدون الآن
يوجد حاليًا 2 مستخدمون متصلون.
» 0 عضو (أعضاء) | 2 زائر (زوار)

آخر المواضيع
How to Free Up Space From...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: master-str
12-01-2025, 06:27 PM
» الردود: 0
» المشاهدات: 5
reading text character fo...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: ftth
11-05-2025, 10:38 AM
» الردود: 0
» المشاهدات: 3
script input_password= in...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: ftth
11-04-2025, 09:38 AM
» الردود: 0
» المشاهدات: 1
Passing the file name as ...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: ftth
11-04-2025, 09:18 AM
» الردود: 0
» المشاهدات: 2
Encrypting a file line by...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: ftth
11-04-2025, 08:52 AM
» الردود: 0
» المشاهدات: 9
OpenSSL Webterm
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: master-str
10-27-2025, 10:51 PM
» الردود: 0
» المشاهدات: 8
Download Node.js®
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: master-str
10-27-2025, 10:49 PM
» الردود: 0
» المشاهدات: 3
OpenSSL to Encrypt Messag...
المنتدي: شروحات و مشاكل الـ VPS و LINUX
آخر مشاركة: master-str
10-25-2025, 07:36 PM
» الردود: 0
» المشاهدات: 23
( اليكم جديد ا...
المنتدي: مشاكل الأجهزة الإلكترونية
آخر مشاركة: master-str
10-19-2025, 10:35 AM
» الردود: 1
» المشاهدات: 19

 
  How to Free Up Space From sda1 on Linux
تم النشر بواسطة: master-str - 12-01-2025, 06:27 PM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

Solution
After trying many different methods that may work for you, such as running the commands 
كود:
sudo apt autoremove
 or 
كود:
sudo apt autoclean
 , the solution is:
Run 
كود:
du -hs * | sort -h
 and the terminal will output all the directories and files of your current directory in ascending order so that you can see which files or directories are taking so much storage. The output will look like this:
[صورة: 1*lB-nmhCEUFD-w5OmwLhA1A.png]
Now you can see which files or directories are taking much space and delete them using 
كود:
rm -rf filename
 or 
كود:
rm -rf directory_name
 . I did it and after running 
كود:
df -h
 again, I now had 88% — instead of 100% — of memory used from the 
كود:
dev/sda1
 directory. Even though I had deleted many files and directories, it seemed strange to me that something was still occupying so much space. And here comes a powerful tool that solved my problems and of which I knew nothing before running into this issue.
NCDU
NCDU shows you which files and directories are taking the most space on the directory you run it — but it shows even the hidden files and directories that the other commands we used so far are unable to show. I did show you the other commands though because finding the big files and deleting them manually helped me to get some space — even if it was only a bit — so that I could install 
كود:
ncdu
 by running the command 
كود:
sudo apt-get install ncdu
 . Now, running the command 
كود:
ncdu path
 will show you what you need to find out — path being the directory you want to inspect, which on my case path was equal to 
كود:
/home/myusername
 . You will see something like this:
[صورة: 1*xeepCgVgiq7in2L8V3cYfg.png]
Here we go! After I solved the issue, you can see that anaconda3 takes up the most space, but before solving the issue, 
كود:
.local
 took about 4GiB of my memory — that is a lot. Also, 
كود:
.cache
 was a big part of the problem.
You now only need to remove the biggest files in these directories. I do not recommend removing all of the content inside them at once, but there are different opinions about it over the internet. But make some research so that you will not be doing something damageable for your computer. So, now, just run 
كود:
cd .cache
 and run 
كود:
du -hs * | sort -h
 to find which applications’ caches are unnecessarily big. Then, run 
كود:
rm -rf filename
 where the filename will be the name of the file you want to remove. Also, if 
كود:
.local
 is taking much space too, run 
كود:
rm -rf ~/.local/share/Trash
 to remove all the trash that has been saved — if you don't care about them, of course. If the 
كود:
.thumbs/
 file is also taking much space, run 
كود:
rm -rf ~/.thumbs/*
 .
After doing all of this and removing the anaconda files I had before and trying running its installer again, the installation succeed, and now I can use it without any problems.
Credits to this helpful article on NCDU that was a light for me:

طباعة هذا الجزء

  reading text character for character script shell
تم النشر بواسطة: ftth - 11-05-2025, 10:38 AM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

[left]To read text character by character in a shell script, you can utilize the read command with the -n1 option within a loop. This approach allows processing of a file or input stream one character at a time.[/left]
[left][size=4]Example Script:[/size]
[size=2]Code[/size]
[center][/center]

كود:
#!/bin/bash
# Prompt the user to enter a file name
read -p "Enter file name: " filename
# Check if the file exists
if [[ ! -f "$filename" ]]; then
    echo "Error: File '$filename' not found."
    exit 1
fi
echo "Reading characters from '$filename':"
# Loop to read the file character by character
while IFS= read -r -n1 character; do
    # Process each character (e.g., print it)
    echo "Character: '$character'"
done < "$filename"
echo "End of file."

[size=4]Explanation:[/size][/left]
[left][/left]
[left][size=4]#!/bin/bash: This is the shebang line, specifying that the script should be executed with Bash.
[/size]

[size=4]read -p "Enter file name: " filename: Prompts the user to enter a file name and stores it in the filename variable.[/size]
[size=4]if [[ ! -f "$filename" ]]; then ... fi: Checks if the provided file exists. If not, an error message is displayed, and the script exits.[/size]
[size=4]while IFS= read -r -n1 character; do ... done < "$filename": This is the core of the character-by-character reading.[/size]
[size=4]IFS=: Temporarily clears the Internal Field Separator to prevent word splitting and globbing, ensuring that special characters are read literally.[/size]
[size=4]read -r -n1 character:[/size]
[size=4]-r: Prevents backslash escapes from being interpreted.[/size]
[size=4]-n1: Specifies that read should read exactly one character.[/size]
[size=4]character: The variable where the read character will be stored.[/size]
[size=4]< "$filename": Redirects the content of the specified file as input to the while loop.[/size]
[size=4]echo "Character: '$character'": Inside the loop, this line prints each character that is read. You can replace this with any other processing logic for the character.[/size]
[size=4]This script demonstrates a robust method for reading and processing text files character by character in a Bash shell environment.[/size][/left]

طباعة هذا الجزء

  script input_password= in shell script
تم النشر بواسطة: ftth - 11-04-2025, 09:38 AM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

To obtain a password input in a shell script without echoing the characters to the terminal, the read command with the -s option is typically used.
Here is an example:


كود:
#!/bin/bash

echo "Enter your password:"
read -s password_variable
echo # Add a newline after silent input
echo "Password has been entered."

# You can now use $password_variable in your script
# For example:
# echo "The entered password is: $password_variable" # Be cautious with echoing se
Explanation:
echo "Enter your password:": This line displays a prompt to the user.
read -s password_variable:
read: This command reads a line of input from the user.
-s: This option makes the input silent, meaning the characters typed by the user will not be displayed on the screen.
password_variable: This is the name of the variable where the entered password will be stored.
echo: After the silent input, it is good practice to add an echo command to print a newline, ensuring subsequent output starts on a new line.
Important Security Considerations:
Avoid storing passwords in plain text: Do not store the entered password directly in files or environment variables if possible, as this poses a security risk.
Use secure methods for password handling: For more complex scenarios, consider using tools like expect for automating interactions with programs requiring passwords or integrating with secure credential management systems.
Limit exposure of sensitive information: Be mindful of where and how you use the password_variable to prevent accidental disclosure.

طباعة هذا الجزء

  Passing the file name as a command-line argument
تم النشر بواسطة: ftth - 11-04-2025, 09:18 AM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

How to run the script:
bash
كود:
./your_script.sh /path/to/input_file.txt
[b]Inside [/b]
كود:
your_script.sh
[b]:[/b]
You would use the variable 
كود:
$1
 to refer to the file path. 
bash
كود:
#!/bin/bash

INPUT_FILE="$1"

# Check if file was provided and exists
if [ -z "$INPUT_FILE" ]; then
  echo "Usage: $0 <input_file>"
  exit 1
fi

if [ ! -f "$INPUT_FILE" ]; then
  echo "Error: File not found at $INPUT_FILE"
  exit 1
fi

# Example: Read the file line by line
while IFS= read -r line; do
  echo "Next line: $line"
done < "$INPUT_FILE"
Redirecting the file content to standard input
The script reads directly from its standard input (stdin), which the shell connects to the file's content using the 
كود:
<
 operator. 
[b]How to run the script:[/b]
bash
كود:
./your_script.sh < /path/to/input_file.txt
[b]Inside [/b]
كود:
your_script.sh
[b]:[/b]
The script uses commands that read from stdin, such as 
كود:
read
كود:
cat
كود:
grep
كود:
tr
, etc. 
bash
كود:
#!/bin/bash

# Example: Read from standard input line by line
while IFS= read -r line; do
  echo "Next line: $line"
done
# The loop reads from stdin because no redirection is specified in the while command itself.

# Alternatively, other commands can use stdin directly:
# tr 'a-z' 'A-Z' # This would convert all input to uppercase
3. Using custom argument parsing (for 
كود:
input_file=
)
If you want to use the specific 
كود:
input_file=
 format as in your example, you need to parse the arguments manually within your script.
[b]How to run the script:[/b]
bash
كود:
./your_script.sh input_file=/path/to/file.txt
[b]Inside [/b]
كود:
your_script.sh
[b]:[/b]
bash
كود:
#!/bin/bash

for arg in "$@"; do
  case "$arg" in
    input_file=*)
      INPUT_FILE="${arg#*=}" # Extract the value after the '='
      ;;
    *)
      # Handle other arguments or errors
      ;;
  esac
done

# Now you can use $INPUT_FILE as in Method 1
if [ -f "$INPUT_FILE" ]; then
  echo "Processing file: $INPUT_FILE"
  # ... processing code here ...
else
  echo "Error: File not found or not specified."
fi

طباعة هذا الجزء

  Encrypting a file line by line
تم النشر بواسطة: ftth - 11-04-2025, 08:52 AM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

Encrypting a file line by line 
You can use a Bash loop to process the file line by line. This example uses 
How to run the script:
bash
كود:
./Encryptinglinebyline.sh /path/to/input_file.txt
bash
كود:
#!/bin/bash

#INPUT_FILE="/path/to/file.txt"

# Example: Read the file line by line  ./your_script.sh /path/to/input_file.txt

INPUT_FILE="$1"

# Check if file was provided and exists
if [ -z "$INPUT_FILE" ]; then
  echo "Usage: $0 <input_file>"
  exit 1
fi

if [ ! -f "$INPUT_FILE" ]; then
  echo "Error: File not found at $INPUT_FILE"
  exit 1
fi
OUTPUT_FILE="encrypted.txt"
PASSPHRASE="your_secret_password" # Replace with your actual password

> "$OUTPUT_FILE" # Clear the output file

while IFS= read -r line
do
  # Skip empty lines if necessary
  if [ -z "$line" ]; then
    continue
  fi
  # Encrypt the line and append to the output file
  echo "$line" | openssl enc -aes-256-cbc -a -salt -pbkdf2 -pass pass:"$PASSPHRASE" >> "$OUTPUT_FILE"
done < "$INPUT_FILE"

echo "Encryption complete. Encrypted data saved to $OUTPUT_FILE"
Decrypting the file line by line
The decryption process also involves reading each line of the encrypted file and decrypting it individually. 
bash
كود:
#!/bin/bash

#INPUT_FILE="/path/to/file_encrypted.txt"

# Example: Read the file line by line  ./your_script.sh /path/to/input_file.txt

INPUT_FILE="$1"

# Check if file was provided and exists
if [ -z "$INPUT_FILE" ]; then
  echo "Usage: $0 <input_file>"
  exit 1
fi

if [ ! -f "$INPUT_FILE" ]; then
  echo "Error: File not found at $INPUT_FILE"
  exit 1
fi
OUTPUT_FILE="decrypted.txt"
PASSPHRASE="your_secret_password" # Use the same password used for encryption

> "$OUTPUT_FILE" # Clear the output file

while IFS= read -r line
do
  # Decrypt the line and append to the output file
  echo "$line" | openssl enc -d -aes-256-cbc -a -salt -pbkdf2 -pass pass:"$PASSPHRASE" >> "$OUTPUT_FILE"
done < "$INPUT_FILE"

echo "Decryption complete. Decrypted data saved to $OUTPUT_FILE"
Alternative: Encrypting the entire file at once 
For most standard use cases, it is much simpler and more efficient to encrypt the entire file using a single OpenSSL command: 
[b]Encryption:[/b]
bash
كود:
openssl enc -aes-256-cbc -salt -pbkdf2 -a -e -in plaintext.txt -out encrypted.txt
[b]Decryption:[/b]
bash
كود:
openssl enc -d -aes-256-cbc -salt -pbkdf2 -a -in encrypted.txt -out decrypted.txt

طباعة هذا الجزء

  OpenSSL Webterm
تم النشر بواسطة: master-str - 10-27-2025, 10:51 PM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

image
[صورة: 157410455-686ce0de-335f-4335-a639-07b6963e4589.png]
Installation
First, install Node.js and npm. Then clone this project and install its dependencies:

$ git clone https://github.com/cryptool-org/openssl-webterm.git
$ cd openssl-webterm
$ npm install
Then start a Webpack development server:

$ npm run serve

You can now view the OpenSSL Webterm at https://localhost:4200.

الموقع الرسمي
https://github.com/cryptool-org/openssl-...me-ov-file



الملفات المرفقة
.zip   openssl-webterm-master.zip (الحجم: 1.5 MB / التحميلات: 0)
طباعة هذا الجزء

  Download Node.js®
تم النشر بواسطة: master-str - 10-27-2025, 10:49 PM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh...install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 22

# Verify the Node.js version:
node -v # Should print "v22.21.0".

# Verify npm version:
npm -v # Should pr

int "10.9.4".

الموقع الرسمي 
https://nodejs.org/en/download

طباعة هذا الجزء

  OpenSSL to Encrypt Messages and Files on Linux
تم النشر بواسطة: master-str - 10-25-2025, 07:36 PM - المنتدي: شروحات و مشاكل الـ VPS و LINUX - لا توجد ردود

استخدام OpenSSL لتشفير الرسائل والملفات على Linux

[b]في هذا البرنامج التعليمي سوف تتعلم:[/b]
  • كيفية تشفير رسالة باستخدام OpenSSL
  • كيفية فك تشفير رسالة مشفرة باستخدام OpenSSL
  • كيفية تشفير ملف باستخدام OpenSSL
  • كيفية فك تشفير ملف مشفر باستخدام OpenSSL
  • خوارزميات التشفير المختلفة المتوفرة في OpenSSL
[صورة: 00-using-openssl-to-encrypt-messages-and...linux.avif]استخدام OpenSSL لتشفير الرسائل والملفات على Linux
متطلبات البرمجيات واتفاقيات سطر أوامر لينكسفئة
المتطلبات أو الاتفاقيات أو إصدار البرنامج المستخدمنظام
نظام لينكس
برمجة
أوبن إس إس إل
آخر
المعرفة الأساسية بسطر أوامر لينكس
الاتفاقيات
[b][b]#[/b] – يتطلب تنفيذ أوامر لينكس المحددة باستخدام امتيازات الجذر إما بشكل مباشر كمستخدم جذر أو باستخدام [/b]
كود:
sudo
الأمر
تشفير الرسائل والملفات باستخدام OpenSSL
يوفر OpenSSL مجموعة متنوعة من خوارزميات التشفير لتأمين الرسائل والملفات. تتيح هذه المرونة للمستخدمين اختيار الطريقة الأنسب لاحتياجاتهم الخاصة. فيما يلي خمس طرق لتشفير البيانات وفك تشفيرها باستخدام OpenSSL.
  1. [b]تشفير رسالة بكلمة مرور[/b] : تُشفّر هذه الطريقة الرسالة باستخدام كلمة مرور، وهي مطلوبة لفك تشفيرها. يُنصح باستخدام `-pbkdf2` لمزيد من الأمان.
    $ echo "LinuxConfig.org" | openssl enc -aes-256-cbc -a -salt -pbkdf2 -pass pass:mysecretpassword
    U2FsdGVkX19W9lxb8u93hvzRYaTr7rh8Pn6gOKzGJaMjjcQeIcR+PfIKLavho9qF
    يستخدم هذا الأمر خوارزمية التشفير AES-256-CBC لتشفير رسالة "LinuxConfig.org". يضمن الرمز `-a` ترميز المخرجات بتنسيق base64، مما يُسهّل التعامل معها كسلسلة نصية. يُوصى باستخدام الرمز `-pbkdf2` لتحسين أمان اشتقاق المفتاح.
  2. [b]فك تشفير رسالة باستخدام كلمة المرور[/b] : تقوم هذه الطريقة بفك تشفير الرسالة المشفرة في الخطوة السابقة باستخدام نفس كلمة المرور.
    $ echo "U2FsdGVkX1/POwwfJq2VK3mqDqFO1Ttfuc+q8UuvoQ4Z0F2byx1uNI3NSjeipkAi" | openssl enc -aes-256-cbc -a -d -salt -pbkdf2 -pass pass:mysecretpassword
    استبدل "U2FsdGVkX1/POwwfJq2VK3mqDqFO1Ttfuc+q8UuvoQ4Z0F2byx1uNI3NSjeipkAi" بالرسالة المشفرة الفعلية. يشير الرمز `-d` إلى فك التشفير.
    [صورة: 01-using-openssl-to-encrypt-messages-and...linux.avif]تشفير وفك تشفير الرسالة باستخدام كلمة مرور
  3. [b]تشفير ملف باستخدام كلمة مرور[/b] : تقوم هذه الطريقة بتشفير محتويات الملف باستخدام كلمة مرور.
    $ openssl enc -aes-256-cbc -salt -pbkdf2 -in mydata.txt -out mydata.txt.enc -pass pass:mysecretpassword
    يقوم هذا الأمر بقراءة الملف `mydata.txt`، ويقوم بتشفير محتوياته باستخدام AES-256-CBC، ثم يكتب البيانات المشفرة في `mydata.txt.enc`.


  4. [b]فك تشفير ملف باستخدام كلمة مرور[/b] : تقوم هذه الطريقة بفك تشفير الملف المشفر في الخطوة السابقة باستخدام نفس كلمة المرور.
    $ openssl enc -aes-256-cbc -d -salt -pbkdf2 -in mydata.txt.enc -out mydata.txt -pass pass:mysecretpassword
    يقوم هذا الأمر بقراءة الملف المشفر `mydata.txt.enc`، وفك تشفير محتوياته، وكتابة البيانات الأصلية مرة أخرى في `mydata.txt`.
    [صورة: 02-using-openssl-to-encrypt-messages-and...linux.avif]تشفير وفك تشفير ملف باستخدام كلمة مرور
  5. [b]التشفير وفك التشفير باستخدام زوج مفاتيح عام/خاص[/b] : تتضمن هذه الطريقة تشفير رسالة بمفتاح عام وفك تشفيرها بمفتاح خاص مماثل.
    إنشاء زوج مفاتيح:
    $ openssl genpkey -algorithm RSA -out private_key.pem -aes256
    $ openssl rsa -pubout -in private_key.pem -out public_key.pem
    [صورة: 03-using-openssl-to-encrypt-messages-and...linux.avif]إنشاء زوج مفاتيح SSL


    تشفير الرسالة:


    $ echo "LinuxConfig.org" | openssl pkeyutl -encrypt -pubin -inkey public_key.pem -out encrypted_message.bin
    فك تشفير الرسالة:


    $ openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted_message.bin
    في هذه الطريقة، يتم تشفير الرسالة بالمفتاح العام ولا يمكن فك تشفيرها إلا بالمفتاح الخاص المقابل، مما يضمن الاتصال الآمن.
    [صورة: 04-using-openssl-to-encrypt-messages-and...linux.avif]تشفير وفك تشفير الرسائل باستخدام أزواج مفاتيح OpenSSL.
خاتمة
يوفر OpenSSL أدوات فعّالة لتشفير وفك تشفير الرسائل والملفات على نظام Linux. بإتقان هذه الأساليب، يمكنك تعزيز أمان بياناتك بشكل ملحوظ. سواء كنت تفضل التشفير بكلمة مرور أو الأمان القوي لأزواج المفاتيح العامة/الخاصة، فإن OpenSSL لديه الإمكانيات اللازمة لتلبية احتياجاتك من التشفير.

طباعة هذا الجزء

  ( اليكم جديد المبرمجة CH341A CH341A-tool-master)
تم النشر بواسطة: ftth - 10-19-2025, 10:35 AM - المنتدي: مشاكل الأجهزة الإلكترونية - الردود (1)

[صورة: AqwvBYd.png]
 
 
اليكم جديد المبرمجة
 
 CH341A
[b] 

[/b]

[b][صورة: CH341A_programmer.jpg] [صورة: CH341_SSD1306_GUI.png][/b]
[b]  Add VEML7700 ambient light sensor[/b]
[b] إضافة مستشعر الضوء المحيط VEML7700[/b]



الملفات المرفقة
.zip   CH341A-tool-master.by teg.zip (الحجم: 758.84 KB / التحميلات: 2)
طباعة هذا الجزء