I faced a problem with locales in terminal on Mac OS X Lion. Midnight Commander didn’t want to display Cyrillic symbols in filenames and directories, on my remote media-Server I’ve been getting messages like “warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)”. The solution is fairly simple – add these two lines to ~/.bash_profile (by default is seems to be missing, so create the file):
ids:~ id$ cat .bash_profile
Everyone of you know the default GNOME Terminal or the KDE-Konsole, this terminals are usable only after some tweaks like color scheme or the hotkey binding.
I work usually with a lot different Continue reading ‘Terminator’
This will be a little bigger thread (and I hope it will grow with time) about working with hard disk drives. All about filesystem creation, filesystem health checks and other stuff for HDD.
Continue reading ‘Working with HDD’
The simplest way to remove files older than $NUMBER of days..
Dry run (files will be NOT deleted, you will see a list with files older than 100 days)
find -mtime +100 | less
Another dry run, see what would be delete:
find -mtime +600 | xargs echo rm
Finally if you decided to remove the files – the final command to delete them:
find -mtime +600 | xargs rm
Maybe you know this problem, if more than one user has root access to a server you have very little chances to control who was it. The only hook could be date and time. Default if you issue the “history” command you see a command number and the operation.
Put the next line in your .bashrc and you will see date and time in your history:
# Bash Timestamps
export HISTTIMEFORMAT="%F %T "
Finely to make it work execute:
Your new history format:
536 2011-05-31 22:06:44 less /var/log/syslog
537 2011-05-31 22:06:46 ll
538 2011-05-31 22:06:54 vim rssh.pl
539 2011-05-31 22:07:07 perl rssh.pl
540 2011-05-31 22:07:16 ss -lnp