This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -u root -proot dbname > filename-$(date '+%Y%m%d-%H-%M').sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex +'/BEGIN CERTIFICATE/,/END CERTIFICATE/p' <(echo | openssl s_client -showcerts -connect example.com:443) -scq > file.crt | |
^^ add this file to OS keychain | |
http://superuser.com/questions/1004794/how-to-always-allow-insecure-connection-for-a-certain-url-in-chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def open_text_file_with_valid_encoding!(file_path, encoding='UTF-8') | |
# Tries to find a valid encoding for a text file. | |
# Converts return value to UTF-8. | |
encodings = ['UTF-8', 'ISO-8859-1'] | |
contents = File.open(file_path, "r:#{encoding}") { |file| file.read } | |
unless contents.valid_encoding? | |
if next_encoding = encodings[encodings.index(encoding) + 1] | |
puts "Warning: Encoding #{encoding} for #{file_path} is not valid. "\ |
OlderNewer