Показаны сообщения с ярлыком linux. Показать все сообщения
Показаны сообщения с ярлыком linux. Показать все сообщения

понедельник, 6 июня 2011 г.

BackupYourSystemTAR

tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev / 
Restore:
tar -xvpzf /home/test/backup.tar.gz -C /
mkdir /proc /lost+found /sys /mnt /media

суббота, 1 января 2011 г.

Nice tip

After accidentally rebooting the wrong server a couple times, forgetting what I had ssh’ed to, I decided on a handy fix, this /usr/local/bin/confirm script:
#!/bin/sh
echo "You are about to run the command '$*' on `hostname`." >&2
echo -n "Are you sure this is what you want to do? (Y/N): [N] " >&2
read x || exit
case "$x" in
[Yy]*)  exec "$@" ;;
*)      echo "Command '$*' aborted." >&2  ; exit 1 ;;
esac
Now, on my servers I add these aliases to root’s .bashrc file:
alias halt=’confirm halt’; alias reboot=’confirm reboot’
That’s saved me a few times since then. The .bashrc file also already had the “alias rm=’rm -i’” in there, which at first I hated, but learned to like it after it too saved my skin on more than one occasion.
@via http://www.cyberciti.biz/tips/my-10-unix-command-line-mistakes.html

суббота, 20 ноября 2010 г.

воскресенье, 17 октября 2010 г.

Minimum Profit

A text editor for programmers
  • Fully scriptable using a C-like scripting language.
  • Unlimited undo levels.
  • Complete Unicode support.
  • Multiple files can be edited at the same time and blocks copied and pasted among them.
  • Syntax highlighting for many popular languages / file formats: C, C++, Perl, Shell Scripts, Ruby, Php, Python, HTML...
  • Creative use of tags: tags created by the external utility ctags are used to move instantaneously to functions or variables inside your current source tree. Tags are visually highlighted (underlined), and symbol completion can be triggered to avoid typing your own function names over and over.
  • Intelligent help system: pressing F1 over any word of a text being edited triggers the underlying system help (calling man when editing C or Shell files, perldoc with Perl, ri on Ruby, winhelp on MS Windows...).
  • Understandable interface: drop-down menus, reasonable default key bindings.
  • Configurable keys, menus and colors.
  • Text templates can be easily defined / accessed.
  • Multiplatform: Console/curses, KDE4, GTK+, MS Windows.
  • Automatic indentation, word wrapping, internal grep, learning / repeating functions.
  • Spellchecking support (via the ispell package).
  • Multilingual.
  • Password-protected, encrypted text files (using the ARCFOUR algorithm).
  • It helps you abandon vi, emacs and other six-legged freaks definitely.
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/mp-5 5
sudo update-alternatives --config editor
select-editor