Quickest Way to Generate a Huge Dummy File in Linux
Monday, June 9th, 2008The following will generate a dummy 500 MB file named ‘outputdata’ in no time whatsoever:
dd if=/dev/zero of=outputdata bs=500M count=1
The following will generate a dummy 500 MB file named ‘outputdata’ in no time whatsoever:
dd if=/dev/zero of=outputdata bs=500M count=1
Until Amazon release a Fedora 9 AMI for EC2, you have three choices as far as getting a Fedora 9 instance goes:
Maybe building an AMI from scratch is a bit more effort than you were hoping to expend today? And perhaps using an untrusted 3rd party AMI will leave you feeling a little uneasy about your security?
Assuming you trust Amazon to some extent (and if you don’t, perhaps EC2 isn’t your best bet), how do you go about upgrading a Fedora 8 image?
Thankfully, the answer is fairly simple. First, boot a suitable Fedora 8 image, then follow the instructions kindly provided by Carson McDonald on ioncannon.net - which, incidentally, is an invaluable resource for Fedora upgrades of all kinds. Before you know it, you’ll be up-and-running with Fedora 9 on EC2!
Update: the above works fine with a 32-bit AMI. If working with a 64-bit AMI, you’ll need to run the following before using rpm to install the new release:
rpm -e --nodeps curl.x86_64 curl.i386
A quick search of the web reveals that Amazon’s EC2 is perhaps not a great choice for a host when it comes to sending emails. Workarounds exist - using a 3rd party forwarding service, for example (see Paul Dowman’s blog for a good discussion) - but what do you do if you have to send emails from your EC2 instances? What can you do to give your email the best chance of getting delivered?
Here are some ideas that should help things a little:
/etc/hosts too (use the private IP for this), and on Fedora at least, you probably want to set the hostname in /etc/sysconfig/network so that it persists across reboots./etc/mail/trusted-users and restarting the service. Not doing this can result in the MTA leaving warnings in your mail headers.Please respond if you have any feedback or further tips when it comes to emailing from EC2.
Here’s a simple example showing how to export the results of a MySQL query to a CSV file on disk:
SELECT some,fields,to,export
INTO OUTFILE '/tmp/sqlresult.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
FROM some_table WHERE some_other_field=123;
Hopefully that’s reasonably self-explanatory. Obviously you’ll edit the SQL accordingly and replace /tmp/sqlresult.csv with the path to the file you want to create.
In order to use svn+ssh:// URLs on a port other than 22, you need to edit your subversion configuration and define a tunnel.
Open up ~/.subversion/config in your preferred editor and head to the [tunnels] section. In here you can add something along the lines of the following:
myscheme = ssh -p 12345
This will enable you to work with URLs like: svn+myscheme:// and connect to Subversion on SSH port 12345.
Of course, there are also other SSH arguments you can include, such as the username to connect with, whether to use compression, and so on.
To find the mac address of your MacBook’s wireless interface:
Ready? It’s:
:> filename
(i.e. colon greater-than followed by the name of the file). This can also be used to create a new, empty file.
Having recently moved from the world of Windows, and even more recently picked up a 2nd Mac, and then even more recently again donated the original Mac to a relative, I hit upon the problem of both Macs having the same name. Of course the network address of each computer was different - one had a “-2″ appended to it, which I wasn’t particularly fond of.
Anyway, as usual, this turns out to be very easy to remedy:
Et voila!