#Linux File Globbing
Explore tagged Tumblr posts
Text
SHELLS IN LINUX
In Linux, a shell is a command-line interface that allows users to interact with the operating system. There are several types of shells in Linux, each with its unique features and capabilities. Below are some of the most commonly used shells:
1. Bash (Bourne Again Shell)
Default in many Linux distributions.
Extends the original Bourne Shell (sh).
Features: Command-line editing (using Ctrl+R for search).History (stores previously executed commands).Scripting capabilities (supports variables, loops, and conditionals).Job control (background processes).
Use case: General-purpose use, system administration, and scripting.
2. sh (Bourne Shell)
One of the oldest and simplest Unix shells.
Known for its basic functionality and portability.
Does not have some of the advanced features seen in newer shells like Bash, such as command-line editing and autocompletion.
Use case: Scripting, often used in system startup files.
3. Zsh (Z Shell)
An advanced shell with many features beyond Bash.
Features: Autocompletion and auto-suggestions. Enhanced globbing (pattern matching).Better prompt customization. Powerful scripting features.
Use case: Preferred by many developers due to its flexibility and advanced features.
4. Fish (Friendly Interactive Shell)
A user-friendly shell with an emphasis on simplicity and usability.
Features: Syntax highlighting. Autosuggestions. Easy-to-use scripting.
Use case: Ideal for those new to the shell, or those looking for a shell with a focus on user-friendliness.
5. Csh (C Shell)
Syntax similar to the C programming language.
Features: C-like scripting syntax. History and job control features. Aliases and command substitutions.
Use case: Mostly used by developers who prefer C-like syntax, though not as widely used as Bash.
6. Tcsh (TENEX C Shell)
An enhanced version of Csh.
Features: Autocompletion (for filenames and commands).Improved command-line editing. History expansion.
Use case: Sometimes preferred over Csh due to its extra features.
7. Dash (Debian Almquist Shell)
A lightweight, POSIX-compliant shell.
Known for being fast and minimalistic.
Often used as the default system shell in scripts (e.g., /bin/sh on Debian-based systems).
Use case: Scripts that require POSIX compliance and need to be lightweight and fast.
8. Ksh (Korn Shell)
A powerful shell that combines features of both the Bourne Shell and C Shell.
Features: Supports arrays. Advanced scripting features. Command-line editing and history.
Use case: Used by many commercial Unix systems, often for scripting.
9. Ash (Almquist Shell)
A lightweight, POSIX-compliant shell, similar to Dash.
Primarily used in embedded systems or lightweight environments.
Use case: Often used in small, resource-constrained systems like routers and embedded devices.
10. Elvish Shell
A modern shell designed for programming and interactive use.
Features: Structured data and built-in support for associative arrays and lists. Dynamic prompts and rich syntax.
Use case: For users who want advanced data handling and a highly customizable interactive shell.
Conclusion
Different shells offer different features tailored for various tasks, such as interactive use, scripting, or system administration. Bash remains the most popular shell due to its widespread use and powerful features, but alternatives like Zsh, Fish, and Ksh offer enhancements suited for developers and power users.
for more details please visit
www.qcsdclabs.com,
www.hawkstack.com
0 notes
Text
Top Alternatives To The Zsh Ls Command
The Zsh shell is a powerful and versatile command-line interface that enhances user productivity with its advanced features and customization options. Among the essential commands in any shell environment is the 'ls' command, which lists directory contents. However, users often seek alternatives to the default 'ls' command to overcome its limitations and enhance their workflow. This article explores the need for a replacement for the 'ls' command, focusing on improved functionality, customization, and performance.
Brief overview of the Zsh shell
Zsh (Z shell) stands as a powerful and versatile evolution of the Unix shell ecosystem, building upon the foundations laid by bash while introducing a suite of sophisticated features that enhance both interactive use and scripting capabilities.
At its core, Zsh offers an incredibly intelligent command-line interface, distinguished by its advanced tab completion system that not only completes commands and file paths but also understands command options and can even correct spelling mistakes on the fly.
Importance of the 'ls' command in shell environments
The 'ls' command is one of the most basic and commonly used tools in Unix-like shell environments. It helps users see and navigate the file system. At its simplest, 'ls' (short for "list") shows what's inside directories. However, it's also important for getting key details about files, directories, and their properties in everyday system management and use.
Limitations of the Zsh 'ls' Command
The Zsh 'ls' command is very useful, but it has some limits in today's computing environments. While it's a key tool, these limits can affect how productive and efficient you are. For example, the output can be hard to read if there are long filenames or many files in one directory, as the text may wrap and become messy. Also, the command can slow down a lot when listing directories with thousands of files, especially if you use options like '-l' that get extra information for each file.
Eza
eza is a modern replacement for the old ls command found in Unix and Linux systems. It offers more features and better default settings. It uses colors to show different file types and details. It understands symlinks, extended attributes, and Git. Plus, it's small, fast, and just one single file.
eza is the active fork of exa, continuing development after exa was discontinued. It maintains and extends exa's feature set while providing bug fixes and improvements.
Basic View Options
-1, --oneline: Display one entry per line
-G, --grid: Display entries as a grid (default)
-l, --long: Display extended details and attributes
-R, --recurse: Recurse into directories
-T, --tree: Recurse into directories as a tree
-x, --across: Sort the grid across, rather than downwards
-F, --classify: Display type indicator by file names
Visual Enhancements
--color: Control when to use terminal colors (always/automatic/never)
--color-scale: Highlight levels of file sizes distinctly
--icons: Display icons
--no-icons: Disable icons display (overrides --icons)
File Filtering
-a, --all: Show hidden and 'dot' files (use twice for . and ..)
-d, --list-dirs: List directories like regular files
-L, --level=(depth): Limit the depth of recursion
-D, --only-dirs: List only directories
--git-ignore: Ignore files mentioned in .gitignore
-I, --ignore-glob=(globs): Ignore files matching specified glob patterns
Sorting Options
-r, --reverse: Reverse the sort order
-s, --sort=(field): Sort by specified field
--group-directories-first: List directories before other files
File Information
-b, --binary: Show file sizes with binary prefixes
-B, --bytes: Show file sizes in bytes, without prefixes
-g, --group: Show file group
-h, --header: Add column headers
-H, --links: Show number of hard links
-i, --inode: Show inode number
-S, --blocks: Show number of file system blocks
-@, --extended: Show extended attributes and sizes
Timestamp Options
-m, --modified: Use modified timestamp
-t, --time=(field): Choose timestamp field
-u, --accessed: Use accessed timestamp
-U, --created: Use created timestamp
--changed: Use changed timestamp
--time-style: Control timestamp format
Field Visibility
--no-permissions: Hide permissions field
--octal-permissions: Show permissions in octal format
--no-filesize: Hide filesize field
--no-user: Hide user field
--no-time: Hide time field
Sort Fields
Valid options for --sort:
File Metadata: accessed, changed, created, modified, inode, size
Name-based: extension, Extension, name, Name, type, none
Time Aliases: date, time, newest (for modified), age, oldest (for reverse modified)
Time Styles
Available formats for --time-style:
default
iso
long-iso
full-iso
Git Integration
--git: Show Git status for tracked/ignored files
Notable Improvements Over ls
More intuitive defaults for modern terminals
Git integration
Tree view capabilities
Icon support
Color scaling for file sizes
Extended attribute viewing
Multiple timestamp viewing options
Conclusion
In conclusion, while the traditional 'ls' command in Zsh serves as a fundamental tool for file and directory listing, its limitations in terms of readability, performance, and modern features can hinder productivity. Eza emerges as a compelling replacement, offering enhanced functionality with intuitive defaults, visual improvements, and advanced features like Git integration and tree view capabilities.
By adopting Eza, users can enjoy a more efficient and visually appealing command-line experience, ultimately boosting their workflow and system interaction.
FAQ’s
What makes eza a better alternative to ls for Zsh users?
eza offers advanced features that improve the usability and aesthetics of directory listings, such as color-coded outputs, icons, and intuitive sorting options. Unlike ls, it supports Git integration, tree view, extended file attributes, and various timestamp options. These features help make file management faster and more visually organized, aligning well with Zsh's advanced capabilities.
How does eza improve readability and performance compared to ls?
eza addresses ls’s readability issues by color-scaling file sizes, using icons for quick identification, and providing an organized grid or tree view. Its performance is optimized for handling large directories by adjusting how file metadata is displayed, which can speed up the command's execution. These enhancements make it easier to navigate complex directories without clutter.
Can I use eza alongside other shell tools, like Git?
Yes, eza is designed with Git integration in mind. It can display Git status indicators for files, showing which files are tracked, modified, or ignored in a repository. This feature is particularly helpful for developers, as it offers quick insights into file statuses directly within the terminal, streamlining version control management.
Are there other ls alternatives, and why should I choose eza?
There are a few other alternatives to ls, such as lsd and colorls, which also offer enhanced visual output and additional features. However, eza stands out for its active development, expanded feature set, and user-friendly defaults. As a fork of the well-regarded exa, eza continues to improve on the same foundations with added bug fixes and enhancements, making it a top choice for modern shell users.
Can you provide a basic example of eza usage with some popular options?
Here’s a basic example:eza -l --color --icons --git
This command lists files in long format (-l), uses color-coded output (--color), displays icons for file types (--icons), and shows Git status for each file (--git). This output makes it easy to see detailed file information, identify file types quickly, and view Git statuses—all in a single, streamlined view.
0 notes
Text
shell script REGEX e File Globbing
Anotação Linux shell script REGEX e File Globbing e no Brasil o acesso a informação tá caro. A bolha tá enorme.
Linux shell script REGEX e File Globbing
---
Alguns comandos para usar no linux:
cd cd ~ cd .. cd ../../ cd - cd ~/Documentos/ cd ~/Vídeos/Legendas/Niver-Legendas/
pwd
clear
ls ls -ltr ls -ltC ls -1
ps ps axu ps axu | more
touch nome-do-arquivo-a-ser-criado touch arquivo-existente-atualiza-o-horário
man touch
echo palavra-a-ser-ecoada echo 'palavra a ser ecoada' echo -e '\nAcima \n\tNo meio…
View On WordPress
0 notes
Text
8 طرق لكيفية حذف الملفات بأمان في Linux

لقد رأينا كيفية مسح محتويات القرص الثابت بالكامل ، ولكن ماذا يحدث إذا كان كل ما تريده هو حذف ملف أو اثنين أو اثني عشر ملفًا نهائيًا؟ يوضح لك هذا الدليل بعضًا من أكثر الحلول شيوعًا لكيفية حذف الملفات بأمان في Linux.
ملاحظة: تدعم معظم محركات أقراص الحالة الثابتة (SSD) الموجودة في السوق اليوم TRIM لإدارة مساحتها الخالية ، وهي ميزة في البرامج الثابتة الخاصة بها تعيد تخصيص محتوياتها. بالاقتران مع أنظمة ملفات دفتر اليومية في Linux ، مثل Ext3 / 4 و Reiser FS ، لا يمكن ضمان الحذف بعد استعادة الملفات الفردية. الحل الوحيد في هذه الحالات هو ، للأسف ، سلاح نووي كامل لجميع محتويات قرص SSD.
1. تجاوز سلة المهملات
عند حذف ملف ، يتم نقله إلى سلة المهملات (ويعرف أيضًا باسم سلة المحذوفات). إذا كنت ترغب في ذلك ، يمكنك تجاوز مجلد المهملات. بهذه الطريقة ، لن تبقى ملفاتك المحذوفة في سلة المهملات وسيتم وضع علامة عليها تم حذفها بالكامل. على الرغم من أنه لا يزال قابلاً للاسترداد ، إلا أنه يعد خطوة للأمام للوصول إليها (في المهملات).
لحذف الملفات في توزيعة Linux مثل Kubuntu مع KDE ، قم بتشغيل مدير الملفات الافتراضي ، Dolphin. انقر فوق "قائمة -> تكوين -> تكوين Dolphin -> سلة المهملات" للوصول إلى التفضيلات ذات الصلة. لا يوجد خيار لتعطيل المهملات تمامًا ، ولكن يمكنك استخدام خدعة أنيقة تغطي معظم القواعد: تمكين حد الحجم وتقليله إلى أصغر قيمة.
على القرص الخاص بنا ، تُرجم هذا إلى 10.97 ميجابايت. ستمحو Dolphin محتويات سلة المهملات عندما تتجاوز هذه القيمة ، ومن المحتمل أن يحدث ذلك كل ساعة أخرى باستخدام سطح المكتب المعتاد. لدى مديري الملفات الآخرين مثل Nautilus أو Nemo خيارات لتجاوز سلة المهملات تمامًا.
إيجابيات - سهل الفعل - يمنحك فترة سماح قبل حذف الملفات نهائيًا سلبيات - لا يزيل أي بيانات وصفية باقية في القرص - لا تنظف البيانات من الملفات
2. استخدام shred
إذا كنت تستخدم نوعًا مختلفًا من Ubuntu ، فمن المحتمل أن تكون shred جزءًا منه. يمكنك البدء في استخدامه على الفور لحذف أي ملفات حساسة في Linux تريد إرسالها إلى النسيان تمامًا. إذا أردت حذف "image.png" نهائيًا ، فاستخدم: shred -uvz -n 4 image.png - u يخبرك shred لإزالة الملف قبل الكتابة فوقه. - v يعرض معلومات مطولة. - z يملأ المساحة التي تشغلها البيانات بالأصفار لتقليل أي فرصة للتعافي. - -n 4 يترجم إلى خمسة تمريرات حذف: تقوم عملية التمرير بتمرير واحد افتراضيًا ، وباستخدام "-n" ، يمكنك تحديد عدد التمريرات الإضافية التي تحتاجها لمزيد من الأمان. الإجماع العام هو أن خمس تمريرات يجب أن تكون أكثر من كافية لمعظم الناس.
لإزالة ملفات متعددة أو محتويات مجلد ، استخدم أحرف البدل مثل: shred -uvz -n 1 Pictures/images_0?.jpg shred -uvz -n 4 Pictures/*.* في الحالة الأولى، "؟" سيكون حرف بدل لحرف واحد ، وسيؤدي التقطيع إلى حذف الملفات المسماة "images_01.jpg" و "images_02.jpg" ، على سبيل المثال. في الحالة الثانية ، سوف تمحو عملية التقطيع جميع الملفات في دليل "الصور" ، بغض النظر عن اسمها أو نوعها. إيجابيات - سيتم حذف ملف واحد تمامًا - يمكن إجراء مطابقة glob لتغطية ملفات متعددة سلبيات - بعض علامات الخيارات غامضة - سيستغرق وقتا طويلا للانتهاء
3. استخدام dd في الملفات الفردية
يعد برنامج تعريف البيانات (dd) أداة مساعدة أخرى موجودة في كل توزيعات Linux تقريبًا اليوم. ومع ذلك ، على عكس shred ، فإن إحدى أكبر مزايا dd هي أنه يسمح لك بضبط كيفية حذف ملفاتك في Linux. لاستخدام dd ، تحتاج إلى معرفة الحجم الدقيق لملفك بالبايت: ls -l /path/to/your/file | awk '{print $5}'
يمكنك تشغيل dd على ملفك الحالي. على سبيل المثال ، سيملأ هذا الأمر ملفك بأحرف فارغة: dd status=progress bs=your_file_size count=1 if=/dev/zero of=/path/to/your/file
بصرف النظر عن ملء ملفك بأحرف فارغة ، يمكنك أيضًا إجبار dd على مسح ملفك ببيانات شبه عشوائية: dd status=progress bs=your_file_size count=1 if=/dev/urandom of=/path/to/your/file
يمكنك الآن حذف ملفك باستخدام الأمر العادي rm: rm /path/to/your/file إيجابيات - متعدد الاستخدامات - يمكنه فعل أكثر من مجرد حذف الملفات - يمكن ضبط حذف الملف سلبيات - بناء الجملة قديم ، حتى بالنسبة لبرنامج سطر الأوامر - يتطلب فهماً جيداً لأحجام الكتل
4. استخدام wipe
wipe هو بديل ممتاز آخر. ابحث عنه في مركز البرامج للتوزيع الخاص بك وقم بتثبيته من هناك أو استخدم: sudo apt install wipe
استخدامه بسيط مثل تقطيع ، إن لم يكن أكثر من ذلك. لحذف الملفات في Linux باستخدام Wipe ، قم بتشغيل: wipe Pictures/deleteme.png قد يصبح هذا أمر��ا مزعجًا ، حيث يستخدم المسح ، افتراضيًا ، الكثير من التمريرات التي تستغرق وقتًا طويلاً لتوفير مزيد من الأمان. بالإضافة إلى ذلك ، سيطلب تأكيدًا للحذف.
استخدم العلم f للتخلص من التأكيد و r للرجوع إلى الدلائل الفرعية. يخبر c بالمسح إلى chmod إذا لزم الأمر (عندما لا يحتوي الملف أو الدليل على أذونات كتابة معينة) ، ويسمح لك q بتقليل عدد التمريرات لحذف أسرع. عند استخدام q ، لاحظ أنها صغيرة. يمكن أن يتبعها حرف "Q" كبير يحدد عدد التمريرات التي تطلبها. على سبيل المثال ، الأمر البسيط سابقًا ، مع تطبيق هذه التعديلات ، سيتغير إلى: wipe -rfcq -Q 5 Pictures/deleteme.png إيجابيات - سهل الاستخدام ، حتى مع خبرة قليلة في سطر الأوامر - المعلمات الافتراضية المعقولة والآمنة سلبيات - قد تكون المعلمات الافتراضية صارمة للغاية بالنسبة لمعظم المستخدمين - قد لا تعمل بشكل جيد مع المجلات النشطة
5. استخدام الحذف الآمن
SRM هي إحدى الأدوات الموجودة في مجموعة Secure Delete التي تتخصص في الإزالة الآمنة للبيانات من محرك الأقراص الثابتة. يعتبره الكثيرون أفضل أداة لهذه الوظيفة. لتثبيت مجموعة Secure Delete كاملة على Ubuntu والتوزيعات المتوافقة ، استخدم: sudo apt install secure-delete
بعد ذلك ، يمكنك حذف أي ملف باستخدام: srm Pictures/deleteme.png
قد ترغب في استخدام علامة z التي تستبدل محتويات ملفك بالأصفار لمزيد من الأمان و v للحصول على معلومات مطولة حول العملية. في حالة التعامل مع الدلائل والأدلة الفرعية ، قم أيضًا بتضمين العلامة r للوضع العودي. إذا كانت عمليات إعادة الكتابة 38 كبيرة جدًا بالنسبة لك ، فيمكنك تقليل الوقت المطلوب - بالإضافة إلى الأمان - من خلال استخدام علامة l لتقليل عدد التمريرات إلى اثنتين "فقط". سيؤدي هذا إلى تحويل الأمر السابق إلى: srm -rlvz Pictures/deleteme.png إيجابيات - الخيارات سهلة الفهم وبديهية - يعد حذف ملف آمنًا وشاملًا للغاية سلبيات - سيستغرق وقتا طويلا للانتهاء - لا يعمل بشكل جيد مع الأنظمة التي تستخدم RAID
6. حذف الملفات في Linux مع Perl
بصرف النظر عن استخدام الأدوات ، يمكنك أيضًا الاستفادة من لغات البرمجة البسيطة ، مثل Perl ، لحذف الملفات في Linux. على سبيل المثال ، سيستبدل سطر التعليمات البرمجية التالي محتويات ملفك بالحرف "0": perl -i -pe 's//0/g' /path/to/your/file - يخبر العلم -i Perl بمعالجة الملف الذي قدمته في الأمر. - تخبر العلامة -pe البرنامج بإنشاء حلقة تكرارية لمحتويات ملفك. - 's / / 0 / g' هو أمر استبدال. يطابق عامل التشغيل كل بايت داخل الملف ، وسيحل الرقم 0 محل كل بايت.
بمجرد الانتهاء ، يمكنك إزالة الملف المعدل باستخدام rm: rm /path/to/your/file إيجابيات - لا تحتاج إلى تعلم بناء جملة جديد إذا كنت تعرف لغة Perl - يستخدم التجريدات المألوفة مثل استبدال sed سلبيات - سوف يقوم الأمر بتمرير واحد فقط على الملف - قد يكون استبدال المحتويات ببيانات عشوائية غير آمن
7. طريقة واجهة المستخدم الرسومية: استخدام Bleachbit
إذا كان لديك نفور من سطر الأوامر ، فإن Bleachbit هو أحد أفضل الحلول لمحو بياناتك بشكل آمن. (تشتهر Bleachbit بقدرتها على تنظيف نظام Linux الخاص بك.) بشكل افتراضي ، تتخصص الأداة في اكتشاف "الملفات الزائدة عن الحاجة" والتخلص منها والتي تستمر في شغل مساحة بعد وقت طويل من احتياجك إليها. ولكنه يتضمن أيضًا القدرة المنسية عادةً على "تمزيق" أي ملف يدويًا بعد الاسترداد.
قم بتثبيته على التوزيع المتوافق مع Ubuntu من خلال مركز البرامج الخاص به أو باستخدام: sudo apt install bleachbit انقر فوق "القائمة -> التفضيلات" وقم بتمكين الخيار "الكتابة فوق محتويات الملفات لمنع الاسترداد" لتحسين الأمان.
ارجع إلى واجهته الرئيسية ، وانقر على "القائمة -> Shred Files" ، ومن الطلب المنبثق ، اختر الملفات التي ترغب في إرسالها إلى العدم. انقر على "حذف" وطمأن Bleachbit أنك متأكد مما تحاول القيام به.
يجب أن تضع في اعتبارك دائمًا أن استخدام أنظمة ملفات المجلات وحقيقة أننا لا نعرف كيف "تدير" البرامج الثابتة لكل محرك أقراص ثابتة محتوياته يعني أن الحل الأفضل هو محو محرك الأقراص الثابتة الكامل - أو حتى أفضل ، تدمير ماديًا لـ جهاز. إيجابيات - سهل الاستخدام - يمكنك تعيينه ليكون آمنًا بشكل افتراضي سلبيات - لا يمكن عمل مناديل القرص - لن تمسح المساحة الخالية
8. مسح المساحة الحرة ب dd
في حين أن الحذف الآمن سيجعل استرداد الملف أكثر صعوبة ، فلا يزال من الممكن إعادة بنائه باستخدام البيانات الوصفية الموجودة على القرص الخاص بك. أصلح هذه المشكلة عن طريق مسح كل المساحة الخالية المتوفرة في جهازك. أسهل طريقة للقيام بذلك في Linux هي استخدام dd لإنشاء ملف يملأ محرك الأقراص الثابتة بأكمله: dd status=progress if=/dev/zero of=/home/$USER/wipefree
بمجرد الانتهاء من ذلك ، عليك إخبار نظامك بالتزام ملف "المساحة الخالية" بالقرص: sync أخيرًا ، قم بإزالة ملف "المساحة الخالية" باستخدام rm: rm /home/$USER/wipefree
إيجابيات - أمر بسيط لا يزيل الملفات - مسح جميع البيانات الوصفية المتبقية سلبيات - يستغرق وقتا طويلا للانتهاء - لا يحذف الملفات مباشرة
أسئلة شائعة
س1: هل من الممكن حذف الملفات البعيدة بأمان في Linux؟ الجواب. في حين أنه من الممكن حذف الملفات البعيدة بشكل آمن ، فلا يوجد ضمان بأن نظام Linux البعيد لن يقوم بنسخ الملفات احتياطيًا داخل أقراصه. من الأفضل افتراض أن كل نظام وأقراص بعيدة ليست آمنة. س2: هل اختفت ملفاتي تمامًا بعد أن أحذفها بأمان في Linux؟ الجواب. لا يزال من الممكن أن يظل نظامك محتفظًا ببعض البيانات الوصفية من ملفك القديم. على سبيل المثال ، يمكن أن يحتوي قسم المبادلة على معلومات حول الحذف الآمن في نظامك. خفف من حدة ذلك عن طريق إعادة التشغيل وإنشاء ملفات جديدة على القرص الخاص بك. س3: هل من الأفضل أن يكون لديك المزيد من التصاريح عند حذف الملفات؟الجواب. ليس بالضرورة. في معظم الحالات ، يجب أن تمنع خمس تصاريح أي أداة لاستعادة البيانات من إعادة إنشاء ملفك. من الممكن استرداد ملف يتجاوز خمسة تصاريح ، ولكنها تتطلب أدوات وبرامج متخصصة للغاية للعمل. Read the full article
0 notes
Text
This tutorial will guide you through steps to install Zsh on Linux and Configure it to suit your needs. Definition of shell from Wikipedia: A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as a text for a command line interpreter to execute or by creating text scripts of one or more such commands. Most fresh installation of Linux comes pre-loaded with a Bash shell. Personally, I like zsh, and it’s my favorite shell that I use all the time. Why Zsh? Zsh does a bunch of other useful things that bash alone won’t accomplish. Apart from being a powerful scripting language, Zsh is a shell designed for interactive use. It incorporates into it many useful features of Bash, ksh, and tcsh. Other additional features provided by zsh are: Auto Completions are case insensitive much faster than bash. All sorts of bells and whistles made possible by a community-driven framework like oh-my-zsh. Support multi-line editing Recursive file globbing Highly compatible with ksh. Zsh has a huge collection of better themes. Simple configuration style Output redirection to multiple destinations And many more, do some googling to learn more. Here you’ll Install Zsh on Linux. Install Zsh Shell on Linux Distributions Install zsh on Arch based systems: sudo pacman -S zsh How to install Zsh on Gentoo emerge --ask zsh Install Zsh on Debian based systems such as Ubuntu: sudo apt update sudo apt install zsh Install Zsh on Fedora / CentOS / Rocky / RHEL: # Fedora / RHEL 8 based sudo dnf install zsh # CentOS 7 / RHEL 7 sudo yum install zsh Check and Change shell to Zsh Confirm it’s installed and see a list of installed shells. After you successfully install Zsh on Linux, you should see version displayed. $ zsh --version zsh 5.8 (x86_64-ubuntu-linux-gnu) After you’ve installed it, we need to make it our default shell and customize it to get extra eye-candy. You can change the shell for both root and standard user accounts. Non-root account, sudo usermod $USER -s /usr/bin/zsh # OR sudo chsh -s /usr/bin/zsh $USER The command above will change shell for current logged in user. You can also specify username: sudo usermod username -s /usr/bin/zsh # OR sudo chsh -s /usr/bin/zsh username Logout after the change to start using new shell: logout Confirm if current shell is set to Zsh $ echo $SHELL /usr/bin/zsh If the default Zsh configuration file was not created, manually create empty one: touch ~/.zshrc Install Oh My Zsh (framework for managing your zsh configuration) The easiest way to customize zsh is to install Oh My Zsh to set zsh theme. Oh My Zsh is an open source, a community-driven framework for managing your zsh configuration. It comes with a load of plugins and themes to take advantage of. Install it as below. Prerequisites: wget curl git Make sure you have all above prerequisites installed on your system. sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" New look after install Oh My Zsh framework. Once installed, you’ll get a bundle of themes that comes with it, located at ~/.oh-my-zsh/themes/ $ ls -l ~/.oh-my-zsh/themes/ ....omitted output ... -rw-r--r-- 1 ubuntu ubuntu 661 Mar 14 20:46 suvash.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 788 Mar 14 20:46 takashiyoshida.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 356 Mar 14 20:46 terminalparty.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 579 Mar 14 20:46 theunraveler.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 516 Mar 14 20:46 tjkirch.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 514 Mar 14 20:46 tjkirch_mod.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 1214 Mar 14 20:46 tonotdo.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 3642 Mar 14 20:46 trapd00r.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 4379 Mar 14 20:46 wedisagree.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 443 Mar 14 20:46 wezm+.zsh-theme
-rw-r--r-- 1 ubuntu ubuntu 366 Mar 14 20:46 wezm.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 333 Mar 14 20:46 wuffers.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 574 Mar 14 20:46 xiong-chiamiov-plus.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 554 Mar 14 20:46 xiong-chiamiov.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 2426 Mar 14 20:46 ys.zsh-theme -rw-r--r-- 1 ubuntu ubuntu 727 Mar 14 20:46 zhann.zsh-theme You can also take a look in the plugins directory to see all plugins available. $ ls -lh ~/.oh-my-zsh/plugins ....omitted output ... drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 vscode drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 vundle drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 wakeonlan drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 wd drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 web-search drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 wp-cli drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 xcode drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 yarn drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 yii drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 yii2 drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 yum drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 z drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 zbell drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 zeus drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 zoxide drwxr-xr-x 2 ubuntu ubuntu 4.0K Mar 14 20:46 zsh-interactive-cd drwxr-xr-x 4 ubuntu ubuntu 4.0K Mar 14 20:46 zsh-navigation-tools Install Oh My Zsh themes for Zsh You can install custom themes to ~/.oh-my-zsh/themes/ and configure ~/.zshrc to use it. Best Terminal Shell Prompts for Zsh, Bash and Fish Modify theme variable name to ZSH_THEME in ~/.zshrc. See example below: $ vim ~/.zshrc ZSH_THEME="spaceship" Save changes and exit. Type CTRL+X, Then Y. Source ~/.zshrc file source ~/.zshrc Configure Help command. vim ~/.zshrc Add the following lines to the end. autoload -U run-help autoload run-help-git autoload run-help-svn autoload run-help-svk alias help=run-help Source it and you’re good to go. source ~/.zshrc Fish-like syntax highlighting (Optional) Clone code to plugins folder: cd ~/.oh-my-zsh/plugins git clone https://github.com/zsh-users/zsh-syntax-highlighting.git vim ~/.zshrc Add below the line at the end, source ~/.oh-my-zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh Then source zshrc file source ~/.zshrc Persistent rehash: This allows compinit to automatically find new executables in the $PATH. vim ~/.zshrc Add line: zstyle ':completion:*' rehash true Save and exit, the source it. source ~/.zshrc zsh-completions Configure additional zsh-completions, applicable to all Linux systems. I will assume you already installed oh-my-zsh, if not refer to it above. git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions Then enable it in your .zshrc vim ~/.zshrc Add the lines below: plugins+=(zsh-completions) autoload -U compinit && compinit zsh tab-completion system To enable the famous zsh tab-completion system, you need to add above commands ( autoload -U compinit && compinit). If you are running Arch Linux, you can install it using Pacman package manager. This has an advantage of getting updates for it automatically. pacman -S zsh-completions Installing zsh-completions on Gentoo emerge --ask zsh-completions Install zsh-completions on Fedora / CentOS / RHEL / Scientific Linux: cd /etc/yum.repos.d/ wget https://download.opensuse.org/repositories/shells:zsh-users:zsh-completions/RHEL_7/shells:zsh-users:zsh-completions.repo yum install zsh-completions Also, check Configure Zsh syntax highlighting on Linux / macOS Conclusion We’ve covered how to Install Zsh on Linux and configuring Zsh environment on your system. Zsh is the most customizable shell I have ever used. It’s easy to install and customize with more than 100 themes. There are plenty of plugins to extend its functionality with frameworks like oh-my-zsh.
0 notes
Text
Textmate command line

#Textmate command line how to#
#Textmate command line series#
❯ cd /bin ❯ ls [ df ln sh bash echo ls sleep cat ed mkdir stty chmod expr mv sync cp hostname pax tcsh csh kill ps test dash ksh pwd unlink date launchctl rm wait4path dd link rmdir zsh ❯ pwd /bin ❯ cd /System ❯ ls Applications DriverKit Volumes Developer Library iOSSupport ❯ pwd /System touch and mkdir - Make files and directories Let us jump a bit around and look at some directories on a macOS system (will be similar on Linux). If you have forgotten where you are, you can use the pwd command. You can change to a working directory with the cd command. It is the directory your commands will apply changes to. Just like with a graphical terminal, there is a current working directory. To try out the ls command, we will use the cd and pwd commands. As soon as you see the words foo, bar, qux or baz you should know that they are placeholders. What is up with the foo and bar names? Those a just silly names we tend to use in programming and Unix circles. So a? would match files named ab, ab, ad, ae and so on, while *.txt would match files named foo.txt, bar.txt, baz,txt and so on. The * matches any number of letters while ? matches a single letter. You can use glob patterns to filter what files are show. Characters such as * and ? get interpreted in a special way. The ls command is smarter than your file manager. We call a file containing a program you can run for binary. That is where Unix keeps binaries for the most common commands. This shows the contents of the bin directory on a Unix system. ❯ ls /bin [ expr pwd bash hostname rm cat kill rmdir chmod ksh sh cp launchctl sleep csh link stty dash ln sync date ls tcsh dd mkdir test df mv unlink echo pax wait4path ed ps zsh ❯ With the ls command, you can see what files and directories are in a directory, just like you can with a file manager. Let us look at the most basic commands ls, cd, pwd, man, cat, touch and file. It adds several cool features, but you don't have to use it. Mine is a ❯ because I am using the Starship prompt. The prompt at the start of the line is usually one of the symbols $, # or ❯. You will have a cursor next to a prompt, indicating that the CLI is waiting for you to type a command and press enter.
#Textmate command line how to#
Mine looks like this: Last login: Thu Jun 23 22:10:30 on ttys001 Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish ~ ❯ It will differ depending on the system and configuration you have. When you start the Unix command line, you will get some kind of greeting. What are environment variables, and what can you use them for?.It is used by the terminal to locate the command you write. Look at what files are in a directory and filter out files or directories you are not interested in.Navigate around the file system just as you would do with a graphical file manager.In this article, I will teach you how to do the following things: Searching images of a graphical UI is much harder. These notes can later easily be retrieved using search tools. Complex operations which you easily forget how to do, so you can easily copy to a notebook and write an explanation. Text-based interfaces in contrast are straightforward to explain in articles such as this one.
#Textmate command line series#
Finding the right buttons to click or dialogs to open may require a video or series of images with careful step-by-step instructions. Large and complex graphical applications can be hard to learn. It is true that it is easier to understand a graphical user interface, but only up to a point. The second point requires some justification. Text-based interfaces naturally lend themselves to automation, which can be a big time saver.Complex graphical interfaces are harder to learn than complex text-based interfaces.They often prove a lot more power and flexibility.But text-based interfaces have numerous advantages which are hard to replicate in graphical user interfaces: Why should you learn how to use a Unix command line interface? Isn’t it much easier to just click around in a file manager? Indeed, graphical user interfaces tend to be easier to explore and learn. Finder file manager showing Godot directory

0 notes
Text
Webstorm vs pycharm

#Webstorm vs pycharm how to#
To apply the formatting to other file types, or to limit formatting to files located only in specific directories, you can customize the default configuration by using glob patterns.įor more information, see WebStorm online help. tsx files that you’ve edited in your project. allows IntelliJ IDEA, P圜harm, WebStorm, or JetBrains Rider to launch as many instances of the configuration to run in parallel as needed The two. For this, open Preferences / Settings | Languages & Frameworks | JavaScript | Prettier and tick the corresponding checkbox: On save and/or On ‘Reformat Code’ action.īy default, WebStorm will apply formatting to all. You can also configure WebStorm to run Prettier on save ( Cmd+S/Ctrl+S) or use it as the default formatter ( Opt+Cmd+L/Ctrl+Alt+L). You can use the Reformat with Prettier action ( Opt+Shift+Cmd+P on macOS or Alt+Shift+Ctrl+P on Windows and Linux) to format the selected code, a file, or a whole directory. Once it’s done, you can do a few things in your IDE.
#Webstorm vs pycharm how to#
You can find instructions on how to do it here. But you must remember that you can run only that files/tests/scripts. If you’re using other JetBrains IDE like IntelliJ IDEA, PhpStorm, or P圜harm, make sure you have this plugin installed and enabled in Preferences / Settings | Plugins.įirst, you need to install and configure Prettier. Or maybe you have a test you want to run, you can do that without opening your tests file. WebStorm comes with built-in support for Prettier. JetBrains IDEs (WebStorm, IntelliJ IDEA, P圜harm, etc.)

1 note
·
View note
Text
Ronen Roytman
Ronen Roytman is a Israeli Binary File Data Expert . Learn how to read data from binary files using Azure Databricks. What is the easiest way (using a graphical tool or command line on Ubuntu Linux) to know if two binary files are the same or not (except for the time stamps)? I do not need to actually extract the difference. I just need to know whether they are the same or not.
To read whole binary files, you need to specify the data source format as binaryFile. To load files with paths matching a given glob pattern while keeping the behavior of partition discovery, you can use the general data source option pathGlobFilter.
1 note
·
View note
Text
Visual Studio Laravel
Visual Studio Laravel
Search results for 'laravel', Visual Studio Code on marketplace.visualstudio.com. Out of the blue, Microsoft jumps into the editor wars with an incredible offering that gives Sublime Text an overwhelming run for its money. In fact, it just might surpass it! So come along, as I demonstrate the ins, the outs, the tips, the techniques. Say hello to your new best friend: Visual Studio Code. Laravel Intellisense is a Visual Studio Code plugin by Mohamed Benhida that provides some nice auto-completion for things like Eloquent models, factories, config, and API resources. The extension works only on Laravel projects and a project is considered a Laravel project only if there is an artisan file in the root directory. Gaurav Makhecha; Credits. PHP Parser by Glayzzle. Currently, you're free to use this extension. I would highly appreciate you buying the world a.

Visual Studio Laravel
Travel through your Laravel app by just clicking on links.
Features
Open Latest Log File
Open latest log file from anywhere. Select the Command Laravel Traveller: Open Latest Log File or press Ctrl+o Ctrl+l (Cmd+o Cmd+l for Mac). You can change the default keyboard shortcut as well.
Technical Notes
The following glob pattern is used to search log files: 'storage/logs/laravel*.log'
Route -> Controller
Link to controller + action from the routes files:
Link to controller + action as per route group namespace:
You can add a simple comment // Route::namespace = NAMESPACE to apply group namespace on file. For example, the routes/api.php in the Laravel app has Api namespace applied by default.
Technical Notes
The controller links are added only in the files that are inside /routes directory or sub-directories and end with .php
php-parser by glayzzle is being used to get the AST of the file and add links based on that.
We consider only the static calls to Route::(get/post/put/patch/delete) and add links to the second parameter of those calls.
We suggest you to write route groups like: Route::namespace('Admin')->group(function() (..)) (as per Laravel documentation) instead of Route::group(('namespace' => 'Admin'), function() (..)) (namespace not supported by extension this way).
Automatic Controller Creation
If the controller does not exist, you'll be asked whether the extension should create it for you automatically. Action method will also be added to the controller. If you want to customize the stub that is used to create the controller, Add stubs/controller.plain.stub to your project's root directory. Please check the Stub Customization section of the Laravel documentation for instructions.
Technical Notes
For automatic controller creation, the default namespace is set to AppHttpControllers.
Automatic Method Creation
If the method does not exist, you'll be asked whether the extension should create it for you automatically. If you want to customize the stub that is used to create the method, Add stubs/method.stub to your project's root directory. (( methodName )) placeholder will be replaced with the actual method name.
Technical Notes
php-parser by glayzzle is being used to get the AST of the controller file and add the method to the end of the file. Basic expectations are that there will be a namespace at the top, a class, and at least 1 method in the controller file.
Controller -> View
Link to blade views from the controllers:
Technical Notes
The view links are added only in the files that are inside /app/Http/Controllers directory or sub-directories and end with .php
It uses this regex to find lines with view helper: ^s*return view((')(https://github.com/freshbitsweb/laravel-traveller/blob/master/.*?)(').*).*$
Currently, it links to the blade files in resources/views directory.
Mailable -> View
Link to blade views from the Mail classes:
Technical Notes
The view or markdown links are added only in the files that are inside /app/Mail directory or sub-directories and end with .php
It uses this regex to find lines with view or markdown method call: ^.*->(?:view|markdown)((')(https://github.com/freshbitsweb/laravel-traveller/blob/master/.*?)(').*).*$
Currently, it links to the blade files in resources/views directory.
View -> View
Link to blade views from the blade view:
Technical Notes
The view or markdown links are added only in the files that are inside /resources/views directory or sub-directories and end with .blade.php
It uses this regex to find lines with view or markdown method call: ^.*@(?:extends|include)((')(https://github.com/freshbitsweb/laravel-traveller/blob/master/.*?)(').*).*$
Currently, it links to the blade files in resources/views directory.
Route -> View
Link to blade views from the Route files:
Technical Notes
The view links are added only in the files that are inside /routes directory or sub-directories and end with .php
php-parser by glayzzle is being used to get the AST of the file and add links based on that.
Currently, it links to the blade files in resources/views directory.
Model -> Model
Link to models from the related model files:
Technical Notes
The model links are added only in the files that are inside /app directory and end with .php. and links to models in app directory only.
It uses this regex to find lines with relationship calls: ^s*return $this->(?:hasOne|belongsTo|hasMany|belongsToMany|morphOne|morphMany)((')(https://github.com/freshbitsweb/laravel-traveller/blob/master/.*?)(').*$
Route -> Route
Link to other routes from route files:
Technical Notes
The route links are added only in the files that are inside /routes directory and end with .php.
The definitions needs to be in this format: Route::group((), base_path('(ROUTE_FILE_PATH)'));
Configuration
5 of the features: Route -> Controller, Controller -> View, Mailable -> View, View -> View, and Model -> Model are toggelable: You can disable them from VSCode settings if you do not need them.
Technical Notes
The extension works only on Laravel projects and a project is considered a Laravel project only if there is an artisan file in the root directory.
Authors
Credits
Treeware
Currently, you're free to use this extension. I would highly appreciate you buying the world a tree in return.
Evernote is chinese app store. It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to our forest you’ll be creating employment for local families and restoring wildlife habitats.
WPS Office for Mac. WPS PDF to Word 40.3MB. WPS Office For Linux. WPS Data Recovery Master 5.5MB. WPS Office For Android. WPS Office For iOS. WPS PDF For Android. PDF Editor For Android. PDF Converter Pro For Android. WPS Fill & Sign. Wps english download. Download WPS A new generation of office solutions With PDF, Cloud, OCR, file repair, and other powerful tools, WPS Office is quickly becoming more and more people’s first choice in office software.
You can buy trees at for our forest here offset.earth/treeware
To use Astropad Studio you will need to make a user account. Creating a user account is easy, by entering your email and making a password. Your user license for Astropad Studio will be tied to this account. To enter Studio, log in to your user account through your iPad. Luna Display turns any Mac or iPad into a wireless second display for Mac. Makers of Astropad Studio and Luna Display. Turn your iPad into a drawing tablet with Astropad Studio. Extend your Mac display to any iPad or Mac with Luna Display. Astropad. Enjoy a 30-day free trial! Pick a payment plan to get started.
Notes on silencing. Read more about Treeware at treeware.earth
Special Thanks to
Laravel Community
VS Code Community
0 notes
Text
#linux#linuxfan#linuxuser#systemadministrator#ubuntu#debian#dev#devops#webdevelopment#webdeveloper#programmer#programming#programmingmemes#linuxmemes#memes#cat#coding#developer#tech#ethicalhacking#computerscience#coder#security#infosec#cyber
1 note
·
View note
Text
A poderosa nuvem: Intel® DevCloud com GPU Iris Xe Max
Neste artigo veremos como utilizar o poder computacional das últimas gerações de hardware Intel na nuvem DevCloud gratuitamente mas por tempo limitado. Além de processadores de última geração, poderemos testar a nova e primeira GPU da Intel Dedicada Iris Xe MAX.
Introdução Devcloud:
DevCloud é uma nuvem de computação distribuída baseado projeto PBS desenvolvido pela NASA 1991, a principal função era gerenciar trabalhos em lote muito similar ao agendador de tarefas e gerenciamento de nós e recursos. Esta nuvem da Intel proporciona diversas arquiteturas de hardware de última geração, como CPUs, FPGA GPU.
Sendo assim é possível utilizar a tecnologia Iris Xe Max. Este modelo é a primeira GPU dedicada da Intel. O seu desempenho diferenciado é devido ao suporte PCI Express 4.0 e total integração com a tecnologia Intel Deep Link. Onde sua principal função é praticamente combinar recursos da CPU e da GPU para otimizar o desempenho total do equipamento. Mas Ressalto que esta tecnologia Iris Xe Max trabalha em conjunto com o processador Intel Core de 11ª geração.

Antes de começarmos, devemos efetuar o cadastro na Nuvem da Intel. O cadastro é gratuito, porém limitado. Para estender o limite, seu projeto de desenvolvimento deve ser submetido para aumentar o período de testes. Sendo assim, clique no link https://software.intel.com/content/www/us/en/develop/tools/devcloud.html , selecione a opção Intel® DevCloud for oneAPI e efetue o seu cadastro preenchendo os dados solicitados.
Mais informações sobre a configuração e acesso no Linux via ssh, podemos obter nesta URL: https://devcloud.intel.com/oneapi/documentation/connect-with-ssh-linux-macos/
Conceitos
A nuvem da Intel trabalha com processamento distribuído, e então para entendermos o funcionamento, primeiramente criaremos o script com o nome hello-world-example com o conteúdo abaixo:
$ tee>hello-world-example <<EOF cd $PBS_O_WORKDIR echo “* Hello world from compute server `hostname`!” echo “* The current directory is ${PWD}.” echo “* Compute server’s CPU model and number of logical CPUs:” lscpu | grep ‘Model name\\|^CPU(s)’ echo “* Python available to us:” which python python –version echo “* The job can create files, and they will be visible back in the Notebook.” > newfile.txt sleep 10 echo “*Bye” EOF
Agora como script criado, o submeteremos o trabalho no qual devemos utilizar o comando qsub. O parâmetro -l é utilizado para utilizar o hardware solicitado onde nodes = QTDE DE NÓS, gpu = PROCESSADOR GRÁFICO e ppn = a quantidade de processadores. Já o parâmetro -d . indica o path de trabalho (localização atual) e por último o nome do scritpt. Vejam o exemplo a seguir:
$ qsub -l nodes=1:gpu:ppn=2 -d . hello-world-example 911788.v-qsvr-1.aidevcloud
Se tudo funcionou corretamente, após alguns segundos, veremos armazenados em disco 2 arquivos de saída que representam o resultado do processamento, hello-world-example.eXXXXXX e hello-world-example.oXXXXXX. Um arquivo .eXXXXXX contém os erros do script (se existir), já o .e911788 contem a saída padrão do script submetido posteriormente. Abaixo o exemplo do seu conteúdo:
* Hello world from compute server s001-n140! * The current directory is /home/u45169. * Compute server’s CPU model and number of logical CPUs: CPU(s): 12 Model name: Intel(R) Xeon(R) E-2176G CPU @ 3.70GHz * Python available to us: /opt/intel/inteloneapi/intelpython/latest/bin/python Python 3.7.9 :: Intel Corporation *Bye
A seguir um resumo da sintaxe anterior, e também a adição de alguns itens para um melhor aproveitamento dos arquivos para processamento distribuído utilizando o formato PBS (Portable Batch System). Tomaremos como base o script anterior.
$ tee>hello-world-example-2 <<EOF #!/bin/bash #Nome do trabalho: #PBS -N My-Job-InDevCloud #Tempo de execução 1 hora: #PBS -l walltime=1:00:00 #Nome do arquivo de erro: #PBS -e My-Job-with-Error.err #Solicita 1 nó e 2 processadores: #PBS -l nodes=1:ppn=2 #Envio de Email #PBS -M [email protected] cd $PBS_O_WORKDIR echo “* Hello world from compute server hostname!” echo “* The current directory is ${PWD}.” echo “* Compute server’s CPU model and number of logical CPUs:” lscpu | grep ‘Model name\|^CPU(s)’ echo “* Python available to us:” which python python –version echo “* The job can create files, and they will be visible back in the Notebook.” > newfile.txt sleep 10 echo “*Bye” EOF
Após estas alterações podemos submeter novamento o JOB para execução novamente:
$ qsub -l nodes=1:gpu:ppn=2 -d . hello-world-example-2
Mas também podemos executar todos os parâmetros na diretiva da linha de comando.
$ qsub -l nodes=1:gpu:ppn=2 -l walltime=1:00:00 -M [email protected] -d . hello-world-example-2
Com o comando abaixo podemos verificar todos os computer nodes disponíveis na Nuvem da Intel:
$ pbsnodes -a s012-n001 state = job-exclusive power_state = Running np = 2 properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu ntype = cluster jobs = 0-1/911898.v-qsvr-1.aidevcloud status = rectime=1624947718,macaddr=d4:5d:64:08:e0:1b,cpuclock=Fixed,varattr=,jobs=911898.v-qsvr-1.aidevcloud(cput=114,energy_used=0,mem=382320kb,vmem=34364495240kb,walltime=626,Error_Path=/dev/pts/0,Output_ Path=/dev/pts/0,session_id=2291524),state=free,netload=881915012074,gres=,loadave=2.00,ncpus=24,physmem=32558924kb,availmem=33789804kb,totmem=34656072kb,idletime=1003560,nusers=4,nsessions=4,sessions=525427 11938 32 1193846 2291524,uname=Linux s012-n001 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64,opsys=linux mom_service_port = 15002 mom_manager_port = 15003
Para verificar quantos nós apresentam a GPU Iris XE MAX, basta incluir o seguinte comando:
$ pbsnodes | sort | grep properties |grep iris_xe_max properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,dual_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu
Para verificar as características dos nós presentes no sistema, basta utilizar o seguinte comando abaixo:
$ pbsnodes | sort | grep properties properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = core,cfl,i9-10920x,ram32gb,net1gbe,gpu,iris_xe_max,quad_gpu properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,cfl,e-2176g,ram64gb,net1gbe,gpu,gen9 properties = xeon,skl,ram384gb,net1gbe,renderkit properties = xeon,skl,ram384gb,net1gbe,renderkit properties = xeon,skl,ram384gb,net1gbe,renderkit properties = xeon,skl,ram384gb,net1gbe,renderkit
As propriedades são usadas para descrever vários recursos disponíveis nos nós de computação, como: tipo e nome da CPU, modelo e nome do acelerador, DRAM disponível, tipo de interconexão, número de dispositivos aceleradores disponíveis e seu tipo e uso pretendido ou recomendado.
Algumas das propriedades para das classes de dispositivos:
core
fpga
gpu
xeon
Propriedades dos dispositivos por nome:
arria10
e-2176g
gen9
gold6128
i9-10920x
iris_xe_max
plat8153
Quantidade do dispositivo:
dual_gpu
quad_gpu
Uso desejado:
batch
fpga_compile
fpga_runtime
jupyter
renderkit
Mão na massa com a GPU Iris Xe Max
Agora conecte na DevCloud via ssh utilizando o comando abaixo com sua conta devidamente configurada. Se tudo estiver corretamente funcionando teremos a tela abaixo:
$ ssh devcloud ############################################################################### # # Welcome to the Intel DevCloud for oneAPI Projects! # # 1) See https://ift.tt/2LUWKHK for instructions and rules for # the OneAPI Instance. # # 2) See https://ift.tt/3dsMD83 for instructions and rules for # the FPGA Instance. # # Note: Your invitation email sent to you contains the authentication URL. # # If you have any questions regarding the cloud usage, post them at # https://ift.tt/3dqCokx # # Intel DevCloud Team # ############################################################################### # # Note: Cryptocurrency mining on the Intel DevCloud is forbidden. # Mining will lead to immediate termination of your account. # ############################################################################### Last login: Mon Jun 28 22:51:06 2021 from 10.9.0.249 u99999@login-2:~$
Agora criaremos o arquivo ola_Iris_XE_Max.sh com o seguinte conteudo abaixo.
$ tee > ola_Iris_XE_Max.sh <<EOF > Echo #!/bin/bash > wget https://ift.tt/35XzAHA > tar -zxvf cmake-gpu.tar.gz > mkdir -p cmake-gpu/build > cd cmake-gpu/build > cmake .. > make run > EOF
Este script efetuara o download do código fonte exemplo em C, que utiliza um loop for, e conta até 15 uttilizando a GPU, descompacta o arquivo .tar.gz, cria a pasta build efetua a compilação e executa.
Para testar o funcionamento execute o seguinte comando para submeter o script para processamento:
$ qsub -l nodes=1:iris_xe_max:ppn=2 -d . ola_Iris_XE_Max.sh 911915.v-qsvr-1.aidevcloud Após alguns segundos digite ls e verifique o conteudo do arquivo de saida com o comando cat. Veremos o seguinte resultado:
$ cat ola_Iris_XE_Max.sh.o911915
######################################################################## # Date: Mon 28 Jun 2021 11:45:08 PM PDT # Job ID: 911915.v-qsvr-1.aidevcloud # User: u68892 # Resources: neednodes=1:iris_xe_max:ppn=2,nodes=1:iris_xe_max:ppn=2,walltime=06:00:00 ######################################################################## cmake-gpu/CMakeLists.txt cmake-gpu/License.txt cmake-gpu/README.md cmake-gpu/sample.json cmake-gpu/src/ cmake-gpu/src/CMakeLists.txt cmake-gpu/src/main.cpp cmake-gpu/third-party-programs.txt — The C compiler identification is GNU 9.3.0 — The CXX compiler identification is Clang 12.0.0 — Check for working C compiler: /usr/bin/cc — Check for working C compiler: /usr/bin/cc — works — Detecting C compiler ABI info — Detecting C compiler ABI info – done — Detecting C compile features — Detecting C compile features – done — Check for working CXX compiler: /glob/development-tools/versions/oneapi/2021.2/inteloneapi/compiler/2021.2.0/linux/bin/dpcpp — Check for working CXX compiler: /glob/development-tools/versions/oneapi/2021.2/inteloneapi/compiler/2021.2.0/linux/bin/dpcpp — works — Detecting CXX compiler ABI info — Detecting CXX compiler ABI info – done — Detecting CXX compile features — Detecting CXX compile features – done — Configuring done — Generating done — Build files have been written to: /home/u47345/cmake-gpu/build Scanning dependencies of target cmake-gpu [ 50%] Building CXX object src/CMakeFiles/cmake-gpu.dir/main.cpp.o [100%] Linking CXX executable ../cmake-gpu [100%] Built target cmake-gpu Scanning dependencies of target build [100%] Built target build Scanning dependencies of target run 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [100%] Built target run ######################################################################## # End of output for job 911915.v-qsvr-1.aidevcloud # Date: Mon 28 Jun 2021 11:45:25 PM PDT ########################################################################
Mais informações no link oficial: Intel® DevCloud https://software.intel.com/content/www/us/en/develop/tools/devcloud.html ou em contato diretamente comigo em [email protected]. “O próximo grande salto evolutivo da humanidade será a descoberta de que cooperar é melhor que competir… Pois colaborar atrai amigos, competir atrai inimigos!”
O post A poderosa nuvem: Intel® DevCloud com GPU Iris Xe Max apareceu primeiro em SempreUpdate.
source https://sempreupdate.com.br/a-poderosa-nuvem-intel-devcloud-com-gpu-iris-xe-max/
0 notes
Text
8 طرق بسيطة لحذف الملفات بأمان في Linux

لقد رأينا كيفية مسح محتويات القرص الثابت بالكامل ، ولكن ماذا يحدث إذا كان كل ما تريده هو حذف ملف أو اثنين أو اثني عشر ملفًا نهائيًا؟ يوضح لك هذا الدليل بعضًا من أكثر الحلول شيوعًا للحذف الكامل للملفات في Linux.

ملاحظة: تدعم معظم محركات الأقراص ذات الحالة الصلبة الموجودة في السوق اليوم TRIM لإدارة المساحة الخالية ، وهي ميزة في البرامج الثابتة الخاصة بهم تعيد تخصيص محتوياتها. بالاقتران مع أنظمة ملفات المجلات في Linux ، مثل Ext3 / 4 و Reiser FS ، لا يمكن ضمان الحذف بعد استعادة الملفات الفردية. الحل الوحيد في هذه الحالات هو ، للأسف ، سلاح نووي كامل لجميع المحتويات في SSD.
1. تجاوز سلة المهملات
عند حذف ملف ، يتم نقله إلى سلة المهملات (ويعرف أيضًا باسم سلة المحذوفات). إذا كنت ترغب في ذلك ، يمكنك تجاوز مجلد المهملات. بهذه الطريقة ، لن تبقى ملفاتك المحذوفة في سلة المهملات وسيتم وضع علامة عليها تم حذفها بالكامل. على الرغم من أنه لا يزال قابلاً للاسترداد ، إلا أنه يعد خطوة للأمام للوصول إليها (في المهملات). نصيحة: إذا كنت لا تزال تفضل إرسال ملفاتك إلى المهملات ، فلا يزال بإمكانك جعل النظام يفرغ سلة المهملات تلقائيًا بشكل منتظم. نافذة Dolphin تعرض محتويات الدليل الرئيسي. لحذف الملفات في توزيعة Linux مثل Kubuntu مع KDE ، قم بتشغيل مدير الملفات الافتراضي ، Dolphin. انقر فوق "قائمة -> تكوين -> تكوين Dolphin -> سلة المهملات" للوصول إلى التفضيلات ذات الصلة. لا يوجد خيار لتعطيل المهملات تمامًا ، ولكن يمكنك استخدام خدعة أنيقة تغطي معظم القواعد: تمكين حد الحجم وتقليله إلى أصغر قيمة. نافذة تعرض إعدادات حصة مهملات Dolphin. على القرص الخاص بنا ، تُرجم هذا إلى 10.97 ميجابايت. ستمحو Dolphin محتويات سلة المهملات عندما تتجاوز هذه القيمة ، ومن المحتمل أن يحدث ذلك كل ساعة أخرى باستخدام سطح المكتب المعتاد. لدى مديري الملفات الآخرين مثل Nautilus أو Nemo خيارات لتجاوز سلة المهملات تمامًا. نافذة nemo تعرض إعدادات سلة المهملات الإضافية للنظام. الايجابيات سهل الفعل يمنحك فترة سماح قبل حذف الملفات نهائيًا السلبيات لا يزيل أي بيانات وصفية باقية في القرص لا تنظف البيانات من الملفات
2. باستخدام أجاد
إذا كنت تستخدم نوعًا مختلفًا من Ubuntu ، فمن المحتمل أن تكون shred جزءًا منه. يمكنك البدء في استخدامه على الفور لحذف أي ملفات حساسة في Linux تريد إرسالها إلى النسيان تمامًا. إذا أردت حذف "image.png" نهائيًا ، فاستخدم: - أجاد -uvz -n 4 image.png - يخبرك أجاد لإزالة الملف قبل الكتابة فوقه. - v يعرض معلومات مطولة. - z يملأ المساحة التي تشغلها البيانات بالأصفار لتقليل أي فرصة للتعافي. -n 4 يترجم إلى خمسة تمريرات حذف: تقوم عملية التمرير بتمرير واحد افتراضيًا ، وباستخدام "-n" ، يمكنك تحديد عدد التمريرات الإضافية التي تحتاجها لمزيد من الأمان. الإجماع العام هو أن خمس تمريرات يجب أن تكون أكثر من كافية لمعظم الناس. نافذة طرفية تظهر أمر تم��يق 5 تمريرات. لإزالة ملفات متعددة أو محتويات مجلد ، استخدم أحرف البدل مثل: shred -uvz -n 1 صور / images_0؟ .jpg shred -uvz -n 4 صور / *.* في الحالة الأولى، "؟" سيكون حرف بدل لحرف واحد ، وسيؤدي التقطيع إلى حذف الملفات المسماة "images_01.jpg" و "images_02.jpg" ، على سبيل المثال. في الحالة الثانية ، سوف تمحو عملية التقطيع جميع الملفات في دليل "الصور" ، بغض النظر عن اسمها أو نوعها. الايجابيات سيتم حذف ملف واحد تمامًا يمكن إجراء مطابقة glob لتغطية ملفات متعددة السلبيات بعض علامات الخيارات غامضة سوف يستغرق وقتا طويلا للانتهاء نصيحة: تعرف على كيفية عمل أحرف البدل من خلال تجربة التعبيرات العادية على جهازك.
3. استخدام dd في الملفات الفردية
يعد برنامج تعريف البيانات (dd) أداة مساعدة أخرى موجودة في كل توزيعات Linux تقريبًا اليوم. ومع ذلك ، على عكس shred ، فإن إحدى أكبر مزايا dd هي أنه يسمح لك بضبط كيفية حذف ملفاتك في Linux. لاستخدام dd ، تحتاج إلى معرفة الحجم الدقيق لملفك بالبايت: ls -l / path / إلى / your / file | awk "{print $ 5}" نافذة طرفية تعرض حجم بايت الملف. يمكنك تشغيل dd على ملفك الحالي. على سبيل المثال ، سيملأ هذا الأمر ملفك بأحرف فارغة: حالة dd = تقدم bs = your_file_size count = 1 if = / dev / zero of = / path / to / your / file نافذة طرفية تظهر dd أثناء العمل. بصرف النظر عن ملء ملفك بأحرف فارغة ، يمكنك أيضًا إجبار dd على مسح ملفك ببيانات شبه عشوائية: حالة dd = تقدم bs = your_file_size count = 1 if = / dev / urandom of = / path / to / your / file نافذة طرفية تظهر dd تغذي بيانات عشوائية. يمكنك الآن حذف ملفك باستخدام الأمر العادي rm: rm / المسار / إلى / ملفك / الايجابيات متعدد الاستخدامات - يمكنه فعل أكثر من مجرد حذف الملفات يمكن ضبط حذف الملف سلبيات بناء الجملة قديم ، حتى بالنسبة لبرنامج سطر الأوامر يتطلب فهماً جيداً لأحجام الكتل من المفيد أن تعرف: إذا ندمت على حذف ملف معين ، فتعرف على كيفية استرداد الملفات المحذوفة في Linux.
4. باستخدام المسح
المسح هو بديل ممتاز آخر. ابحث عنه في مركز البرامج للتوزيع الخاص بك وقم بتثبيته من هناك أو استخدم: sudo apt install wipe نافذة طرفية تعرض معلومات حول المسح. استخدامه بسيط مثل تقطيع ، إن لم يكن أكثر من ذلك. لحذف الملفات في Linux باستخدام المسح ، قم بتشغيل: مسح الصور / deleteme.png قد يصبح هذا أمرًا مزعجًا ، حيث يستخدم المسح ، افتراضيًا ، الكثير من التمريرات التي تستغرق وقتًا طويلاً لتوفير مزيد من الأمان. بالإضافة إلى ذلك ، سيطلب تأكيدًا للحذف. نافذة طرفية تعرض جلسة مسح أساسية. استخدم العلم f للتخلص من التأكيد و r للرجوع إلى الدلائل الفرعية. يخبر c بالمسح إلى chmod إذا لزم الأمر (عندما لا يحتوي الملف أو الدليل على أذونات كتابة معينة) ، ويسمح لك q بتقليل عدد التمريرات لحذف أسرع. عند استخدام q ، لاحظ أنها صغيرة. يمكن أن يتبعها حرف "Q" كبير يحدد عدد التمريرات التي تطلبها. على سبيل المثال ، الأمر البسيط سابقًا ، مع تطبيق هذه التعديلات ، سيتغير إلى: wipe -rfcq -Q 5 Pictures / deleteme.png الايجابيات سهل الاستخدام ، حتى مع خبرة قليلة في سطر الأوامر المعلمات الافتراضية المعقولة والآمنة سلبيات قد تكون المعلمات الافتراضية صارمة للغاية بالنسبة لمعظم المستخدمين قد لا تعمل بشكل جيد مع المجلات النشطة
5. استخدام الحذف الآمن
SRM هي إحدى الأدوات الموجودة في مجموعة Secure Delete التي تتخصص في الإزالة الآمنة للبيانات من محرك الأقراص الثابتة. يعتبره الكثيرون أفضل أداة لهذه الوظيفة. لتثبيت مجموعة Secure Delete كاملة على Ubuntu والتوزيعات المتوافقة ، استخدم: sudo apt تثبيت الحذف الآمن نافذة طرفية توضح تثبيت الحذف الآمن. بعد ذلك ، يمكنك حذف أي ملف باستخدام: srm Pictures / deleteme.png نافذة طرفية توضح عملية الحذف الآمن. قد ترغب في استخدام علامة z التي تستبدل محتويات ملفك بالأصفار لمزيد من الأمان و v للحصول على معلومات مطولة حول العملية. في حالة التعامل مع الدلائل والأدلة الفرعية ، قم أيضًا بتضمين العلامة r للوضع العودي. إذا كانت عمليات إعادة الكتابة 38 كبيرة جدًا بالنسبة لك ، فيمكنك تقليل الوقت المطلوب - بالإضافة إلى الأمان - من خلال استخدام علامة l لتقليل عدد التمريرات إلى اثنتين "فقط". سيؤدي هذا إلى تحويل الأمر السابق إلى: srm -rlvz Pictures / deleteme.png الايجابيات الخيارات سهلة الفهم وبديهية يعد حذف ملف آمنًا وشاملًا للغاية سلبيات سوف يستغرق وقتا طويلا للانتهاء لا يعمل بشكل جيد مع الأنظمة التي تستخدم RAID
6. حذف الملفات في لينكس مع Perl
بصرف النظر عن استخدام الأدوات ، يمكنك أيضًا الاستفادة من لغات البرمجة البسيطة ، مثل Perl ، لحذف الملفات في Linux. على سبيل المثال ، سيستبدل سطر التعليمات البرمجية التالي محتويات ملفك بالحرف "0": perl -i -pe 's / / 0 / g' / path / to / your / file يخبر العلم -i Perl بمعالجة الملف الذي قدمته في الأمر. تخبر العلامة -pe البرنامج بإنشاء حلقة تكرارية لمحتويات ملفك. 's / / 0 / g' هو أمر استبدال. يطابق عامل التشغيل كل بايت داخل الملف ، وسيحل الرقم 0 محل كل بايت. نافذة طرفية تظهر Perl وهو يمسح ملف. بمجرد الانتهاء ، يمكنك إزالة الملف المعدل باستخدام rm: rm / المسار / إلى / ملفك / الايجابيات لا تحتاج إلى تعلم بناء جملة جديد إذا كنت تعرف لغة Perl يستخدم التجريدات المألوفة مثل استبدال sed سلبيات سوف يقوم الأمر بتمرير واحد فقط على الملف قد يكون استبدال المحتويات ببيانات عشوائية غير آمن من المفيد أن تعرف: يمكنك فهم المزيد عن الاستبدالات وتدفق الملفات باستخدام sed لمهام النظام الأساسية.
7. طريقة واجهة المستخدم الرسومية: استخدام Bleachbit
إذا كان لديك نفور من سطر الأوامر ، فإن Bleachbit هو أحد أفضل الحلول لمحو بياناتك بشكل آمن. (تشتهر Bleachbit بقدرتها على تنظيف نظام Linux الخاص بك.) بشكل افتراضي ، تتخصص الأداة في اكتشاف "الملفات الزائدة عن الحاجة" والتخلص منها والتي تستمر في شغل مساحة بعد وقت طويل من احتياجك إليها. ولكنه يتضمن أيضًا القدرة المنسية عادةً على "تمزيق" أي ملف يدويًا بعد الاسترداد. نافذة اكتشاف لبرنامج Bleachbit. قم بتثبيته على التوزيع المتوافق مع Ubuntu من خلال مركز البرامج الخاص به أو باستخدام: sudo apt تثبيت bleachbit انقر فوق "القائمة -> التفضيلات" وقم بتمكين الخيار "الكتابة فوق محتويات الملفات لمنع الاسترداد" لتحسين الأمان. تظهر نافذة Bleachbit الحذف الآمن. ارجع إلى واجهته الرئيسية ، وانقر على "القائمة -> Shred Files" ، ومن الطلب المنبثق ، اختر الملفات التي ترغب في إرسالها إلى العدم. انقر على "حذف" وطمأن Bleachbit أنك متأكد مما تحاول القيام به. نافذة Bleachbit تؤكد الحذف. يجب أن تضع في اعتبارك دائمًا أن استخدام أنظمة ملفات المجلات وحقيقة أننا لا نعرف كيف "تدير" البرامج الثابتة لكل محرك أقراص ثابتة محتوياته يعني أن الحل الأفضل هو محو محرك الأقراص الثابتة الكامل - أو حتى أفضل ، تدمير ماديًا لـ جهاز. الايجابيات سهل الاستخدام يمكنك ضبطه ليكون آمنًا بشكل افتراضي سلبيات لا يمكن عمل مناديل القرص لن تمسح المساحة الخالية
8. مسح المساحة الحرة ب dd
في حين أن الحذف الآمن سيجعل استرداد الملف أكثر صعوبة ، فلا يزال من الممكن إعادة بنائه باستخدام البيانات الوصفية الموجودة على القرص الخاص بك. أصلح هذه المشكلة عن طريق مسح كل المساحة الخالية المتوفرة في جهازك. أسهل طريقة للقيام بذلك في Linux هي استخدام dd لإنشاء ملف يملأ محرك الأقراص الثابتة بأكمله: حالة dd = تقدم إذا = / dev / صفر من = / home / $ USER / wipefree نافذة طرفية تظهر الأمر dd wipe free space. بمجرد الانتهاء من ذلك ، عليك إخبار نظامك بالتزام ملف "المساحة الخالية" بالقرص: تزامن أخيرًا ، قم بإزالة ملف "المساحة الخالية" باستخدام rm: rm / home / $ USER / wipefree حذف آمن لملفات Linux 18 - حذف مسح الملفات المجانية الايجابيات أمر بسيط لا يزيل الملفات مسح جميع البيانات الوصفية المتبقية سلبيات يستغرق وقتا طويلا للانتهاء لا يحذف الملفات مباشرة نصيحة: لتجنب رؤية رسالة "مساحة التخزين غير كافية" ، تحقق بانتظام من مساحة القرص وقم بإدارتها.
أسئلة مكررة
هل من الممكن حذف الملفات البعيدة بأمان في Linux؟ في حين أنه من الممكن حذف الملفات البعيدة بشكل آمن ، فلا يوجد ضمان بأن نظام Linux البعيد لن يقوم بنسخ الملفات احتياطيًا داخل أقراصه. من الأفضل افتراض أن كل نظام وأقراص بعيدة ليست آمنة. هل اختفت ملفاتي تمامًا بعد أن أحذفها بأمان في Linux؟ لا يزال من الممكن أن يظل نظامك محتفظًا ببعض البيانات الوصفية من ملفك القديم. على سبيل المثال ، يمكن أن يحتوي قسم المبادلة على معلومات حول الحذف الآمن في نظامك. خفف من حدة ذلك عن طريق إعادة التشغيل وإنشاء ملفات جديدة على القرص الخاص بك. هل المزيد من الممرات أفضل عند حذف الملفات؟ ليس بالضرورة. في معظم الحالات ، يجب أن تمنع خمس تمريرات أي أداة لاستعادة البيانات من إعادة إنشاء ملفك. من الممكن استرداد ملف يتجاوز خمسة تمريرات ، ولكنها تتطلب أدوات وبرامج متخصصة للغاية للعمل. Read the full article
0 notes
Text
CLI tool to tag files : linux
CLI tool to tag files : linux
Hi! I’ve written a simple tool that allows one to tag files (under the hood uses xattrs) using glob patterns. Later one can search for files containing specified tags. It’s pretty bare-bones for now, just the core functionality without many useful flags. I also left a disclaimer in the repo because extended attributes are known to be problematic to preserve when doing any sort of file transfers…

View On WordPress
0 notes
Text
Setting up Azure DevOps CI/CD for a .NET Core 3.1 Web App hosted in Azure App Service for Linux
Following up on my post last week on moving from App Service on Windows to App Service on Linux, I wanted to make sure I had a clean CI/CD (Continuous Integration/Continuous Deployment) pipeline for all my sites. I'm using Azure DevOps because it's basically free. You get 1800 build minutes a month FREE and I'm not even close to using it with three occasionally-updated sites building on it.
Last Post: I updated one of my websites from ASP.NET Core 2.2 to the latest LTS (Long Term Support) version of ASP.NET Core 3.1 this week. I want to do the same with my podcast site AND move it to Linux at the same time. Azure App Service for Linux has some very good pricing and allowed me to move over to a Premium v2 plan from Standard which gives me double the memory at 35% off.
Setting up on Azure DevOps is easy and just like signing up for Azure you'll use your Microsoft ID. Mine is my gmail/gsuite, in fact. You can also login with GitHub creds. It's also nice if your project makes NuGet packages as there's an integrated NuGet Server that others can consume libraries from downstream before (if) you publish them publicly.
I set up one of my sites with Azure DevOps a while back in about an hour using their visual drag and drop Pipeline system which looked like this:
There's some controversy as some folks REALLY like the "classic" pipeline while others like the YAML (Yet Another Markup Language, IMHO) style. YAML doesn't have all the features of the original pipeline yet, but it's close. It's primary advantage is that the pipeline definition exists as a single .YAML file and can be checked-in with your source code. That way someone (you, whomever) could import your GitHub or DevOps Git repository and it includes everything it needs to build and optionally deploy the app.
The Azure DevOps team is one of the most organized and transparent teams with a published roadmap that's super detailed and they announce their sprint numbers in the app itself as it's updated which is pretty cool.
When YAML includes a nice visual interface on top of it, it'll be time for everyone to jump but regardless I wanted to make my sites more self-contained. I may try using GitHub Actions at some point and comparing them as well.
Migrating from Classic Pipelines to YAML Pipelines
If you have one, you can go to an existing pipeline in DevOps and click View YAML and get some YAML that will get you most of the way there but often includes some missing context or variables. The resulting YAML in my opinion isn't going to be as clean as what you can do from scratch, but it's worth looking at.
In decided to disable/pause my original pipeline and make a new one in parallel. Then I opened them side by side and recreated it. This let me learn more and the result ended up cleaner than I'd expected.
The YAML editor has a half-assed (sorry) visual designer on the right that basically has Tasks that will write a little chunk of YAML for you, but:
Once it's placed you're on your own
You can't edit it or modify it visually. It's text now.
If your cursor has the insert point in the wrong place it'll mess up your YAML
It's not smart
But it does provide a catalog of options and it does jumpstart things. Here's my YAML to build and publish a zip file (artifact) of my podcast site. Note that my podcast site is three projects, the site, a utility library, and some tests. I found these docs useful for building ASP.NET Core apps.
You'll see it triggers builds on the main branch. "Main" is the name of my primary GitHub branch. Yours likely differs.
It uses Ubuntu to do the build and it builds in Release mode. II
I install the .NET 3.1.x SDK for building my app, and I build it, then run the tests based on a globbing *tests pattern.
I do a self-contained publish using -r linux-x64 because I know my target App Service is Linux (it's cheaper) and it goes to the ArtifactStagingDirectory and I name it "hanselminutes." At this point it's a zip file in a folder in the sky.
Here it is:
trigger: - main pool: vmImage: 'ubuntu-latest' variables: buildConfiguration: 'Release' steps: - task: UseDotNet@2 displayName: ".NET Core 3.1.x" inputs: version: '3.1.x' packageType: sdk - task: UseDotNet@2 inputs: version: '3.1.x' - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - task: DotNetCoreCLI@2 displayName: "Test" inputs: command: test projects: '**/*tests/*.csproj' arguments: '--configuration $(buildConfiguration)' - task: DotNetCoreCLI@2 displayName: "Publish" inputs: command: 'publish' publishWebProjects: true arguments: '-r linux-x64 --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: true - task: PublishBuildArtifacts@1 displayName: "Upload Artifacts" inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: 'hanselminutes'
Next I move to the release pipeline. Now, you can also do the actual Azure Publish to a Web App/App Service from a YAML Build Pipeline. I suppose that's fine if your site/project is simple. I wanted to have dev/test/staging so I have a separate Release Pipeline.
The Release Pipelines system in Azure DevOps can pull an "Artifact" from anywhere - GitHub, DevOps itself natch, Jenkins, Docker Hub, whatever. I set mine up with a Continuous Deployment Trigger that makes a new release every time a build is available. I could also do Releases manually, with specific tags, scheduled, or gated if I'd liked.
Mine is super easy since it's just a website. It's got a single task in the Release Pipeline that does an Azure App Service Deploy. I can also deploy to a slot like Staging, then check it out, and then swap to Production later.
There's nice integration between Azure DevOps and the Azure Portal so I can see within Azure in the Deployment Center of my App Service that my deployments are working:
I've found this all to be a good use of my staycation and even though I'm just a one-person company I've been able to get a very nice automated build system set up at very low cost (GitHub free account for a private repo, 1800 free Azure DevOps minutes, and an App Service for Linux plan) A basic starts at $13 with 1.75Gb of RAM but I'm planning on moving all my sites over to a single big P1v2 with 3.5G of RAM and an SSD for around $80 a month. That should get all of my ~20 sites under one roof for a price/perf I can handle.
Sponsor: Like C#? We do too! That’s why we've developed a fast, smart, cross-platform .NET IDE which gives you even more coding power. Clever code analysis, rich code completion, instant search and navigation, an advanced debugger... With JetBrains Rider, everything you need is at your fingertips. Code C# at the speed of thought on Linux, Mac, or Windows. Try JetBrains Rider today!
© 2019 Scott Hanselman. All rights reserved.
Setting up Azure DevOps CI/CD for a .NET Core 3.1 Web App hosted in Azure App Service for Linux published first on http://7elementswd.tumblr.com/
0 notes
Text
Setting up Azure DevOps CI/CD for a .NET Core 3.1 Web App hosted in Azure App Service for Linux
Following up on my post last week on moving from App Service on Windows to App Service on Linux, I wanted to make sure I had a clean CI/CD (Continuous Integration/Continuous Deployment) pipeline for all my sites. I'm using Azure DevOps because it's basically free. You get 1800 build minutes a month FREE and I'm not even close to using it with three occasionally-updated sites building on it.
Last Post: I updated one of my websites from ASP.NET Core 2.2 to the latest LTS (Long Term Support) version of ASP.NET Core 3.1 this week. I want to do the same with my podcast site AND move it to Linux at the same time. Azure App Service for Linux has some very good pricing and allowed me to move over to a Premium v2 plan from Standard which gives me double the memory at 35% off.
Setting up on Azure DevOps is easy and just like signing up for Azure you'll use your Microsoft ID. Mine is my gmail/gsuite, in fact. You can also login with GitHub creds. It's also nice if your project makes NuGet packages as there's an integrated NuGet Server that others can consume libraries from downstream before (if) you publish them publicly.
I set up one of my sites with Azure DevOps a while back in about an hour using their visual drag and drop Pipeline system which looked like this:
There's some controversy as some folks REALLY like the "classic" pipeline while others like the YAML (Yet Another Markup Language, IMHO) style. YAML doesn't have all the features of the original pipeline yet, but it's close. It's primary advantage is that the pipeline definition exists as a single .YAML file and can be checked-in with your source code. That way someone (you, whomever) could import your GitHub or DevOps Git repository and it includes everything it needs to build and optionally deploy the app.
The Azure DevOps team is one of the most organized and transparent teams with a published roadmap that's super detailed and they announce their sprint numbers in the app itself as it's updated which is pretty cool.
When YAML includes a nice visual interface on top of it, it'll be time for everyone to jump but regardless I wanted to make my sites more self-contained. I may try using GitHub Actions at some point and comparing them as well.
Migrating from Classic Pipelines to YAML Pipelines
If you have one, you can go to an existing pipeline in DevOps and click View YAML and get some YAML that will get you most of the way there but often includes some missing context or variables. The resulting YAML in my opinion isn't going to be as clean as what you can do from scratch, but it's worth looking at.
In decided to disable/pause my original pipeline and make a new one in parallel. Then I opened them side by side and recreated it. This let me learn more and the result ended up cleaner than I'd expected.
The YAML editor has a half-assed (sorry) visual designer on the right that basically has Tasks that will write a little chunk of YAML for you, but:
Once it's placed you're on your own
You can't edit it or modify it visually. It's text now.
If your cursor has the insert point in the wrong place it'll mess up your YAML
It's not smart
But it does provide a catalog of options and it does jumpstart things. Here's my YAML to build and publish a zip file (artifact) of my podcast site. Note that my podcast site is three projects, the site, a utility library, and some tests. I found these docs useful for building ASP.NET Core apps.
You'll see it triggers builds on the main branch. "Main" is the name of my primary GitHub branch. Yours likely differs.
It uses Ubuntu to do the build and it builds in Release mode. II
I install the .NET 3.1.x SDK for building my app, and I build it, then run the tests based on a globbing *tests pattern.
I do a self-contained publish using -r linux-x64 because I know my target App Service is Linux (it's cheaper) and it goes to the ArtifactStagingDirectory and I name it "hanselminutes." At this point it's a zip file in a folder in the sky.
Here it is:
trigger: - main pool: vmImage: 'ubuntu-latest' variables: buildConfiguration: 'Release' steps: - task: UseDotNet@2 displayName: ".NET Core 3.1.x" inputs: version: '3.1.x' packageType: sdk - task: UseDotNet@2 inputs: version: '3.1.x' - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - task: DotNetCoreCLI@2 displayName: "Test" inputs: command: test projects: '**/*tests/*.csproj' arguments: '--configuration $(buildConfiguration)' - task: DotNetCoreCLI@2 displayName: "Publish" inputs: command: 'publish' publishWebProjects: true arguments: '-r linux-x64 --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: true - task: PublishBuildArtifacts@1 displayName: "Upload Artifacts" inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: 'hanselminutes'
Next I move to the release pipeline. Now, you can also do the actual Azure Publish to a Web App/App Service from a YAML Build Pipeline. I suppose that's fine if your site/project is simple. I wanted to have dev/test/staging so I have a separate Release Pipeline.
The Release Pipelines system in Azure DevOps can pull an "Artifact" from anywhere - GitHub, DevOps itself natch, Jenkins, Docker Hub, whatever. I set mine up with a Continuous Deployment Trigger that makes a new release every time a build is available. I could also do Releases manually, with specific tags, scheduled, or gated if I'd liked.
Mine is super easy since it's just a website. It's got a single task in the Release Pipeline that does an Azure App Service Deploy. I can also deploy to a slot like Staging, then check it out, and then swap to Production later.
There's nice integration between Azure DevOps and the Azure Portal so I can see within Azure in the Deployment Center of my App Service that my deployments are working:
I've found this all to be a good use of my staycation and even though I'm just a one-person company I've been able to get a very nice automated build system set up at very low cost (GitHub free account for a private repo, 1800 free Azure DevOps minutes, and an App Service for Linux plan) A basic starts at $13 with 1.75Gb of RAM but I'm planning on moving all my sites over to a single big P1v2 with 3.5G of RAM and an SSD for around $80 a month. That should get all of my ~20 sites under one roof for a price/perf I can handle.
Sponsor: Like C#? We do too! That’s why we've developed a fast, smart, cross-platform .NET IDE which gives you even more coding power. Clever code analysis, rich code completion, instant search and navigation, an advanced debugger... With JetBrains Rider, everything you need is at your fingertips. Code C# at the speed of thought on Linux, Mac, or Windows. Try JetBrains Rider today!
© 2019 Scott Hanselman. All rights reserved.
Setting up Azure DevOps CI/CD for a .NET Core 3.1 Web App hosted in Azure App Service for Linux published first on https://deskbysnafu.tumblr.com/
0 notes