Posts

Showing posts with the label Linux

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 starting with hyphens. ^(pattern) : Exclude files and directories that match the given pattern. (.git|.idea) : List of patterns to exclude (in th

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 addon: [command

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 You are done!) 2.  grc  ( apt-get install grc    Just do  grc tail -f /var/log/apache2/error.log You are done!) 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 - вызовет окно терминала alias ls = "ls -lah --color=auto&q

Установка всех обоев (wallpapers) из Ubuntu на Вашей новой Убунту :-)

sudo apt-get install ubuntu-wallpapers-karmic ubuntu-wallpapers-lucid ubuntu-wallpapers-maverick ubuntu-wallpapers-natty ubuntu-wallpapers-oneiric ubuntu-wallpapers-precise

Графическое средство для анализа использования дисков в Ubuntu - "Baobab"

Image
Анализатор использования диска (Disk Usage Analyzer) Программа подсчитывает занимаемое место в как в домашнем каталоге так и на всём жестом диске и показывает эту информацию как в визуально удобном виде так и в виде сухих цифр. Случайно наткнулся на эту замечательную программу, когда обновлял проги и получил варнинг(warning) о нехватке места на диске. Может кому-то будет полезна эта инфа.