LINUX

TwitterFacebook
Get flash to fully experience Pearltrees
When you have a java appli­ca­tion server which gen­er­ates a great deal of logs, it can be tricky to find the most impor­tant infor­ma­tion, espe­cially if you have detailed log­ging. For­tu­nately grep is capa­ble of doing this very well. The fol­low­ing com­mand will gather all WARN , ERROR , FATAL , and Excep­tion stack traces . This com­mand can be very use­ful for Java log mon­i­tor­ing scripts.

Copying Yesterday’s Exceptions with Stack Traces from Logs, Then Emailing To Administrators

http://chriscase.cc/2010/05/copying-exceptions-with-stack-traces-from-logs-after-a-specified-date-then-emailing/
If you’ve ever tried send­ing email via the com­mand line, using the mail util­ity, you may find that the method can be unre­li­able in some cases. The email mes­sages are often inter­cepted by spam bots, fil­tered by secu­rity pro­grams, etc. A more ele­gant and sta­ble alter­na­tive, is to use your exist­ing email server to send the mes­sage.

Sending Mail in Shell Scripts via an External Server with Nail

http://chriscase.cc/2010/06/sending-mail-in-shell-scripts-via-an-external-server-with-nail/
Locate the most appro­pri­ate pack­age for your dis­tri­b­u­tion of Linux at the down­load site . Once you have located the RPM you will need do the fol­low­ing steps, sub­sti­tut­ing your cho­sen pack­age for the RPM . [ root @ Internal ~ ] # wget http://packages.sw.be/rssh/rssh-2.3.2-1.1.el3.rf.x86_64.rpm --2010-10-11 20 : 36 : 21 -- http: // packages.sw.be / rssh / rssh-2.3.2- 1.1 .el3.rf.x86_64.rpm Resolving packages.sw.be... 85.13.226.40 Connecting to packages.sw.be | 85.13.226.40 | : 80 ... connected. HTTP request sent, awaiting response... 302 Found Location: http: // rpmforge.sw.be / redhat / el3 / en / x86_64 / rpmforge / RPMS / rssh-2.3.2- 1.1 .el3.rf.x86_64.rpm [ following ] --2010-10-11 20 : 36 : 21 -- http: // rpmforge.sw.be / redhat / el3 / en / x86_64 / rpmforge / RPMS / rssh-2.3.2- 1.1 .el3.rf.x86_64.rpm Resolving rpmforge.sw.be... 85.13.226.40 Reusing existing connection to packages.sw.be: 80 . http://chriscase.cc/2010/10/restrict-a-linux-users-access-only-allowing-scpsftp-no-ssh/

Restrict a Linux User’s Access: Only Allowing SCP/SFTP, no SSH

How To Execute a Script After a Running Process Completes

Most peo­ple who are famil­iar with Linux, real­ize that there are ways of chain­ing processes to run one after another. Typ­i­cally this is done by writ­ing a script, or using & & to daisy chain addi­tional com­mands on com­mand line. There is, how­ever, another way to do this; if you’ve already issued a com­mand and want to add another com­mand after the orig­i­nal has already started. This is espe­cially use­ful if you’re unzip­ping, say a 15 giga­byte data­base dump, and you want to make sure that the import hap­pens imme­di­ately after the import is complete. Here’s an exam­ple of what would hap­pen if I were enter­ing the com­mands manually. http://chriscase.cc/2011/02/how-to-execute-a-script-after-a-running-process-completes/
What's so great about rsync? First, it's designed to speed up file transfer by copying the differences between two files rather than copying an entire file every time. For example, when I'm writing this article, I can make a copy via rsync now and then another copy later. The second (and third, fourth, fifth, etc.) time I copy the file, rsync copies the differences only . That takes far less time, which is especially important when you're doing something like copying a whole directory offsite for daily backup. https://www.linux.com/news/enterprise/storage/8200-back-up-like-an-expert-with-rsync

Back up like an expert with rsync | Linux.com

A: Mainly, because the question of how to restrict access to scp or sftp only kept coming up on a few different mailing lists I was on at the time... Several people made some suggestions (like using a shell script as the user's shell) which sort of work, but aren't terribly secure or reliable. The commercial SSH product has a program to do this, but OpenSSH does not. Joe Boyle has a similar program called scponly , which at the time I looked at it had some security problems, though they have since been fixed...

rssh - FAQ

http://www.pizzashack.org/rssh/faq.shtml

Bash Script to Check MySQL Replication Status, Notification | Blog of Jason Grimme – Programming and All Things Jason

Posted on 07 April 2010 by Jason Grimme The first few days after setting up MySQL replication, I noticed that one small error would stop the replication. When this went production, we couldn’t afford to have the replication stop and not know about it. We can’t log into all our servers and check the status of things on a daily basis, we want to be notified about them. Luckily for me since I’m relatively new to bash, I found what somebody else had done and modified it a bit to suit our purposes. I then setup a cronjob for it to run every day and send us a notification email whether the status is good or bad. http://studioshorts.com/blog/2010/04/bash-script-to-check-mysql-replication-status-notification/
rsnapshot is a filesystem snapshot utility for making backups of local and remote systems. Using rsync and hard links, it is possible to keep multiple, full backups instantly available. The disk space required is just a little more than the space of one full backup, plus incrementals. Depending on your configuration, it is quite possible to set up in just a few minutes.

rsnapshot

http://rsnapshot.org/
http://mirrors.fedoraproject.org/publiclist/Fedora/ Fedora is distributed to millions of systems globally. This would not be possible without the donations of time, disk space, and bandwidth by hundreds of volunteer system administrators and their companies or institutions. Your fast download experience is made possible by these donations. This list is dynamically generated every hour, listing only up-to-date mirrors.

MirrorManager

MirrorManager

http://mirrors.fedoraproject.org/publiclist/Fedora/5/ Fedora is distributed to millions of systems globally. This would not be possible without the donations of time, disk space, and bandwidth by hundreds of volunteer system administrators and their companies or institutions. Your fast download experience is made possible by these donations. This list is dynamically generated every hour, listing only up-to-date mirrors.
H ow do I use bash for loop to repeat certain task under Linux / UNIX operating system? How do I set infinite loops using for statement? How do I use three-parameter for loop control expression? A 'for loop' is a bash programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement i.e. it is the repetition of a process within a bash script. For example, you can run UNIX command or task 5 times or read and process list of files using a for loop.

Bash For Loop Examples

Setting up a Fedora NFS server « myfedora

Setting up a Linux NFS (Network File System) server has never been anything challenging. However there are a few security issues worth having a look at: especiall the firewall-part of the business. In the following guide, we are going to have a look at a convenient way of creating an NFS server from behind Fedora’s built-in iptables firewall. The /etc/exports file is for storing information about your NFS shares: the name of the folder to share, the IP address(es) of hosts to access your share and the rights connected to your share.
This HowTo explains how to set up the Network File System version 4 on your LAN for multiple shares. It explains, also, how to mount the exports on your client . The nfs-utils package provides what's need for both then client and the server. Usually, it comes preinstalled on an "out-of-the-box" installation of Fedora. However, to make sure it's installed run the following command.

User:Renich/HowTo/NFSv4 - FedoraProject

Regular Expressions

Now this is all well and good, but who wants to run their whole life from a single bash instance? If you use an X window system, you can type your passphrase once when you fire up X and all subprocesses will have your keys stored. Just press return when it asks you to assign it a passphrase- this will make a key with no passphrase required. If this works right you will get two files called whoisit and whoisit.pub in your .ssh dir. command="echo I\'m `/usr/ucb/whoami` on `/usr/bin/hostname`",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-dss AAAAB3NzaC1k[...]9qE9BTfw== whoisitnow That will do what we want on Solaris; to try this example on Linux use this:

HOWTO: set up ssh keys

Installing Fedora Core 12 (FC12 “Constantine”) on old hardware. « Personal blog of Chris ERGATIDES

Home > All , Linux > Installing Fedora Core 12 (FC12 “Constantine”) on old hardware. If you’re anything like me, you always want the latest, shiniest stuff running on your machines, even if you’re not supposed to be able to do so. I think that this is what FC12 was trying to tell me by flashing a very brief message along the lines of “You do not have enough RAM to run the graphical installer.” whilst trying to do a clean install on an old P3 800Mhz machine (a quick search confirms that I’m not the first to get this ). It subsequently kicks into text mode installer, gets your keyboard, partitioning, root password and timezone settings, then goes off and installs exactly 200 packages without even asking you what you want to install. When it is done doing that, it reboots into runlevel 3 (console) and you get no GUI as you would expect.