Few things here.
First, i'd be more worried about the neighborhood locals. What is the neighborhood ethnic makeup? If it's mostly black and you aren't black, then I'd be weary. If it's white trash and you're not white, I'd also be weary. Same for everyone else.
*Blend in. Don't wear fancy clothes, iPod accessories or anything that is valuable. Don't flaunt wealth. If some destitute drug addict sees you, you're a big juicy target.
*Ditto for gang members looking at an outsider. They most likely will rob you to exert power over you. They want you to be a cowering victim. You most likely wont get your ass kicked if you just act scared and give then what they want.
I'v been robbed at knife and gunpoint when I went to high school in Jamaica, Queens. It was a primarily black neighborhood and during freshman year I was a frequent target being a white kid. It was more a joke for them, robbing the lone white kid of two or three dollars and laughing at me. I learned to make friends with kids who took my bus so when we got off or walked to it, we rolled deep. After that no one ever went near me again. Also, don't be a hero. Even if you think some fighting classes are worth it or your a big guy, just don't be dumb. A gun doesn't care and neither does a drug addict.
I'm assuming you will be renting an apartment? Cameras are your best friend. Setup a few hidden inside cameras inside which will catch someone wandering around tearing up the place looking for valuables. Keep them low and head level if you can. A raspberry pi and web cams will satisfy your Linux craving if you go that route. Use a big USB key, 128GB+ to record on a loop. That or get fancy and make a cloud setup for remote access and recording.
Make it look like someone is home. A light coming on if a loud noise is made or window/door is touched will help. Arduino project perhaps? Maybe send a text if an event comes through. Then use your phone to connect to your web cams to have a look around. The sound of a dog barking is also pretty damn good. Get a big ass dog if you can. No crack head wants to mess with a dog. Dogs, and good outdoor lighting are the best security if you ask me. Plus, you can walk the dog to stores and no one will mess with you.
Oh, and leave some money laying around in your house. Most break-ins are by drug addicts. If you have 60 bucks on the kitchen table, hopefully that is all they want and they will get the hell out. Keep smaller electronics out of sight like gaming systems laptops and tablets. They go for the low hanging fruit. My friend had his car broken into in a real bad area populated by homeless drug addicts. The back of his car was all computer boxes will Dell and HP printed on them as he was a travelling service tech. They broke his window and stole his ashtray which had a few bucks in cash and a bunch of change. Didn't take one box or the fancy radio. They don't want to fence or pawn shit if they can get cash. Drug dealers take cash only.