There are two probable origins for this idiom and I think both are equally plausible. The first one is that when you spread butter on bread you are buttering it up like one would do when trying to flatter someone. The second is in ancient India there was a practice of throwing balls of butter at statues to ask for favor, i.e. buttering them up. (source)
When we use the phrase today we generally mean that extreme flattery is used to gain information or favor. It's not always necessarily a compliment.
Today's idiom was uttered during fights, I'm thinking when an especially powerful hit provided the needed knockout in a fight. But it became a popular phrase in the mid-1960s when Pepsi-Cola wanted to increase the popularity of a southern drink called Mountain Dew. It was a regional drink that Pepsi thought had potential to become popular nationwide. The first ad campaign promised to "knock the socks off" anyone who drank it. (source)
The phrase today is a positive one meaning that someone who has their socks knocked off has been surprised or astonished.
Searches didn't reveal an origin for this phrase and the given explanation leans toward the phrase meaning reasonable, read about it here. The phrase means practical and humble, unassuming, unpretentious, reasonable.
I have always thought this idiom's figurative meaning was that a person being called a diamond in the rough wasn't living up to their potential yet and it was going to emerge soon. But according to this website it means someone who is basically good hearted but lacking social graces and respect for the law. It's possible this is a cultural difference since that website is UK based, perhaps it holds that figurative meaning in Britain?
This phrase is believed to have originated with hotels, or more specifically, an "alarm clock" type service that hotels had, and still do. Read all about it here.
When we use the phrase today we mean it as the original meaning and it also means an event or occurrence of some sort which alerts a person to a problem that needs fixing.
In Tudor England Elizabeth I, in an attempt to turn around a national debt, signed the license in 1567 to have a national lottery. Drawing a blank was a phrase used when someone drew a blank lottery ticket. It's a pretty fascinating history, read about it here.
Throughout the centuries the phrase evolved into how we use it today, to fail to recall a memory or fail in some speculative effort.
In the early 20th century gambling with dice was illegal in many states and so gamblers went to some pains to hide the dice when challenged by the police. Courts would sometimes throw out cases if the dice weren't offered in evidence. Thus "no dice." (source)
Today when we say it we are actually saying that we are refusing the proposal presented.
This idiom has its origin in the theater when impromptu performances were given by actors who had hurriedly learned their lines while waiting in the wings and then received prompts from there. (source)
The phrase expanded outside of the theater to mean doing anything without preparation.
This phrase means something that requires little mental effort or intelligence to perform or understand. The term is often applied to decisions which are straightforward or sometimes to people who appear to lack intelligence. The origin of it isn't clear, it seems to have just come into being. Read about it here.
In the late 17th century this phrase started appearing in speech. At first it was simply "a pill to swallow" and then as the years went by different people started adding the word "hard" or even "bitter" to the saying. The idea then, and now, is that pills can be difficult to swallow - and in the figurative sense a hard pill to swallow means accepting something that is hard to believe. (source)