The man accused of murdering care worker Ffion Wyn Roberts has started giving evidence in his defence.
The body of Ms Roberts, 22, was found in a drainage ditch in Porthmadog, Gwynedd, last April.
Iestyn Davies, 54, also from Porthmadog, denies murder.
Wool packer Mr Davies told the jury at Caernarfon Crown Court how he had only been in trouble once with the police, in 1984, when he was fined £50 with £30 compensation for assaulting a woman.
Giving evidence in English despite his first language being Welsh, he told his barrister Patrick Harrington QC that he had lived at Porthmadog since he was a baby. He had two sisters and a brother.
He told the court that he knew the town well and that he also knew the family of Ffion Wyn Roberts, and had been to school with her father.
He said he was a regular in The Station pub in Porthmadog, where Ms Roberts' father worked behind the bar two days a week.
Mr Davies said he usually got up early in the morning - it was normal for him to be out walking his dog at four o'clock in the morning.
Ms Roberts was last seen in the town centre in the early hours as she walked home from a night out with friends.
The jury heard that on the weekend that Ms Roberts was murdered, the defendant was trying to move out of his flat by Porthmadog Harbour and put his belongings into store.
On Wednesday morning, the court heard from the victim of Mr Davies's 1984 attack, Genevieve Tarr, from Derbyshire but then of Stockport.
She told the court she had been on holiday in Porthmadog in August that year and she was walking near the sluice gates at Porthmadog Harbour.
As she crossed a narrow bridge, she said she looked up and saw Iestyn Davies in front of her with a rock in his hand.
Mrs Tarr said: "As he walked past he attacked me. He grabbed me and had a rock in his hand and raised it. He told me not to scream.
"He brought it down and hit my husband's watch which I had in my hand. I was terrified.
"Then a young girl came along and he ran away. I can't remember much after that."
She said she started to scream and he threatened to kill her if she did not stop.
The witness to the attack, Caroline Edwards, told the court she was aged about 20 in 1984 and knew the defendant. She said she had been walking towards the gates when she heard cries.
She said: "I saw Iestyn and a lady standing against the gates. He was pressed up against her. I shouted his name. He looked at me and ran."
Fighting back tears during her evidence, Mrs Edwards told Elwen Evans QC, prosecuting, that she had feared the defendant was going to hit the woman with the rock.
When he was in the witness box, Mr Davies said had been been drunk at the time, and had not had a rock in his hand but a pair of running shorts.
He did agree that he had pleaded guilty to assault and had been fined £50 but he said that was the only time he had been in trouble with the police, until he was arrested on suspicion of murder in June last year.
Mr Davies denies murder. The trial is expected to continue into next week.