January 30th 2017
I'm updating this piece because I still think it's a good idea that you know about these basics. I'm wondering what other tech fundamentals you want to know about that I can help you with. Let me know.
Git aliases are great once you have the Git fundamentals down.
If you already know what git pull origin master is and you spend all day typing that into your command line, you know how much faster it'll be to write
TJ Holowaychuk wrote the guide to doing this. Watch his 9 minute screencast on aliases, you might find it nutrient rich. A faster, smoother Git workflow leads to a more focused day on the command line.
Here's one of the bad code habits I had the hardest time breaking. Remembering to close what's opened while coding.
When you open
Close it with
When you open
How to break this habit?
Easy. When you open a bracket, close it. Only then do you use the backarrow key to write what goes into the now opened and closed brackets.
Of course this means backarrowing more than you might want, and doing so is annoying. What is more annoying is openings with no closings that throw up an error at compile time.
Everything that opens must be closed (unless it's a self-closing tag, obviously).
in your .vimrc folder, in the off chance you forget. If you want to just try syntax highlighting in vim, hit escape, then
Either way, a visual reminder to close what you've opened.
If you were switching off an Apple operating system and onto a Linux machine, what commands would you want to know first?
--message received from someone reading gwenbell.com
My response: If I were switching off an Apple machine and onto a Linux machine for the first time today, here's what I'd want to know.
Where the command line is located
If I didn't know where the command line was, the first thing I'd want to do is find it. Since I'm on a Linux box right now, I don't know how to unfind it. I rarely work on anything other than the command line. Last week when I was doing a big archive purge I used gnome to run through photo deletion fast, but soon as I wrapped that project up I got back to dwm (tiling window manager).
First few UNIX commands
In order from top to bottom
make directory to make a new folder
list what's in a directory
copy one thing over another (use with care -- better to use 'mv' then delete the original)
move one thing to another place
print working directory to know where you are in the file structure
I'd want to know about that.
Let's you know where you are, how your files look and how much more there is to delete.
% cat index.html
does what you'd think (cats the file, reads and then outputs the contents of the file you just cat'd to standard output), but did you know
is (probably) the oldest UNIX utility. And it's derived from
which is itself connected to
which means to connect one thing to another.
My internet connection is inconsistent, so when I'm using mutt, say, to check email, say, over SSH I'll be mid-way through responding to a message when the connection drops. Or, I'm using Profanity (an XMPP-based chat client) and don't know whether the message I sent was received, nor whether I've received the whole message that was sent this direction. That was the pain point. While reviewing Git reset docs, I ran across a developer who linked to another developer who'd written a piece on Mosh.
With mosh, I know when the connection lags because it alerts me to the fact. I also know when a message has been sent over the UDP connection and when it has not (while I'm typing and it's not yet sent, the words are underlined; once sent, the underlines disappear). It's not all that different than SSH in terms of usability, and to start using it it's
mosh username at yourdomainname.com
the same way you'd log into your server.
Upon entering the mobile shell, things look the same as SSHing in, and
reconnects you to an always-live Profanity session (if you do indeed have an always-live XMPP-based chat session, and if you detach correctly, with...
ctrl b d
For those of us already on Arch, mosh is a
sudo pacman -Syu mosh
how do I cd into Writing? what does cd mean?
-- question received via gwenbell.com
means change directory. Quick command line crash course with your UNIXy essentials.
cd change directory
cd .. go back one level
ls list contents of a directory. That and $ pwd will tell you where you are
mkdir make directory
rm -rf delete everything in a directory (use with care)
cp copy. You do
$ cp [filename] to [new location you want the file to go]
Best to use
instead and delete the original once you've moved it to its new location. Delete is permanent, it's not a trashcan icon from which you can recover later.
Edit something and now hit escape and then
to save the updates
Then hit enter.
git add layouts/index.jade
to add the file name, then
git commit -m
to add a commit message
git push origin master
git pull origin master
$ npm run build
and reload your site to see updates.
Updated: 2019-06-18 to tighten, 2019-07-29 to clean up
email · 2019