Showing posts with label cygwin. Show all posts
Showing posts with label cygwin. Show all posts

Friday, March 13, 2015

Simple shell based smtp client... really simple..

I first found email as part of cygwin.   This is a quick and simple tool for sending email.  I use it to send status messages and attaching scheduled reports from shell scripts.  it just works.  no fuss, no local mta setup.

I've installed, it into Ubuntu server, and Raspbian and had it work, as well as using it regularly in Cygwin.  The man page is really thorough.  There are optional config files, but I typically specify everything on the command call, just personal preference.

My quick script for installing dean jone's email program, based on his site. (ok, i added a line to get the parts to compile, otherwise it's his commands to pull and build.  Being that this blog serves as my personal annotated bookmarks, I hope he doesn't mind)


In my scripts, I put the following at the top

email_from_address=some@email.address
email_from_name="someones name"
email_server=address or ip
email_port=a port
email_recipients=someoneelse@email.address,different@server.elsewhere

and then where I want to send email,

echo "
 message here 

white space is sent so layout your message as you want it
to look

great!
" | email -n $email_from_name -f $email_from_address -s "subject" -r
$email_server -p $email_port $email_recipients



that's it..

If bcc is needed, do --bcc before the final recipients list and and a list of recipients

Monday, August 19, 2013

A response to Cygwin's "setup.exe" requiring administrator privileges



Shaddy Baddah in his message setup.exe now requires administrator privileges identifies a problem.  For reasons that escape me Cygwin, in a departure from the minimalistic intrusive installs of the past, now demands administrator rights. Tired of granting Admin rights to everything, I decided that there must be a better way. Starting from the following screenshot, let's fix this.

Notice, that the windows security badge is there... 
Opening up the file with a hex editor you get...


changing that to this by spacing out the line
 
results in
 

 which seems to install without any problems, and also makes me question the windows security paradigm.  Seems strange to also point out that the decisions made to require higher privileges appears to be an unnecessary overreach of rights.

Afternote: I only saw Yaakov's response before running off to find this solution.  If you read through all the message tree, the original poster tried to replace the line with a different line.  This was unsuccessful, as I'm sure that the change altered the binary in a minor way.  Having had to execute similar changes to Java Class files, for which the source was misplaced, I was careful not to alter the length, simply replace with spaces and save in hex.

Wednesday, June 19, 2013

Clone Cygwin packages.

I've come to depend on having a specific set of cygwin packages installed when working on systems.  The simple way to make sure it has what I expect is to install it.



I set this up to run regularly, which is why the filenames are timestamped.

Credit for inspiration to use /etc/setup/installed.db goes to http://cygwin.com/ml/cygwin/2011-09/msg00079.html

xmission is one of the closest sites, pick the appropriate one for you at http://cygwin.com/mirrors.html

Monday, June 17, 2013

Windows Explorer to current Bash prompt

There are times when it's just faster to do some things from Windows Explorer, than from Bash.  I know, this is sacrilegious to say, but it's usually when doing Windows specific things, so give me a pass here.

I've seen many ways to do this, but I'm partial to this way. 

I used nano to save this file to /bin/x, chmod 700 and done.

It's small and simple.

Unix philosophy anyone?

Friday, March 22, 2013

Colorize ls - cygwin Tweak #1

My cygwin tweek #1 can be added a number of places, but I typically add to /etc/profile because it's set for every user.

Thursday, April 12, 2012