Posts

Showing posts with the label Linux

30 маловідомих, але корисних команд Linux (repost)

Image
  30 маловідомих, але корисних команд Linux Саме тому ми зібрали  31 команд , які не згадуються в кожному гайді, зате дійсно виручають. Особливо, коли часу обмаль, а результат потрібен вже. lsd - те саме що ls але краще lsd -l --permission octal --> тільки для нових версій lsd > 1.1.0 Базові трюки з терміналом Тут зібрали ті маленькі команди, які часто рятують нерви. Повторити, очистити, знайти чи навіть написати. Повтор останньої команди Забув додати  sudo  та отримали «Permission denied»? Не переписуй всю команду заново — просто використай: sudo !! Очищення екрана Коли термінал заповнений виводом і хочеться почати з чистого аркуша, натисни  Ctrl+L , щоб миттєво очистити екран. Редагування поточної команди в редакторі Якщо команда занадто довга або складна, натисни  Ctrl+x  +  e , щоб відкрити її в текстовому редакторі для зручного редагування. Коротка довідка по команді Замість читання довгих man-сторінок, юзай  tldr   для отрим...

Linux tips and tricks for web-dev

Image
Linux tips and tricks for web-dev's show file/folders rights in drxr & 777 formats :     stat -c '%A %a %n' /<your_folder>/ monitor changing file :   tail -f -n 10 var/log/dev.log download big file with cURL :   curl --location 'https://<your_url>' \ --header 'Authorization: Token <token>' -o file.name curl response with the following redirects : curl -iL --max-redirs 1 http://example.com monitor folder recursively for changes : inotifywait -m -e create,delete -r /<your_folder>       6. removing all files in the folder except some needed                        in zsh :         setopt extended_glob         rm -rv -- ^(.git|.idea)(D) -r:   Recursively delete directories and their contents. -v : Display what is being deleted. -- :  Denotes the end of options to prevent issues with filenames...

Files & folders monitoring in linux

Image
Files & Folders - monitoring in Linux 1.  fswatch  install: sudo apt install fswatch use: fswatch -d /home/ 2.  inotify-tools  <verdict> --> it's better install: sudo apt-get install inotify-tools use:  inotifywait /path/to/directory --recursive --monitor

Шпаргалка по значениям umask в UNIX/Linux и пару полезных ссылок

Image
Шпаргалка по значениям umask в UNIX/Linux и пару полезных ссылок Все возможные режимы umask Создание файлов с определённым режимом  (eng.) Что такое umask и как установить права на файл или директорию

Перенаправление вывода в linux(unix) - Output redirection in linux(unix)

Image
  echo test > afile . txt ..redirects stdout to afile.txt . This is the same as doing.. echo test 1> afile . txt To redirect stderr, you do.. echo test 2 > afile . txt >& is the syntax to redirect a stream to another file descriptor - 0 is stdin. 1 is stdout. 2 is stderr. You can redirect stdout to stderr by doing.. echo test 1 >& 2 # or echo test >&2 ..or vice versa: echo test 2 >& 1 So, in short:  2> redirects stderr to an (unspecified) file, appending &1 redirects stderr to stdout In the shell, what does “ 2>&1 ” mean?   Crontab, want to mail just errors to myself AND log output in separate file Some additional INFO: Основы системного администрирования Linux: работа с консолью Техническая библиотека IBM - Linux 101 Перенаправление вывода (википедия) Перенаправление ввода/вывода, каналы и фильтры в BASH Что значит >/dev/null 2>&1 Advanced Bash-Scripting Guide and little add...

Check your site for broken links as Crawler or Spider (useful for Linux)

Image
Check your site for broken links as Crawler or Spider (useful for Linux) http://www.pc-freak.net/blog/checking-your-website-for-broken-links-on-linux-with-linkchecker-and-htcheck-how-to-find-broken-links-on-your-website/ http://htcheck.sourceforge.net Pros: The "Spider" or "Crawler" - HTTP/1.1 compliant with persistent connections and cookies support - HTTP Basic authentication supported - HTTP Proxy support (basic authentication included) - Crawl customisable through many configuration attributes which let the user limit the digging on URLs pattern matchings and distance ("hops") from the first URL. - MySQL databases directly created by the spider - MySQL connections through user or general option files as defined by the database system (/etc/my.cnf or ~/.my.cnf) Cons:  for htcheck but not for linkcheckr : No support for Javascript and other protocols like HTTPS, FTP, NNTP and local files.

Полезное под linux/unix

Image
Полезное под linux/unix (черновик) http://www.commandlinefu.com/commands/browse/sort-by-votes/25 - рейтинг консольных команд Unix/Linux (тут можно найти довольно интересные и полезные команды) Как узнать какой у Вас дистрибутив(link)  a также могут помочь следующие команды(пакеты): screenfetch - базовая инфо, по вашей linux (перед запуском нужно её установить sudo apt-get install screenfetch (для ubuntu, debian), для других дистрибутивов вот ссылка есть ещё одна команда neofetch - это расширенный screenfetch, устанавливается также как и screenfetch ( ссылка ) wslfetch - это  screenfetch  для windws linux subsystem WSL (расширенная инфо - ссылка ) nnn - консольный файловый менеджер (очень удобная вещь при очень скромных потреблениях системных ресурсов :-) ... круче чем mc ))) P.S.: уровень кастомизации запредельный (тонны плагинов) запуск с ключем -е позволяет сразу открывать текстовые файлы во встроенном редакторе  vi ( ссылка на описание как сразу ...

Подсказка по командам Linux + раскрашивание (Solorized)

Раскрашиваем директории : Robert Mark Bram - ls --color scheme Chris Wilson - Re: No color when using ls buluschek development » Setting ls to reasonable colors in cygwin colors - Colored files in Windows terminal via Cygwin? - Stack Overflow Solarized: A Must Have Color Scheme For Gnome Terminal, Vim, Gedit And Lots More ~ Web Upd8: Ubuntu / Linux blog Красим BASH Красим всё  остальное Команды устанавливаемые отдельно для раскрашивания лог файлов: 1. ccze  ( apt-get install  ccze    Just do  tail -f /var/log/apache2/error.log | ccze 2.  grc  ( apt-get install grc    Just do  grc tail -f /var/log/apache2/error.log 3. colorize ( apt-get install colorize   ) additional configuration needed, after install 4. multittail  ( Just do  multitail /var/log/apache/access.log ) 5.  TxtStyle  ( Just do  tail -f example.log | txts -n example ) под иксами (в системе x-window) нажатие ctrl+t - вызовет окн...