Simple one liner to check if your web server is using strong ciphers
[code]
openssl s_client -cipher LOW -host SERVER_NAME -port 443 [/code]
Simple one liner to check if your web server is using strong ciphers
[code]
openssl s_client -cipher LOW -host SERVER_NAME -port 443 [/code]
Simple script in python to look for credit card numbers in a file.
[code]
#Importing modules
import re
import os
# Define variables
inputFile = ‘test.txt’
searchPattern = ‘((\D(6011|5[1-5]\d{2}|4\d{3}|3\d{3})\d{11,12}\D)|(^(6011|5[1-5]\d{2}|4\d{3}|3\d{3})\d{11,12}\D))’
tempinputFile = open(inputFile)
tempLine = tempinputFile.readline()
while tempLine:
print ("LINE: " + tempLine)
foundContent = re.search(searchPattern,tempLine, re.IGNORECASE)
if foundContent:
print("FOUND: " + foundContent.group())
tempLine = tempinputFile.readline()
tempinputFile.close() [/code]
The script started out as a simple check for any 16 digit numbers that had a non numeric character on either end. But I tweaked it a little bit to look for credit card like numbers using the regex from http://www.regular-expressions.info/creditcard.html. Finally I added an option to match credit card like numbers if the numbers start at the beginning of the line (i.e there is no non-numeric number before the credit card number)
Actually, this is more of a read on the web post. New acronym for describing technology that doesn’t really help
CBT : Cock-n-Bull Technology
🙂
The title pretty much says it all :). Here is a quick one liner, using multiple tools, to look for files in a directory, search for certain content in them and replace them with other content
[code]find -type f | xargs grep -l ORIGINAL_CONTENT | xargs perl -p -i -e ‘s/ORIGINAL_CONTENT/NEW_CONTENT/g’ [/code]
You can theoretically take out the grep (second command) and directly pipe the find output to perl and get the same outcome.
Going over list of the options used
find
grep
perl
Making a list just because :).. Here are some of the things I install on a windows machine as soon as I get it
Whats on your workstation?
If you are every looking to match strings as a whole word instead of literal strings using a regular express, Word Boundaries are your friend
For example if you are looking to match a string of 10 numbers in a log file, you can use
[code]grep -i ‘\b[0-9]\{10,\}\b’ –color -H -n FILE_NAME_TO_SEARCH [/code]
The \b is the option that tells grep to look for a word character.
More information about the option is available at http://www.regular-expressions.info/wordboundaries.html
Doc Searls on the conflict between content creators and consumers in the digital era
Data wants to be free but value wants to be paid for
Tom Merritt on the Internet
The internet never forgets anything until you want to keep it, (and) then it forgets it
Milwaukee mayor, Tom Barrett commenting about his political goal while speaking with Robert Siegel on all things considered
I will never be the rock star of the far right and I’ll never be the rock star of the far left. What I want to be is rock solid and create jobs in the state.
Entire interview can be found here http://www.npr.org/2012/05/31/154093267/political-battle-heats-up-as-wis-recall-election-nears