Showing posts with label hosting. Show all posts
Showing posts with label hosting. Show all posts

Tuesday, January 12, 2016

What to study before a linux admin position?

**DISCLAIMER, I INTERVIEWED THIS MORNING BUT I DID NOT INCLUDE ANY ACTUAL QUESTIONS FROM THE INTERVIEW OUT OF RESPECT FOR THE COMPANY
and because facebook got mad at me that one time**

To get started, I want to say that I prep for the first interview of a linux admin position the same way whether that is a support position, a site reliability engineer position, or a devops role. This is not going to be formatted with questions, as no interviewers want their questions shown. I went through this prep this morning, before an interview, and it went well. I have had interviews not go well. And just some basic advice, be honest about what you don't know. If you know more than one way to do something, say all the ways.

I would like to take a second to name drop, I have interviewed at places you've probably heard of, a certain search engine, a certain social network, and several hosting companies. That's as name droppy as I'm getting.

This is going to be formatted as, here is a personality question I totally choked on, and here is something you should study for your interview, just to keep it light.

Personality:
If you had a theme song, that played when you entered a room what would it be:
"Creep" audible exhale "You know by radiohead" "I know"

Technical:
The first thing all of the places I have interviewed always ask is, ports. It's predictable, but the worst part is, I forget them. They're just muscle memory to me. So you should study your basic ones, you should at least glance over these before the interview in case you get confused, once during an interview I said ftp was 22 and ssh was 21. Don't do that. Know at least, ssh, ftp, httpd, mysql, pop3, imap. This stuff is all muscle memory and you loose it, so just look at it again. If you're interviewing within your company or this is your second interview with the company you probably won't be asked these(hopefully).

Personality:
What's your biggest weakness:
"Chocolate" "Ugh.."

Technical:
Know some basic linux signals. Why? I don't know, I've never manipulated signals manually but good lord do they love to quiz you on linux signals. You shouldn't have to memorize all of them but know what SIGKILL, SIGINT, SIGHUP, and SIGCHILD do at least. Again I have no idea why they ask this I've never manipulated signals in anyway other than you know, kill -9 or ctrl -c or whatever.

Personality:
Tell me a joke:
"What's big red and eats rocks" "What?" "A big red rock eater" "...I don't know what to do with that"


Technical:
Now were getting a little deeper, these might be things that are on the second interview, or if your getting sort of a grilling in your first one you might be there. You must, absolutely must know how DNS works. A friend of mine has a great write up on it. I wrote a little rap, about it:

Looking for company.com, is complicated
Got to check your chache to get elucidated
If nothings there let's go to local hosts file
should you find it lacking, contact the nameserver for a while

This is a recursive query, The Nameserver looks,
check its cache , see if it's on the books
nothing there, time for a zone check,
no dice, put the root server on deck,

I wouldn't suggest you rap it in the interview...cause you didn't write it, I did. So I get to do that, not you. Also I have a nerdcore album if your interested. Know nslookup, dig, even ping can be a dns tool.

Personality:
Can you explain DNS?
Did the above rap

Technical:
Know basic commands. Know less, cat, head, tail, ifconfig, ip, telnet, nmap, netstat, route, sed and awk. Now I'm leaving a few out, but your trying to be a linux admin, you need to know linux or as I have taken to calling linux+gnu....sorry rabbit hole. Know the linux and gnu tools. Know them...KNOW THEM.

Personality:
Can you give me an example of bad customer service:
"Comcast, they're the worst, they banned me for two years" "Umm...for what" "Oh just to much upload, they emailed my comcast address as an alert but I don't check that so they just banned me" "Oh my, so what did you use for internet" "My neighbors" "Oh well good thing they didn't use encryption" (this is him giving me a sort of out) "Oh, no. It's encrypted" (This is me not taking it)

Technical:
Know permissions. Know how they work. Know how to change them. Know the numbers. Know the letters. Know the math.  2, 4, and 1, not hard people. 777 go to heaven, 755 stay alive.


Personality:
How early did you get here:
"About 30 minutes, but I spilled something on my shirt and went to the store and bought another shirt so, actually right about on time"


Technical:
Know Grub. Know how to install a new Kernel. Know Partitioning.

Personality:
Where do you see yourself in 5 years:
"Using a tape recorder to create fraudulent subway tickets, as I plan the oncoming hackoclypse" "I'm sorry what." "Nothing, I didn't say anything."

Technical:
Know everything? It's to much to know, I think I have about 10 years official linux experience and I still miss the easy ones sometimes, this morning I didn't know what port MySQL was on...cause I'm constantly typing that into terminals...no. I installed my first linux install in 1999 from a cd I pilfered from a book at booksamillion cause you know, dialup wasn't going to get me there. It's ok to miss some. Always be honest with the interviewer, I've found doing that, generally steers them away from asking anything in a domain you don't know anything about. And always give as many answers to the solutions as possible. I hope your interview experience goes as well as mine did this morning, and that none of you have the personality question gaffs that I did.

I will make another part to this for SRE specific rolls.

Sunday, January 10, 2016

Some explanation on my posts at bdm or everyday one liners for hosting

My tumblr blog I mostly used for saving one liners, for when I was working in hosting, bad decision method has a bunch of one liners I would like to explain.
For mac, finding largest files:

sudo du -hcx | perl -nle 'print "$_" if(/^(\s|)(\d\.\d+G|\dG)/);' | sort -rnk1,1 


Mac's have some interesting compatibility quirks with certain things in the *nix universe. And I believe I composed this particular one liner because the -P switch on grep is not valid on a mac. So what I do was a standard, what files with du -hcx, piped that to perl and used perl in lieu of grep -P so I could seperate, then pipe to sort, what I needed to do to find the largest files and directories on my mac.

Ok so here is one on how to find bots / spiders / crawlers, in a certain time frame:


cat /var/log/httpd/access_log | perl -nle 'print "$_" if(/02:0(\d):(\d+)/);' | egrep 'bot|crawl|spider'

So it searches your log for any time between 2:00:00 and 2:09:59, with bot, crawl, or spider. This is useful if you are trying to determine if a site is down because yandex and google-bot are slamming it at the same time. 

This defeats a certain test at a certain hosting company:


perl -nle ‘print “$1” if(/(Question (\d+|\d)(.*)| (correct answer.*))/);’ quest

I've said to much already.

But for all of this shit, where I have used perl...awk is probably the better, more elegant solution.



Occasionally at my hosting job, some ubuntu boxes would just forget what happened, and where there root directory was supposed to be mounted, this is the quickest, though not the recommended way to fix that:


cat /proc/mounts > /etc/mtab

Also if you want to see the guy who beat me, in a perl(me) vs awk(him) head off, you should head to his blog, here.
He has a sed vs my perl on the apache log, finding certain times that's pretty elegant too. I mean I try to always recommend the best tool for the job, I find myself using php to often for this reason, and I don't like it, like when I just quickly need to iterate through json or something, I guess I should be using node for that. Ultimately though I use perl for text processing, because I know it well, which sometimes makes it the fastest tool for the job.

Thursday, October 30, 2008

irc.9unkz0r.com back online, again, and an IRC Shell review

Ok so our server got taken down, by Binary Shells, because we were accused of "botnet activity". Binary Shells was not prompt in helping us, and they offered no evidence. I strongly recommend against using them. Anyways we are up now so:

/server irc.9unkz0r.com
or
/server irc.mechanicalpinata.com

I would prefer you use the mechanicalpinata.com address(however they both resolve to the same IP).
Once again I want to emphasize http://www.binaryshell.com, is not a site that I recommend. I do recommend however, beef jerky, both slim jims and jack links.