How do I check if a package comes preinstalled with Ubuntu or if I installed it myself? [duplicate]

This question already has an answer here: Generating list of manually installed packages and querying individual packages 12 answers I’m writting instructions for someone else, and I want to know if I need to include a couple apt install commands in my snippet to make it completely copy/paste-able on a fresh Ubuntu installation. How do…

Details

Why it dose not work when I set CNAME to let my domain point to another domain?

I have registered a domain, say myDomain.com, and I want to try out how CNAME works. I changed the CNAME of www.mydomain.com in GoDaddy and let it points to another domain, say Amazon.com, but when I try to visit www.mydomain.com, it displayed “this site is not currently available”. From what I’ve read here: https://ns1.com/resources/cname it…

Details

Bad randomness exploitation

There is a contract with a betting function that calculates a random number and send you back a reward if winning. The betting function looks like: function bet() public payable { if ((random()%2==1) && (msg.value == 1 ether)) { if (!msg.sender.call.value(2 ether)()) throw; } } function random() view returns (uint8) { return uint8(uint256(keccak256(block.timestamp, block.difficulty))%256); }…

Details