Tag Archives: linux

Elinks User Agent Override

To manually set the useragent for the e-links web browser, edit this file: ~/.elinks/elinks.conf The syntax for setting or overriding the user agent is something like this: set protocol.http.user_agent = “Firefox/2.0.0.4” Or possibly this for a more realistic agent string: set protocol.http.user_agent = “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060426 Firefox/1.5.0.4”

Posted in Web Development | Tagged , , , , , , , | Leave a comment

Where Linux Mail files are stored on OS X

“1 new message” – a common notification when you start the terminal, especially if you have cron jobs set up and an error occurs. You can use the built-in “mail” function to check and erase messages, or you can manually edit / delete the files located in the directory: /var/mail

Posted in Tech Tips | Tagged , , , , | Leave a comment

Fake Sendmail for Mac (linux)

When developing in PHP perhaps you need to set up a sendmail that just outputs things to text. No need to setup delivery via SMTP. Just create an executable ruby script somewhere, for example: /usr/bin/fake-sendmail.sh with following content: $ touch /usr/bin/fake-sendmail.sh # make it executable (will require root priv.) $ chmod +x /usr/bin/fake-sendmail.sh #!/usr/bin/ruby path = “/tmp/fake-mailer” Dir.mkdir(path) if !File.exists?(path) File.open(“#{path}/#{Time.now.to_i}.txt”, “w”) do |f| f.puts ARGV.inspect $stdin.each_line { |line| f.puts line } end Then edit php.ini sendmail_path = /usr/bin/fake-sendmail.sh props to dan for the script Update I changed one line to use a micro-time format because I was having some trouble with a very fast sending script overwriting some of the existing e-mail files. So, here is the new line to insert: File.open(“#{path}/#{(Time.now.to_f.to_s.gsub(“.”,””)+’00000000′)[0..14]}.eml”, “w”) do |f| Do you need fake sendmail for windows? Check out Byron’s fake sendmail for windows.

Posted in Tech Tips, Web Development | Tagged , , , , | 1 Comment