Shawna C. Scott

Learning to hack, one day at a time

Menu Close

Category: Learning to Hack (page 2 of 2)

Learning to Hack: Command Line

Running total hack time: 17.5

Topics: Command line

Resources: Erin Call, Command Line Crash Course

Oh my god, Command Line Crash Course. Ya’ll. If you are not already a command line wiz, go check this out. It’s awesome. Just go read through it. You will not be sorry.
I’ve been talking to Erin over the last few days about command line and Git, and she’s set me straight on some things. I’ve been treating Git and the command line in general as if they are interchangeable, and they most certainly are not. She also took a look at my Totally Informal Command Dictionary, so for this very moment, it is somewhat accurate. Yay! And I only had one incredibly embarrassing and glaring error! I have now been disabused of the idea that -m when using git commit means “master.” It in fact means “message,” which makes sense if I had stopped and thought about it. Committing makes changes to the working branch, so -m couldn’t really mean master. Now, that was not at all my only error, just the most glaring one.
She showed me how pipe is useful, which I was somewhat murky on. I knew it took the output of whatever was before the pipe and used it as the input for the next command after the pipe, but I wasn’t really sure what that could do. She showed me how:
$ cat <really long file>
prints a super long and unwieldy result. She explained that the “tail” command prints the last ten lines of whatever its input is, so:
$ cat <really long file> | tail
creates the former output, then carries it over to tail, so it ends up only outputting the last ten lines, making things much more easily manageable. Nice!

I’ve also been reading up on some of the terms used in the constellation of things to know about the command line, trying to get a clearer image in my head of what all these things are (bash, vim, nano, Git, csh, and on and on…). Once I have a more solid picture, I’ll explain it all here!

Learning to Hack: Mac Update

It’s been a few more days, and quite a few more hours of hacking since the last time I talked about trying to understand my new Mac I’ve learned some tips and tricks that have eased the transition considerably, and have made my experience much better.

Tip 1: Command+space bar brings up a search bar that will search the index of all your files and applications. Kind of like Launcy, if you’re familiar. If not, also similar to the Windows start menu search function. It’s pretty neat.
Tip 2: Open your Finder. See all the default links on the left? With the exception of the “All Files” and “Applications” links, these are folders in your User folder. So, /Users/shawnacscott/documents is the file path for that “Documents” link. I’ve found that using the column view (the third option from the left at the top) shows a much more analogous-to-Windows view of the file structure. I found reading through this discussion of how someone coming from Windows to Mac can understand Finder very helpful.
Also, the one area where I will say unequivocally, and without remorse of any kind that Macs perform better than Windows machines is in battery life. When I got this laptop, the friend who gave it to me apologized for the measly four hours of battery life. Four hours of battery life has never been a thing to complain about, in my opinion. If any of my Windows laptops had had four hours of battery life, even out of the box, I would have been thrilled beyond words. So, good on you, Apple. Your batteries are sweet.

Learning to Hack: Linux Installation

Running total hack time: 14

Topics: Linux installation, command line

Resources: Ubuntu, Tina Hinojosa

There’s not a whole lot to report here, but I FINALLY GOT UBUNTU INSTALLED! This had become the never-ending saga. It took me three tries to get a successful install. I had gotten an Xubuntu 12.04 install disk from Free Geek, but the install they distribute is apparently their own version that they have set up for their purposes. I’m not sure what exactly the problem was, but it seems there was some issue with the display manager. So, after partitioning my drive and installing, repartitioning my drive and reinstalling, I decided to just make a clean install disk. I checked out DistroWatch’s “search” function, which allowed me to search for options better for beginners to Linux. I had planned on installing Mint, but I had only brought a CD and the install was just slightly too large. So, Ubuntu it is!

Some notes about partitioning. I set my partitions up to have a root (/) partition, which allows me to install a new version of Linux onto that partition later if I want without disrupting my file system. Neat! Mostly, I just googled around til I found some decent instructions on how to partition my disk, but you don’t have to do that. Both of the installs I used had the option to automatically partition your drive correctly, and allow the system to dual boot. It was honestly really easy. If you are a Windows user and want to learn to program, setting up your system to dual boot Linux is probably the cheapest and easiest way to get yourself up and running. I chose to find a way to get a Mac because I was looking at applying to a program that required you to have one. If you can avoid it, though, there is no reason you can’t use Linux. All it will cost you is a blank CD.

Learning to Hack: Git

Running total hack time: 6 hours

Topics: Git, command line, version control, vim, nano
Today I finally stopped puttering around and got down to some real learning of important skills. I’ve mostly finished setting up my new computer in a way that makes sense––downloading all the programs I need, tweaking settings and visuals and such. By now, I’ve also managed to not be completely baffled by gestures, and the ridiculous procedure necessary to install anything on this thing. So! Off to hacking I went!
I worked mostly on Git Immersion and I found it to be pretty helpful. I’m not super far into it, only to Lab 11, but I’ve already begun to clarify some concepts that have been floating around my brain without any tangible connection. Sure, I’d heard of all these commands. Doesn’t mean I really remembered which was which and what they did. I do think that this tutorial falls into the all-too-common trap of starting at an intermediate level when it purports to be for beginners. I’m sorry, but if you expect me to create a file from the command line, you might want to tell me how to accomplish such a thing. Maybe I just need to spend some hacking time working on my psychic abilities.
I found Git Ref to be much more accessible in that regard. It actually told you all of the necessary commands, instead of just most of them. It’s less interactive, though, so I felt the need to make challenges and experiments up for myself as I went along. Both Git Immersion and Git Ref follow a similar trajectory, though, so continuing to alternate between them every little bit seems like a solid strategy going forward.

I’m going to start keeping track of the commands I learn. Here’s my Totally Informal Command Dictionary if you’d like to take a peek. Just kind of define them for myself at my current level of knowledge. Plus, since Google Drive has automatic version control on its docs, I’ll be able to see how my understanding has evolved over time. Pretty exciting stuff! I’m sure I’ll get them wrong, or miss some huge part of the true power of a command, but hey, that’s how we learn, right?

Committing to the Journey

I’ve been fiddling around with learning to program for about a year now. I’ve worked played around with MIT Open CourseWare and it’s offspring, the edX 6.00x course. I’ve gone to Women Who Hack hack days, briefly glanced at Codecademy, attended an Intro to Web Development weekend-long bootcamp, joined Code Scouts, and played with Team Treehouse. But until now, it’s always been on-and-off. I’d go weeks at a time never talking about or touching anything related to programming. I’d work diligently for a while, then give up in distraction or despair. Now, I’ve gotten to the tipping point. It’s put up or shut up time.

So, in order to both keep myself accountable, and to record my journey from noob to (hopefully!) fully-fledged programmer, I’m writing this blog. I’ll be keeping track of what I’m learning [UPDATE: like my Totally Informal Command Dictionary!], what resources I’m using to do so, and my running total hack time from this point forward. This is primarily a resource for me, but feel free to follow along. Maybe you’ll find inspiration (or at least commiseration!) along with me!

Learning to Hack: Mac

Running total hack time: 4 hours

Topics: OS X, Git, version control

Resources: Playing around with settings, Getting Started with Version Control and Git

Today was my first day really playing around with my new 2009 MacBook Pro. And I have to say, it has some pros and cons.
Most of the developers I know use OS X, and tout its benefits consistently. I’ve often had gentle fun poked at my Windows machine. I gotta say, though. Ya’ll. Macs don’t make that much more sense than Windows. You’re just used to them.
Can we talk about applications for a second? Why in the world does it make sense to download a .dmg file, drag it to applications, open a .pkg, then do some other fancy stuff to install things? Then, unmount the “drive” that it creates when you do all that? What? Sorry, but Windows, with its download-.exe-file-then-setup-wizard has definitely got this beat for ease of use. And don’t get me started on downloading browser plugins. I’m still not sure I’ve accomplished that correctly.
Also, file system. Finder is the strangest, wonkiest thing I’ve used in a while. It is not at ALL intuitive. The “All Files” view sorts things by some arbitrary type value to put into categories that don’t make much sense to me.

Gestures are pretty cool. I’m definitely loving the multiple workspaces, the two finger scrolling, zooming out with three fingers, etc. And the dock is not awful now that I’ve figured out how to make it hide automatically and moved it to the side of the screen. We’ll see how much of my irritation at feeling like it’s necessary to switch to OS X persists as I get used to it.

EDIT: Check out my update on getting used to my Mac!