Check These Out
--open -sV
is not needed if you are only looking for hosts with 22 open
Lots of scripts show you how to use socat to send an email to an SMTP server; this command actually emulates an SMTP server!
It assumes the client is only sending to one recipient, and it's not at all smart, but it'll capture the email into a log file and the client will stop retrying.
I used this to diagnose what emails were being sent by cron and subsequently discarded, but you can use it for all sorts of things.
say, someone has aliased ls to 'ls --color=always' and you want to temporarily override the alias (it does not override functions)
i sorta stole this from
http://www.shell-fu.org/lister.php?id=878#MTC_form
but it didn't work, so here it is, fixed.
---
updated to work with jpegs, and to use a fancy positive look behind assertion.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Shows a file without comments (at least those starting by #)
- removes empty lines
- removes lines starting by # or "some spaces/tabs then #'"
Useful when you want to quickly see what you have to customize on a freshly installed application without reading the comments that sometimes are a full 1000 lines documentation :)
While posting, I saw this http://www.commandlinefu.com/commands/view/1041/display-contents-of-a-file-wo-any-comments-or-blank-lines
But it's dirty and incomplete, to my mind
My original goal was to remove lines like "\t*#" but I can't figure out how to do a egrep '\t' on a command-line. Two workarounds if needed:
$egrep -v 'press control + V then TAB then #' /your/file
or
$egrep -v -f some_file /your/file #where some_file contains what you want to exclude, example a really inserted TAB
This command will first add an alias known only to git, which will allow you to pull a remote and first-forward the current branch. However, if the remote/branch and your branch have diverged, it will stop before actually trying to merge the two, so you can back out the changes.
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html
Tested on git 1.5.6.1, msysgit (Windows port)
Actually this is not really the way I want it. I want it to attempt a fast-foward, but not attempt to merge or change my working copy. Unfortunately git pull doesn't have that functionality (yet?).
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
Quick and easy way to find out which php.ini file is being used. Especially useful if you just need to find the location of the file for editing purposes.