I'm not sure if this is what I was looking for, but I piped the grep output to a text file, put #!/bin/bash at the top, and ran it like a regular script. if anyone has a solution that doesn't involve creating an executable script as a file as a go between, that'd be great.
grep "wget" README | bash
Accomplishes the same thing.
Adding '#!/bin/bash' or '#!/usr/bin/perl' to the top of a file only matters if you are invoking a script like './script.sh' or './script.pl', because Linux doesn't use the file extension like windows does, it uses the special hashbang comment at the top to decide what to run the script with.
Alternatively, you can invoke a script directly with the interpreter you wish, such as 'bash script.sh' or 'perl script.pl'. This way does not require the hashbang comment (the script doesn't even need to be executable!).
Another way you could write 'bash script.sh' is 'bash < script.sh', bash will read script.sh from STDIN and happily execute each line. 'cat script.sh | bash' works the same way, and the above 'grep "wget" README | bash' works as well.
Rsync does a pretty good job of this automatically by comparing timestamp and size. You can force it to do checksums on files that are the same size on both sides using -c or --checksum but it may slow things down significantly.
NFS can be used with PXE and TFTP for net booting.
But in this case you'll just put all of your WWW files (/srv/www or whatever) on a single server, then mount that using NFS on each of the 3 webservers (to /var/www), so any change made to those files on any web server will actually happen on the NFS server, and the other web servers will get it instantly.
A shared file-server (NFS, for example) is pretty common. If you have any databases you'd have to replicate them or host them on the file-server as well.
If your webapps are session-aware, you need to store them somewhere shared as well (NFS, DB, Memcached, etc).
If that's too much overhead, you can just remember to rsync the files when you change something (or set a sync in cron), and use 'session persistence' in your LB to always route a user's IP to the same server (unless it goes down).
It may be worth running apache with vhosts (all subdomains) on all but one server, and use the extra server as a low-level loadbalancer (LVS, piranha, keepalived, ldirectord, etc). That will balance the loads between all servers evenly and provide redundancy if one server goes down. This puts very little load on the public facing server and you should easily be able to move 100Mbps through the Pi if needed (you'll get even more performance out of a 'directly routed' configuration, where all return traffic comes from the 'real' servers).
Otherwise, you can use a layer-7 (application aware) load balancer like HAProxy, Apache (mod proxy), nginx, etc to route the packets to the correct server based on the 'host:' header in the request. If you're doing any SSL you'll have to move that up front for this solution to work.
With auditd, you can get all syscalls (or a filtered list) performed on any filesystem, or limit it to certain users/groups or PIDs/PPIDs. See man auditctl for help with rules.
#Log all files opened by PID 1337
auditctl -a exit,always -S open -F pid=1337
There's no reason to partition websites to single servers when they can run at the same time on multiple servers, you can distribute load evenly between them and even take them down one at a time for upgrades and testing.
Use a single database/nfs server to pull data from (although most dbs can be replicated between 2 active hosts while keeping the performance, filesystems are trickier).
Session based applications can be set as persistant (a user will always go to the same server, unless it has gone down) or you can implement sessions in something like memcached and share those among your pool of www servers.
There's a difference between talking about "a square root" and sqrt(x) or √x, the latter two are mathematical functions which can only have one output. By convention, the √ function is defined as the principle (positive) square root.
If you want both values, you have to specify ±√:
f(x) = ±√x is not a function in the proper sense, but a multi-valued function: it assigns to each positive real number x two values: the (positive) square root of x (√x), and -√x.
As for why (0,inf) was chosen as the domain, it just makes things neater (same reason pi isn't 2*pi):
Consider the very simple rule √(ab) = √(a) * √(b), that wouldn't work if the function returned a negative, and it's FUBAR if each of the 3 instances could be either positive or negative!
It's hard to manage and is against the "Red Hat Waytm", basically it nullifies the advantages of using a RHEL system.
Of course, if you have a dev machine, compiling your own RPMs is sometimes necessary, I typically throw those into a company repo along with the dependencies.
Best answer: Find a repo that has the correct version.
Also acceptable: Create a repo and include the correct version and dependancies.
OK answer (if you don't manage many systems): Download and install the individual RPMs you need (ex: Data Dumper, that one is in RPMforge so check to see if you set that repo up correctly).
If your ids are Primary keys (or at least unique indexes), you can use 'INSERT IGNORE' to insert only rows with different ids without aborting or duplicating anything.
If you use the IGNORE keyword, errors that occur while executing the INSERT statement are treated as warnings instead. For example, without IGNORE, a row that duplicates an existing UNIQUE index or PRIMARY KEY value in the table causes a duplicate-key error and the statement is aborted. With IGNORE, the row still is not inserted, but no error is issued.
IGNORE has a similar effect on inserts into partitioned tables where no partition matching a given value is found. Without IGNORE, such INSERT statements are aborted with an error; however, when INSERT IGNORE is used, the insert operation fails silently for the row containing the unmatched value, but any rows that are matched are inserted. For an example, see Section 18.2.2, “LIST Partitioning”.
Data conversions that would trigger errors abort the statement if IGNORE is not specified. With IGNORE, invalid values are adjusted to the closest values and inserted; warnings are produced but the statement does not abort. You can determine with the mysql_info() C API function how many rows were actually inserted into the table.
There's also "INSERT ... ON DUPLICATE KEY UPDATE" if you need to do fancier stuff.
The only way I can think of is to open an xforwarding session (ssh -X), then pipe something to "xsel --clipboard" to copy it, then redirect xsel (linux), pbpaste (osx), or getclip (cygwin) to a file on your local machine.. I'm not sure how well it works with large or binary files, though.
Postfix is very simple, if you can set an outbound server on your device, literally all you have to do is add the device's IP address to mynetworks (/etc/main.cf) and it will act as a relay for that device with no other configuration... You can disable local delivery like this (optional, but probably wise).
If you want to further lock things down, you could also simply have an iptables rule that blocks port 25 from any IP except your device, postfix wouldn't allow others to send anyway (unless you fat-fingered some config), but that could reduce rejects building up in your logs.
Sendmail is similar but slightly more complicated IIRC.
You shouldn't use the ! on the terminal either. If you run !foo, bash will search its recent history for commands beginning with 'foo' and execute the most recent.
So running '!/home/user/.teamspeak/TeamSpeak3-Client-linux_x86/ts3client_runscript.sh' will search the bash history for '/home/user/.teamspeak/TeamSpeak3-Client-linux_x86/ts3client_runscript.sh' and run the most recent command matching.. I'm not sure that's what you intended (although it may appear to work if you've run the command without the ! before and it's still in your history).
So it is mounted and if you copy whatever files you may need to a folder on your local computer (as root) you should be able to change permissions from there.. Grab what you need first (most of your files should be under /media/Macintosh HD/User).
Then, to kill the GUID stuff, first unmount it with umount, then:
dd if=/dev/zero of=/dev/sdc bs=1M count=1
You'll then have a drive you can freely partition/format (I'm assuming there are GUI tools for it, but I always just use fdisk/parted and mkfs). You may need to unplug/replug the USB before you can do anything with it.
EDIT: 'bs=1M' may actually be 'bs=1m', BSD and GNU are different and I always forget which is which.
OSX drives have a weird partition table your computer might not understand. If you know the /dev/ path to the drive, you can write zeros to the first few sectors, then it should show up as an empty drive and you'll be able to format it.
Be VERY careful with this command, if you run it on any device except the HDD in question, it's MBT/Partition table will be gone forever:
dd if=/dev/zero of=/dev/<DEVICE_ID> bs=1M count=1
Make sure to change <DEVICE_ID> to the correct path to that device.
Accomplishes the same thing.
Adding '#!/bin/bash' or '#!/usr/bin/perl' to the top of a file only matters if you are invoking a script like './script.sh' or './script.pl', because Linux doesn't use the file extension like windows does, it uses the special hashbang comment at the top to decide what to run the script with.
Alternatively, you can invoke a script directly with the interpreter you wish, such as 'bash script.sh' or 'perl script.pl'. This way does not require the hashbang comment (the script doesn't even need to be executable!).
Another way you could write 'bash script.sh' is 'bash < script.sh', bash will read script.sh from STDIN and happily execute each line. 'cat script.sh | bash' works the same way, and the above 'grep "wget" README | bash' works as well.
Rsync does a pretty good job of this automatically by comparing timestamp and size. You can force it to do checksums on files that are the same size on both sides using -c or --checksum but it may slow things down significantly.
Check out the man page and the wikipedia entry.
NFS can be used with PXE and TFTP for net booting.
But in this case you'll just put all of your WWW files (/srv/www or whatever) on a single server, then mount that using NFS on each of the 3 webservers (to /var/www), so any change made to those files on any web server will actually happen on the NFS server, and the other web servers will get it instantly.
Configuring Apache with NFS
A shared file-server (NFS, for example) is pretty common. If you have any databases you'd have to replicate them or host them on the file-server as well.
If your webapps are session-aware, you need to store them somewhere shared as well (NFS, DB, Memcached, etc).
If that's too much overhead, you can just remember to rsync the files when you change something (or set a sync in cron), and use 'session persistence' in your LB to always route a user's IP to the same server (unless it goes down).
It may be worth running apache with vhosts (all subdomains) on all but one server, and use the extra server as a low-level loadbalancer (LVS, piranha, keepalived, ldirectord, etc). That will balance the loads between all servers evenly and provide redundancy if one server goes down. This puts very little load on the public facing server and you should easily be able to move 100Mbps through the Pi if needed (you'll get even more performance out of a 'directly routed' configuration, where all return traffic comes from the 'real' servers).
Otherwise, you can use a layer-7 (application aware) load balancer like HAProxy, Apache (mod proxy), nginx, etc to route the packets to the correct server based on the 'host:' header in the request. If you're doing any SSL you'll have to move that up front for this solution to work.
Look into psacct and auditd.
With auditd, you can get all syscalls (or a filtered list) performed on any filesystem, or limit it to certain users/groups or PIDs/PPIDs. See man auditctl for help with rules.
http://www.keepalived.org/
http://haproxy.1wt.eu/
There's no reason to partition websites to single servers when they can run at the same time on multiple servers, you can distribute load evenly between them and even take them down one at a time for upgrades and testing.
Use a single database/nfs server to pull data from (although most dbs can be replicated between 2 active hosts while keeping the performance, filesystems are trickier).
Session based applications can be set as persistant (a user will always go to the same server, unless it has gone down) or you can implement sessions in something like memcached and share those among your pool of www servers.
Something like this.
There's a difference between talking about "a square root" and sqrt(x) or √x, the latter two are mathematical functions which can only have one output. By convention, the √ function is defined as the principle (positive) square root.
If you want both values, you have to specify ±√:
As for why (0,inf) was chosen as the domain, it just makes things neater (same reason pi isn't 2*pi):
Consider the very simple rule √(ab) = √(a) * √(b), that wouldn't work if the function returned a negative, and it's FUBAR if each of the 3 instances could be either positive or negative!
It's hard to manage and is against the "Red Hat Waytm", basically it nullifies the advantages of using a RHEL system.
Of course, if you have a dev machine, compiling your own RPMs is sometimes necessary, I typically throw those into a company repo along with the dependencies.
Best answer: Find a repo that has the correct version.
Also acceptable: Create a repo and include the correct version and dependancies.
OK answer (if you don't manage many systems): Download and install the individual RPMs you need (ex: Data Dumper, that one is in RPMforge so check to see if you set that repo up correctly).
Bad Answer: Use CPAN or manually compile.
If your
ids are Primary keys (or at least unique indexes), you can use 'INSERT IGNORE' to insert only rows with different ids without aborting or duplicating anything.There's also "INSERT ... ON DUPLICATE KEY UPDATE" if you need to do fancier stuff.
No need to call another program:
The only way I can think of is to open an xforwarding session (ssh -X), then pipe something to "xsel --clipboard" to copy it, then redirect xsel (linux), pbpaste (osx), or getclip (cygwin) to a file on your local machine.. I'm not sure how well it works with large or binary files, though.
Note that I edited my post, the first sentence is much simpler and likely all you'll need.
Postfix is very simple, if you can set an outbound server on your device, literally all you have to do is add the device's IP address to mynetworks (/etc/main.cf) and it will act as a relay for that device with no other configuration... You can disable local delivery like this (optional, but probably wise).
if you need to send to a certain address and have it forward to gmail (device@sends.here -> forward@gmail.com) you can use /etc/aliases or set up a simple rewrite. The postfix documentation is some of the best I've ever seen, read it (basic, relay and/or alias and/or rewriting)!
If you want to further lock things down, you could also simply have an iptables rule that blocks port 25 from any IP except your device, postfix wouldn't allow others to send anyway (unless you fat-fingered some config), but that could reduce rejects building up in your logs.
Sendmail is similar but slightly more complicated IIRC.
If a RAID5 rebuild with 10x 2TB drives was succeeding 50% of the time you're actually beating the odds.
I'd highly recommend RAID6 at least. In some cases, RAID5 isn't actually any better than a single drive (especially with big consumer-grade drives).
Is there a decent terminal emulator for use with Cygwin? Something like this.
The terminal needs every character to fit within an equal space, most fonts aren't designed that way so it's resizing them.
To fix it, you'll need to choose a monospaced (fixed width) font.
You shouldn't use the ! on the terminal either. If you run !foo, bash will search its recent history for commands beginning with 'foo' and execute the most recent.
So running '!/home/user/.teamspeak/TeamSpeak3-Client-linux_x86/ts3client_runscript.sh' will search the bash history for '/home/user/.teamspeak/TeamSpeak3-Client-linux_x86/ts3client_runscript.sh' and run the most recent command matching.. I'm not sure that's what you intended (although it may appear to work if you've run the command without the ! before and it's still in your history).
It should be something like
What's the full command you're running?
So it is mounted and if you copy whatever files you may need to a folder on your local computer (as root) you should be able to change permissions from there.. Grab what you need first (most of your files should be under /media/Macintosh HD/User).
Then, to kill the GUID stuff, first unmount it with umount, then:
You'll then have a drive you can freely partition/format (I'm assuming there are GUI tools for it, but I always just use fdisk/parted and mkfs). You may need to unplug/replug the USB before you can do anything with it.
EDIT: 'bs=1M' may actually be 'bs=1m', BSD and GNU are different and I always forget which is which.
OSX drives have a weird partition table your computer might not understand. If you know the /dev/ path to the drive, you can write zeros to the first few sectors, then it should show up as an empty drive and you'll be able to format it.
Be VERY careful with this command, if you run it on any device except the HDD in question, it's MBT/Partition table will be gone forever:
Make sure to change <DEVICE_ID> to the correct path to that device.