Literally about





hi honey

i have an internets problem and thought you might know what i’m doing wrong/need to do


we can try



ok, so, i have a blog at


i used nerdy, opinionated hosting that might be too nerdy for me

the problem is that only the main page is using the domain name





if you click one of the two existing entries…


1. there’s a webserver

the webserver might be listening to any number of configured parameters

such as the system’s hostname

the configured virtual host

(= different name, same IP)

many other options exist

and it could be feeding that undesired hostname to wordpress


2. wordpress’s config is using that same flawed logic

did you install wp yourself?


well, i wanted to, but i had problems with that too, so… no. yeah, no


well, how is it running?

preconfigured? somebody else did it?

cpanel? manual setup?


someone else did it


basically how do we get at the config


i think it’s manual set up



got shell access?


i log in here: [link]

i’m not sure what shell access is


shell access = command line




(the answer is no )


want to log in as me, or want a screen shot of what i see on there?


(or maybe, “possibly, but i didn’t use it” )


we can do skype screen sharing

i’d rather you do it


good, yes


so to recap:

1. we need to figure which system is confused

if it’s the web app (wordpress)

or if it’s the webserver

2. we need to find out how to fix it




right now your domain just points at the IP, right?


where should i look first


as an alias?


i don’t know


let’s find out

which operating system are you on?


the domain is using the free name servers at the registrar…

windows xp


start -> run -> cmd

open up a command line



run nslookup on your domain



do i put that in the command line or click link?



click the link

it’s the description of how to use nslookup on windows

it’s different from what I’d use on mac/linux

anyway, what I get is: 1319 IN CNAME

which means the host ‘www’ under the domain ‘’ is considered to be an alias to the host ‘cuina’ under ‘’

so that sounds right


i’m going to read that three more times


take your time

anyway, when the browser connects to

it looks that up

and then it has to look up

and finally it has an IP

so it connects to that IP

and then it says to it:

gimme the page so and so, from the host







so the webserver is a computer

actually any one of three computers: 3119 IN A 3119 IN A 3119 IN A

which probably host a number of sites


= shared hosting/same server with others?






so the webserver has to at least know about your domain to make any sense of stuff

because at the time that it is deciding what to serve, it’s got two bits of information:

1. what are all the available sites on the computer

2. what is the host that the user typed into the URL box

(in this case, not


my little sister is in the same room so be nice


[13:20:38] *** Call from Yuval ***

[13:21:11] Yuval: you there?

[13:21:16] Tiffany: when have i not been nice ;)

[13:21:23] Yuval: screen share!

[13:21:28] Tiffany: i’m looking!

[13:21:42] Yuval: it’s in the button that’s like a box with an arrow sticking out on my skype

[13:22:02] Yuval: ok

[13:22:33] Yuval: so that’s probably what’s making the webserver figure out that is the same site as

[13:22:39] Yuval: scroll down

[13:23:03] Yuval: look on the tooltip next to “canonical host”

[13:23:18] Yuval: yes

[13:23:21] Yuval: sorry

[13:24:04] Yuval: ok, so that’s one way to fix it

[13:24:07] Yuval: sort of

[13:24:18] Tiffany: change it to soft or hard?

[13:24:21] Yuval: let’s leave it for now

[13:24:30] Yuval: and figure out if wordpress is generating links in a confused way

[13:24:35] Yuval: this will let us work around the issue

[13:24:38] Tiffany: ok

[13:24:40] Yuval: so go back to the config

[13:25:01] Yuval: where is the wordpress stuff?

[13:25:15] Yuval: ah, go into the wp admin

[13:25:18] Yuval: settings

[13:25:32] Yuval: i’ve never seen this so bear with me ;)

[13:25:35] Yuval: here we go

[13:25:37] Tiffany: ok :)

[13:25:43] Yuval: yep

[13:25:46] Yuval: oh

[13:25:46] Tiffany: i tried changing this a couple of times and it wouldn’t let me

[13:25:54] Yuval: wouldn’t let = didn’t stick?

[13:25:58] Tiffany: or that

[13:25:59] Yuval: or wouldn’t save?

[13:26:06] Tiffany: i think maybe both?

[13:26:29] Yuval: try it again

[13:26:34] Yuval: click save, and let’s see what the fail is

[13:26:46] Tiffany: type in both of those boxes?

[13:26:51] Yuval: yep

[13:26:53] Yuval: with the http and everything

[13:26:55] Tiffany: k

[13:27:34] Yuval: aha

[13:27:42] Yuval: ok

[13:27:48] Tiffany: less of an aha moment for me ;)

[13:27:51] Yuval: so basically the wp admin stuff can’t edit the configuration file

[13:27:56] Tiffany: oh!

[13:28:01] Yuval: because it’s running under some safe mode

[13:28:16] Tiffany: yes, i think i found something about this reading a lot of webpages that i couldn’t quite follow

[13:28:23] Tiffany: i also downloaded a 900-page book

[13:28:25] Yuval: hh

[13:28:25] Tiffany: :/

[13:28:26] Yuval: heh

[13:28:31] Yuval: ok, so let’s poke around more

[13:28:34] Tiffany: ok

[13:28:36] Yuval: and figure out how the person installed wp

[13:28:42] Yuval: and modify the settings ourselves

[13:28:47] Yuval: without wp-admin

[13:28:51] Yuval: and leave fixing wp-admin to some other time

[13:29:00] Tiffany: ok

[13:31:06] *** Call ended, duration 10:28 ***


skype has frozen

i think i also need another pc



kill it

but you see where it says ssh/sftp?

that means you have shell access

= you can get a login terminal on the host

so while you’re fixing skype

download PuTTY

it’s an ssh client for windaz


ok, i’m there, but do i just download putty.exe?


i think so

bewilderingly nerdy



first putty.exe


wait, i did this one: Windows installer for everything except PuTTYtel




at any rate, you should be able to open putty eventually

and using the info on the website

log in with ssh

and get a working command line terminal from the remote site


a ver

i have a dialogue that says i have no way of knowing the server is the computer i think it is

connect anyway, right?



you could try to verify the key somehow

maybe it’s on the website


it says something about rsa2 key fingerprint



basically the theory is:

ssh is encrypted with public keys

you can use this to verify that the server you are connecting to really is the server you mean to connect to

for example, if you call them up and ask them to read the server fingerprint to you

that way you can be sure that nobody hijacked your internets

and lied to your server

erm, lied to your computer

so as to make it connect to some other computer, thinking it’s the one you wanted to connect to

if you want to verify it

i can connect to it

which gives a bit more of an assurance


i think it’s ok


if we both get the same fingerprint

but yeah, that’s basically what it boils down to

the chance that somebody would actually do that is *TINY*


i logged into it and have a black box that i accidentally typed ^c into several times







[13:45:44] *** Call to Yuval, no answer. ***

[13:45:53] *** Call to Yuval ***

[13:46:13] Yuval: type ‘ls’

[13:46:16] Yuval: or ls -l

[13:46:35] Yuval: ok

[13:46:50] Yuval: so that’s the wordpress crap

[13:46:54] Yuval: in your ‘public’ folder

[13:47:03] Yuval: public = i guess the contents of the website

[13:47:20] Yuval: cd ..

[13:47:21] Yuval: ls -l

[13:47:31] Tiffany: cd?

[13:47:36] Yuval: cd = change dir

[13:47:45] Yuval: cd ..

[13:47:49] Yuval: that means go to the parent directory

[13:48:01] Tiffany: did i do it?

[13:48:07] Yuval: no, you only did ls -l

[13:48:09] Yuval: in the same dir

[13:48:20] Yuval: you can also do ls -l ..

[13:48:36] Yuval: you need the two dots

[13:48:42] Yuval: ‘..’ means the dir one up from this one

[13:48:54] Yuval: cd with no arguments sends you to your home directory

[13:48:59] Yuval: (which is where you are right now)

[13:49:01] Yuval: cd space ..

[13:49:18] Yuval: now type ls

[13:49:26] Yuval: ok

[13:49:37] Yuval: so it looks like they configured it so that there are several directories under /home

[13:49:45] Yuval: go back into public

[13:49:47] Yuval: cd public

[13:50:08] Yuval: and now type ‘nano wp-settings.php’

[13:50:13] Tiffany: oh! that’s a washing machine

[13:50:18] Yuval: yep

[13:50:19] Yuval: heh

[13:50:22] Yuval: i forgot there’s sound

[13:50:33] Yuval: you can type wp-set<tab>

[13:50:37] Yuval: and it will complete the filename

[13:50:38] Yuval: very useful

[13:50:55] Tiffany: tab as in hit tab key?

[13:50:57] Yuval: yep

[13:51:02] Yuval: so, scroll down

[13:51:07] Yuval: let’s find the hostname

[13:51:12] Yuval: use the arrow keys

[13:51:44] Tiffany: erm…

[13:51:59] Yuval: ctrl + y or ctrl + v = next/prev page

[13:52:08] Yuval: keep going till we see something useful

[13:53:07] Yuval: actually

[13:53:28] Yuval: let’s make sure it’s in here



ok, so type ctrl + x to exit nano



[13:53:44] Tiffany: “piece of shit” :D

[13:53:49] Yuval: skype is freezing

[13:54:17] Tiffany: i don’t know if it’s me or you–my internet’s pretty crappy

[13:54:34] *** Call ended, duration 08:41 ***


skype crashed

and then type:


god yes

asshole machines


i’m cuina home public again


so let’s search the file

grep cuina wp-set<tab>

this will tell the program grep (which searches files for text) to earch for the the string ‘cuina’ inside the file wp-settings.php


it ate that and said cuina home public again


that means it’s not in there

so let’s type ‘grep -r cuina .’

that means recursive search (= all files in a directory)

and . means the current directory


space period?



so it will search all the files


arguments are separated by spaces

we have 3 arguments

1 is an option

one is what to search for

and the third is where to search for it


[13:58:05] Yuval: skype is crappy

[13:58:06] *** Call from Yuval ***

[13:58:11] Yuval: it shouldn’t crash just because internets suck a bit

[13:58:28] Tiffany: it’s all made of magic

[13:59:16] Yuval: ok

[13:59:22] Yuval: what’s your domain name again?

[13:59:31] Tiffany:

[13:59:53] Yuval: so it should have found it if it was here =)

[14:00:04] Tiffany: ah

[14:00:07] Tiffany: and hasn’t?

[14:00:19] Yuval: it found stuff

[14:00:22] Yuval: in wp-config.php

[14:00:27] Yuval: but only relating to the database

[14:00:31] Yuval: not to the hostname

[14:00:41] Yuval: you can do grep -r -C5 cuina .

[14:00:47] Yuval: that will give you 5 lines of context

[14:01:25] Yuval: see? that stuff has to do mostly with the database fields

[14:01:40] Yuval: anyway, looks like wp-config is where we want to edit

[14:01:43] Yuval: and that nothing is configured

[14:01:51] Yuval: (and wp-admin just showed what the webserver gave it)

[14:02:01] Yuval: or the other explanation is that this field is configured somewhere else

[14:02:09] Yuval: so let’s nano wp-config.php

[14:02:41] Yuval: (typical programmer naming… wp-config.php and wp-settings.php, one contains the settings (wp-config) and the other sets them up)

[14:02:51] Yuval: scroll down

[14:03:03] Tiffany: i’d never have figured it out to be that clear

[14:03:24] Yuval: well, i have quite a bit of experience dealing with the shortsightedness of programmers

[14:03:31] Yuval: both others’ and my own

[14:03:45] Yuval: keep scrolling down, this is not yet relevant btw

[14:03:58] Yuval: oops, too much

[14:04:07] Yuval: ok

[14:04:20] Yuval: doesn’t look like this file is relevant

[14:04:24] Tiffany: ok

[14:04:27] Yuval: let’s go back into the wp-admin settings

[14:04:38] Yuval: and figure out what they call that field

[14:04:45] Yuval: site address / url

[14:04:48] Yuval: so let’s grep for that

[14:05:02] Yuval: grep -r -i “site address” .

[14:05:07] Yuval: ctrl + x to exit nano

[14:05:33] Tiffany: n for no, yes?

[14:05:36] Yuval: the -i option to grep tells it to do a case insensitive search, so it will also find “Site Address”

[14:05:37] Yuval: no

[14:05:43] Yuval: we don’t want to save anything, we didn’t change anything

[14:05:50] Yuval: (intentionally)

[14:06:13] Tiffany: then y for yes?

[14:06:24] Yuval: yes = save changes, that’s not what we want

[14:06:36] Tiffany: no = not save

[14:06:38] Yuval: correct

[14:06:39] Tiffany: good

[14:06:57] Yuval: grep -r -i “site address” .

[14:07:07] Yuval: quotes let you put a space in an argument

[14:07:30] Yuval: no, the actual string “site address”

[14:07:34] Tiffany: oh

[14:07:47] Yuval: oh

[14:07:50] Yuval: throw in -C 5 in there

[14:07:57] Yuval: so we can see the text around it

[14:08:02] Yuval: and “site address”, with a space

[14:08:46] Yuval: “siteaddress” => “site address”

[14:08:51] Yuval: you can press up arrow

[14:08:53] Yuval: to get the last command

[14:09:36] Yuval: eep, it got all the svn stuff… that’s going to be annoying (lots of duplicate matches)

[14:09:40] Yuval: type up arrow

[14:09:46] Yuval: then type “| less”

[14:09:51] Yuval: that will rerun the same command

[14:10:02] Yuval: but send the output into a program that makes it easy to read/scroll

[14:10:20] Yuval: (less is that program… it’s a pun)

[14:10:36] Yuval: ok

[14:10:44] Yuval: so it looks like the name of the field is ‘siteurl’

[14:10:51] Yuval: based on the text matches i see above

[14:11:10] Tiffany: hmmk

[14:11:15] Yuval: type q

[14:11:17] Yuval: to exit less

[14:11:26] Yuval: now grep -r siteurl .

[14:12:01] Yuval: grep -rl siteurl

[14:12:09] Yuval: -l means only list files, don’t display output

[14:12:38] Yuval: (btw, i’m doing this the long investigative way so that you get used to playing with the command line… we can probably google, but these skills will let you use linux)

[14:12:39] Yuval: oh

[14:12:40] Yuval: sorry

[14:12:41] Yuval: ctrl + c

[14:12:48] Yuval: and add ‘.’ to the previous command

[14:12:51] Tiffany: linux!!

[14:13:00] Yuval: grep is searching for ‘siteurl’, but we forgot to tell it where to search

[14:13:07] Yuval: you can use up arrow

[14:13:26] Yuval: ok, so these are all the files that contain that text

[14:13:30] Yuval: let’s filter out the ones we don’t care about

[14:13:39] Yuval: grep -rl siteurl . | grep -v .svn

[14:13:51] Yuval: this will send the output of grep -rl siteurl . into another instance of grep

[14:13:58] Yuval: which will match the text .svn

[14:14:01] Yuval: and then -v = invert

[14:14:07] Yuval: = only print lines that don’t match

[14:14:23] Yuval: just like we sent the output of grep into less

[14:14:26] Yuval: we can send the output of grep into grep =)

[14:14:59] Yuval: let’s poke in wp-admin/options.php

[14:15:22] Tiffany: is that a puppy?

[14:15:29] Yuval: no, still the washing machine

[14:16:01] Yuval: this won’t work because wp-admin/options.php is not a command, it’s a file

[14:16:11] Yuval: nano = a program to edit files

[14:16:17] Tiffany: i didn’t press enter because i had a feeling i was doing it wrong

[14:16:24] Yuval: you can also use less, btw

[14:16:28] Yuval: to only view, not to edit the file

[14:16:37] Tiffany: | less?

[14:16:42] Yuval: nope

[14:16:45] Yuval: less wp-admin/options.php

[14:16:50] Yuval: less can either take an argument or a filename

[14:17:01] Tiffany: at least i follow instructions ok-ish ;)

[14:17:14] Yuval: i will explain pipes in a bit more detail in a second

[14:17:23] Yuval: now that you’ve seen some examples it will make more sense

[14:17:26] Yuval: so type ctrl + a

[14:17:31] Yuval: then type ‘less ‘

[14:17:37] Yuval: no, literally, ctrl + a

[14:17:39] Yuval: not select all

[14:17:51] Yuval: no worries

[14:18:05] Yuval: eep

[14:18:08] Yuval: sorry

[14:18:11] Yuval: i’m confusing

[14:18:16] Tiffany: :D

[14:18:20] Tiffany: aix

[14:18:22] Yuval: ctrl + a would move the cursor

[14:18:37] Yuval: so that would have saved you bunch of typing

[14:18:42] Yuval: less wp-admin/options.php

[14:18:49] Yuval: tab

[14:18:56] Yuval: o<tab>

[14:19:07] Yuval: you’re not being lazy enough ;)

[14:19:19] Tiffany: i tried but it didn’t type

[14:19:24] Yuval: oh… strange

[14:19:38] Yuval: ok, well, this doesn’t look like a file containing options

[14:19:44] Yuval: but rather a bit of the admin that manages options

[14:19:45] Yuval: anyway

[14:19:51] Yuval: i cheated a few minutes ago

[14:19:51] Yuval:

[14:20:07] Tiffany: cheater

[14:20:54] Yuval: well, we were on the right track =)

[14:20:59] Yuval: anyway

[14:21:08] Yuval: let’s nano wp-config.php

[14:21:33] Yuval: and define(‘WP_HOME’, “http://www.lacuinagr<fatty in spanish>.com”)

[14:21:47] Yuval: q to exit less

[14:22:09] Yuval: before MySQL settings

[14:22:17] Yuval: type a few enters to make some empty lines

[14:22:26] Yuval: mouse won’t work

[14:22:38] Yuval: ssh only knows how to send text

[14:22:50] Yuval: and now you can add a new section

[14:23:06] Yuval: maybe add /* added by tiffany to fix hostname, on 2012-03-04 */

[14:23:12] Yuval: just to keep track of things

[14:23:19] Tiffany: before or after?

[14:23:29] Yuval: that way if you grep -r ‘tiffany’ you can see all the changes you made, and remember more or less why you did them

[14:23:31] Yuval: it doesn’t matter

[14:23:33] Yuval: it’s just a comment

[14:23:41] Yuval: anything between /* …. */ is ignored by the program

[14:24:10] Yuval: what does guarra mean?

[14:24:17] Yuval: i confused it with gordo i think

[14:24:27] Tiffany: guarra means… nasty

[14:24:27] Yuval: ah

[14:24:30] Yuval: heh

[14:24:31] Tiffany: but it also means

[14:24:45] Tiffany: like if someone’s a guarro or guarra it also has sexual connotations

[14:24:51] Tiffany: it’s like the filthy kitchen

[14:24:56] Yuval: *nod*

[14:25:03] Yuval: i should have guessed ;)

[14:25:16] Yuval: define(‘WP_SITE’, “…

[14:25:36] Yuval: btw, the text could be anything that makes sense to you

[14:25:45] Yuval: if ‘fix hostname’ doesn’t make sense

[14:25:48] Yuval: make it make sense ;)

[14:25:59] Tiffany: well, it does since that’s what you said ;)

[14:26:03] Yuval: fairynuff

[14:26:18] Tiffany: does that look ok/do i hit enter?

[14:26:19] Yuval: also add define(‘WP_SITE”, “http://…”)

[14:26:49] Yuval: maybe “to fix hostname in links on the site”

[14:27:33] Yuval: also, i would keep them bunched together

[14:27:40] Yuval: because the comment applies to both

[14:27:54] Yuval: you can do ctrl a to move to the begining of the line

[14:28:00] Yuval: then control + k to delete a line

[14:28:05] Yuval: (kind of like ctrl + x on windows)

[14:28:10] Yuval: and then ctrl + u to paste it back

[14:28:11] Yuval: elsewhere

[14:28:16] Yuval: so you can move the comment before the text

[14:28:21] Yuval: to keep it consistent with the rest of the file

[14:28:31] Yuval: and have the two defines on the same line right below

[14:28:36] Yuval: or whatever makes sense to you

[14:29:05] Yuval: ok

[14:29:09] Yuval: so just delete that extra slash

[14:29:15] Yuval: otherwise we’ll have syntax errors

[14:29:19] Yuval: and add trailing semicolons

[14:29:51] Yuval: (at the end of each line starting with ‘define)

[14:29:56] Tiffany: lol @ whatever makes sense to you

[14:30:03] Yuval: seriously, it needs to make sense to you

[14:30:07] Yuval: it’s your site

[14:30:19] Yuval: the comments are there to help you remember wtf this nonsense is for

[14:30:41] Tiffany: [14:29] Yuval:


<<< so just delete that extra slash

otherwise we’ll have syntax errors

and add trailing semicolons

(at the end of each line starting with ‘define)

[14:31:07] Tiffany: i’m half kidding; i think i somewhat fathom what those things say

[14:31:15] Tiffany: which is the extra slash?

[14:31:23] Yuval: the extra slash was what you started typing to get the second comment

[14:31:31] Yuval: i didn’t know at the time ;)

[14:31:32] Yuval: i thought it was a typo

[14:31:42] Tiffany: /* ?

[14:31:43] Yuval: btw, the first comment is completely useless

[14:32:15] Yuval: before you started the second “added by tiffany” comment you only had a slash on its own line in the file

[14:32:17] Yuval: i thought it was a typo

[14:32:26] Tiffany: oh

[14:32:31] Tiffany: and it’s gone now?

[14:32:37] Yuval: well, you added more stuff after it

[14:32:40] Tiffany: ok

[14:32:42] Tiffany: :)

[14:32:43] Yuval: that made it into a comment

[14:32:53] Yuval: anyway, we still need a ; at the end of each ‘define’ line

[14:33:05] Yuval: and probably best to delete the first of the two comments, it’s not helpful

[14:33:32] Yuval: ctrl a ctrl k

[14:33:54] Yuval: ctrl a ctrl k would have killed the whole line in 3 keystrokes =)

[14:33:58] Tiffany: :)

[14:34:03] Yuval: anymoose

[14:34:10] Yuval: ctrl O to write out the file

[14:34:12] Yuval: (== save)

[14:34:33] Tiffany:  you should see my (lack of) keyboard shortcuts in other programs

[14:34:43] Yuval: ok, i’ll let you off the hook

[14:34:53] Yuval: type enter to confirm the filename

[14:34:59] Yuval: we want to overwrite the previous file

[14:35:08] Yuval: ctrl + x

[14:35:13] Yuval: and try reloading the website

[14:36:44] Tiffany: whoa!

[14:36:56] Tiffany: did we do it?

[14:36:58] Yuval: yep

[14:37:04] Tiffany: awesome!

[14:37:07] Yuval: ok

[14:37:09] Yuval: so:

[14:37:11] Tiffany: you are <3

[14:37:23] Yuval: 1. i want you to know a little bit more about linux

[14:37:32] Yuval: 2. i want you to know how to find help resources

[14:37:36] Yuval: so

[14:37:39] Yuval: all this piping crap

[14:37:45] Yuval: unix command line is very simple

[14:37:56] Yuval: each program has what’s called standard input, standard output, standard error

[14:37:59] Yuval: they are just streams of text

[14:38:06] Yuval: so when we say ‘grep -rl tiffany .’

[14:38:19] Yuval: that tells grep to search for ‘tiffany’ in all files in the current directory

[14:38:24] Yuval: and print each file name to standard output

[14:38:32] Yuval: without any modification, standard output will just display on the screen

[14:38:46] Yuval: if we add a | afterwords

[14:38:54] Yuval: it will “pipe” the standard output into somewhere else

[14:38:58] Yuval: (the next command)

[14:39:06] Yuval: so grep -rl tiffany . | grep 2012

[14:39:19] Yuval: that sends all the filenames to the second instance of grep

[14:39:36] Yuval: which (since we only gave it a string to search for, no filenames), will filter the lines from its standard input

[14:39:44] Yuval: and print the matching ones on standard output

[14:40:00] Yuval: in this example it will probably print nothing, unless a file which contains ‘tiffany’ in its text has ’2012′ somewhere in the name

[14:40:11] Yuval: if we remove the -l option to the first grep, it will print the comment you added

[14:40:18] Yuval: because that line contains both ‘tiffany’ and ’2012′

[14:40:19] Yuval: makes sense?

[14:40:30] Tiffany: let me read a couple times again

[14:40:46] Yuval: think of | as a plumbing fixture

[14:41:53] Yuval: well

[14:41:55] Tiffany: i think i need some extremely simple tome someone has written for 4-year-olds

[14:41:57] Yuval: go back to the shell window

[14:42:06] Yuval: grep -r tiffany .

[14:42:22] Yuval: this tells the program ‘grep’

[14:42:34] Yuval: to go recursively (-r) through . (the current directory), and open every file

[14:42:42] Yuval: and then search every line of every file for the text ‘tiffany’

[14:42:53] Yuval: and if it finds that text, to print the line to standard output

[14:42:57] Yuval: which will show up on the screen

[14:43:34] Yuval: remember how we did -C 5? that just tells grep to also print the 5 lines before and 5 lines after each match

[14:43:46] Yuval: still to stdout

[14:43:51] Tiffany: stdout

[14:43:56] Yuval: stdout = standard output

[14:44:00] Tiffany: ah

[14:44:22] Tiffany: i mean, i understand that we are feeding a machine language it understands

[14:44:37] Tiffany: the rest is sort of greek

[14:44:45] Yuval: which parts?

[14:45:09] Tiffany: i mean, i guess i don’t have any sort of grounding that makes this all gel in any way

[14:45:18] Yuval: i’m trying to provide that for you

[14:45:20] Yuval: so you can keep going =)

[14:45:30] Tiffany: and i’m trying to follow ;)

[14:45:32] Yuval: ok

[14:45:32] Tiffany: oh no!

[14:45:35] Tiffany: keep going where?

[14:45:36] Tiffany: oh!

[14:45:50] Tiffany: i did want to change the permalinks, but i don’t think you do that here

[14:45:59] Yuval: keep going with linux/nfs hosting

[14:46:15] Tiffany: is this the same as using ftp but ssh instead?

[14:46:15] Yuval: no, ftp is much simpler

[14:46:24] Yuval: it’s just to send files to and from a remote computer

[14:46:31] Tiffany: i like these nfs hosting people

[14:46:39] Tiffany: i read their tutorials for days on end

[14:46:55] Yuval: ssh lets you run commands on the remote computer

[14:47:01] Tiffany: they write well but i don’t know what they’re talking about

[14:47:04] Tiffany: ok

[14:47:05] Yuval: so let’s fix that =)

[14:47:10] Tiffany: :)

[14:47:11] Yuval: so all this time

[14:47:14] Yuval: when we connected with ssh

[14:47:22] Yuval: we were talking to their computer

[14:47:26] Yuval: and telling it to run programs

[14:47:29] Yuval: like nano, less and grep

[14:47:35] Tiffany: ah

[14:47:41] Tiffany: nano and less are also programs

[14:47:44] Yuval: yes

[14:48:05] Yuval: ‘less’ is a modern version of a program called ‘more’  (because “less is more”…)

[14:48:31] Yuval: and ‘more’ was named ‘more’ because all it did was display one page of text, then “more….” and it would wait until you typed enter or space to display more

[14:48:47] Tiffany: sounds like a great program

[14:48:56] Yuval: all these programs are tiny

[14:49:11] Yuval: that’s the whole unix philosophy, each program does very little, but you can easily combine them

[14:49:25] Yuval: so for example ‘grep’ doesn’t know how to display text on the screen in an easy way

[14:49:27] Yuval: ‘less’ does that

[14:49:48] Tiffany: grep is like ‘show me’?

[14:50:01] Yuval: grep = search for text

[14:50:04] Tiffany: ok

[14:50:21] Yuval: ok

[14:50:31] Yuval: so all of these programs can be connected to each other with pipes

[14:50:39] Yuval: an basically all that happens in a pipe is like a giant copypaste

[14:50:42] Tiffany: is | the pipe?

[14:50:44] Yuval: yes

[14:50:56] Yuval: so all of the output that ‘grep’ made when it searched for stuff

[14:50:59] Yuval: one sec

[14:51:02] Tiffany: k

[14:51:04] Yuval: brb

[14:57:53] Yuval: ok, back

[14:58:01] Yuval: mom is going to spain for a conference

[14:58:04] Tiffany: ah!

[14:58:08] Yuval: flight canceled

[14:58:24] Yuval: anymoose

[14:58:27] Yuval: so grep search the files

[14:58:29] Yuval: and printed everything

[14:58:34] Yuval: and it was too much to fit on a screen

[14:58:47] Yuval: so we piped the output into the input of ‘less’

[14:58:53] Yuval: which took care of the scrolling etc

[14:58:58] Yuval: makes sense?

[14:59:21] Tiffany: yes

[14:59:33] Yuval: so here are a few more simple commands:

[14:59:35] Yuval: cat

[14:59:40] Yuval: that just opens a file and prints it

[14:59:43] Yuval: cat wp-config.php

[14:59:53] Yuval: that will dump the entire file to standard output

[15:00:08] Yuval: ‘cat wp-config.php | less’ would be almost the same as ‘less wp-config.php’

[15:00:19] Yuval: the only difference is that in the second one, less is the program that opened the file

[15:00:28] Yuval: and in the first less just read that text from its standard input

[15:01:13] Yuval: brb peepee machen

[15:01:32] Tiffany: und jetzt sprichst du auch deutsch

[15:02:36] Yuval: not really

[15:03:21] Yuval: so

[15:03:24] Tiffany: so

[15:03:27] Yuval: one more thing:

[15:03:35] Yuval: you can pipe into files

[15:03:42] Yuval: grep -r tiffany . > /tmp/results.txt

[15:03:55] Yuval: that will create a new file called ‘results.txt’ in /tmp

[15:04:07] Yuval: and all of the text from grep -r tiffany . will be saved into it

[15:04:15] Yuval: (careful, this easily overwrites files)

[15:04:34] Tiffany: so don’t hit enter?

[15:04:41] Yuval: you can ls /tmp

[15:04:48] Yuval: (ls = list files in a directory)

[15:04:58] Yuval: (it’s also a program… everything is a program =) )

[15:05:06] Yuval: type down arrow

[15:05:14] Yuval: to clear the command line

[15:05:15] Yuval: and then l /tmp

[15:05:29] Tiffany: down arrow not working

[15:05:39] Yuval: oh

[15:05:42] Yuval: ctrl +  u

[15:05:43] Yuval: that clears

[15:06:01] Yuval: up/down arrow behavior sometimes varies between different systems…

[15:06:13] Yuval: ls /tmp

[15:06:30] Yuval: so, there’s no ‘results.txt’ file in /tmp

[15:06:32] Yuval: we’re safe

[15:06:39] Tiffany: :)

[15:07:19] Yuval: grep -r tiffany . > /tmp/results.txt

[15:07:20] Yuval: !!!

[15:08:06] Yuval: ls /tmp

[15:08:09] Yuval: ls -l /tmp

[15:08:16] Yuval: -l means “long” to ls

[15:08:19] Yuval: = more information

[15:09:03] Yuval: cat /tmp/results.txt

[15:10:01] Tiffany: so if i want to change the permalinks, is the mod_rewrite thing here?

[15:10:08] Yuval: that’s a bit messy

[15:10:11] Yuval: link me

[15:10:11] Yuval: ?

[15:10:24] Tiffany:

[15:10:57] Tiffany: i tried to do it in the wordpress control panel and it gave me some code i was supposed to put in a file somewhere

[15:11:18] Yuval: .htaccess?

[15:11:29] Tiffany: a ver

[15:12:39] Yuval: ok, so go to the permalinks settings

[15:12:49] Tiffany: ok

[15:13:21] Tiffany: ok, so i want to change it to that postname one

[15:13:32] Yuval: teh-cool

[15:13:43] Tiffany: .htaccess it says

[15:13:52] Yuval: copy that text

[15:13:55] Tiffany: <IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

[15:14:03] Yuval: go back to the shell

[15:14:16] Yuval: cat > .htaccess

[15:14:17] Yuval: paste

[15:14:19] Yuval: ctrl + d

[15:14:38] Tiffany: enter before paste?

[15:14:42] Yuval: yes

[15:14:56] Yuval: cat with no arguments reads from standard input, and writes to standard output

[15:15:04] Yuval: nothing was pasted

[15:15:06] Yuval: phooey

[15:15:13] Tiffany: hmm

[15:15:15] Yuval: oh

[15:15:20] Yuval: ctrl + v doesn’t meant he same

[15:15:22] Yuval: try right click

[15:15:24] Yuval: up

[15:15:29] Yuval: to get the same command as last time

[15:15:33] Yuval: then enter

[15:15:43] Yuval: eeep

[15:15:46] Yuval: i hate when that happens

[15:15:52] Yuval: ctrl + u

[15:15:55] Tiffany: :O

[15:16:05] Yuval: cat > .htaccess

[15:16:39] Yuval: now paste like you did a second ago

[15:17:07] Yuval: (see how it’s waiting for input? that’s because “cat” is running right now… when you type ctrl + d it finishes)

[15:17:26] Tiffany: to paste is control d?

[15:17:28] Yuval: no

[15:17:34] Yuval: ctrl + d tells cat we’re done

[15:17:44] Yuval: to paste… i think right click like you did before?

[15:17:46] Yuval: or shift + insert?

[15:17:57] Yuval: type enter

[15:17:59] Yuval: to finish that last line

[15:18:04] Yuval: and then ctrl + d to close the file

[15:18:17] Yuval: cat .htaccess

[15:18:22] Yuval: to make sure it’s all in there =)

[15:18:33] Yuval: (i know it is, but it makes sense)

[15:19:02] Yuval: (it’s a good habit to verify your actions, because it’s easy to make mistakes when using command line)

[15:19:12] Tiffany: i can seriously imagine ;)

[15:19:20] Yuval: so go back to the wordpress site

[15:19:23] Yuval: let’s see if this stuck

[15:19:33] Tiffany: so i did it? why is the code saying not found above?

[15:19:34] Tiffany: ok

[15:20:24] Tiffany: yowza!!!

[15:20:49] Tiffany: thank you!!!!!!!!!!

[15:20:51] Yuval: <3

[15:20:52] Yuval: ok

[15:20:54] Yuval: so one last thing

[15:20:56] Tiffany: ok

[15:20:58] Yuval: rm /tmp/results.txt

[15:21:01] Yuval: rm = remove

[15:21:07] Yuval: rm -i

[15:21:09] Yuval: = ask me first

[15:21:13] Yuval: rm -i /tmp/results.txt

[15:21:18] Yuval: will confirm with you

[15:21:23] Yuval: good habit

[15:21:33] Yuval: (some people set up an alias, so rm always means rm -i)

[15:21:39] Yuval: (but that’s for another time)

[15:21:45] Yuval: type ‘y’ enter

[15:21:51] Yuval: tadaa

[15:21:56] Yuval: ok, so two very important things

[15:22:00] Yuval: the second item from my list

[15:22:05] Yuval: yep

[15:22:06] Tiffany: that’s the results thing we made before now deleted?

[15:22:19] Yuval: (i can see what you type before you hit enter, sorry, it’s confusing)

[15:22:23] Tiffany: lol

[15:22:26] Yuval: anyway

[15:22:30] Yuval: type grep –help

[15:22:46] Yuval: grep –help | less

[15:23:00] Yuval: (up arrow!)

[15:23:11] Tiffany: doesn’t work

[15:23:13] Yuval: oh

[15:23:18] Yuval: your arrows are all screwed =P

[15:23:26] Yuval: must be putty’s fault

[15:23:33] Yuval: there could be a way to configure it so it sends it correctly

[15:23:37] Tiffany: or windoze?

[15:23:38] Yuval: let’s not worry about that now though

[15:24:03] Yuval: i don’t remember the exact problem

[15:24:07] Yuval: anyway

[15:24:20] Yuval: so “usage: grep [OPTION] … PATTERN [FILE] …”

[15:24:22] Yuval: that means:

[15:24:38] Yuval: to use the grep command, specify ‘grep’, then you have any number of optional arguments

[15:24:47] Yuval: (anything in [] is optional, … means you can have more than one)

[15:24:54] Yuval: which modify the behavior of grep

[15:24:56] Yuval: as detailed below

[15:25:02] Yuval: and then PATTERN

[15:25:04] Yuval: which is what we’re searching for

[15:25:08] Yuval: and then an optional list of files

[15:25:36] Yuval: this convension (–help, simple usage, options, etc) is very common throughout

[15:25:41] Yuval: so for example, try rm –help

[15:25:43] Yuval: or cat –help

[15:25:47] Yuval: and you’ll see something similar

[15:26:08] Yuval: you’re in less

[15:26:12] Yuval: type ctrl + c to cancel the mark

[15:26:15] Yuval: and then q to exit less

[15:26:59] Yuval: good, this one is not very helpful ;)

[15:27:06] Yuval: so when the –help is useless

[15:27:18] Yuval: we use ‘man’

[15:27:21] Yuval: = manual

[15:27:21] Yuval: man rm

[15:27:23] Tiffany: LOL

[15:27:31] Yuval: that means ‘show me the manual’ for the ‘rm’ command

[15:27:54] Yuval: now you are a unix expert =)

[15:27:59] Tiffany: OH GOD

[15:28:08] Yuval: you know more than most sysadmins out there ;-

[15:28:09] Yuval: ;)

[15:28:19] Tiffany: can i use this chat as my about page?

[15:28:28] Yuval: heh

[15:28:41] Yuval: i would prefer you don’t, it makes me look like a pompous jerk ;)

[15:28:48] Tiffany: i can remove your name

[15:28:52] Tiffany: also, no it doesn’t

[15:28:55] Yuval: ok, unix expert ;)

[15:28:57] Tiffany: :D

[15:29:06] Yuval: anyway, play around

[15:29:13] Yuval: you can’t really damage anything too badly

[15:29:21] Tiffany: by play around you mean download books…

[15:29:27] Tiffany: i can’t?

[15:29:40] Yuval: if you’re careful and you read what’s on the screen

[15:29:48] Yuval: and you don’t do anything you don’t know the consequences of

[15:29:53] Yuval: then you’re still in control of the machine

[15:30:01] Yuval: so worst case scenario, you are stuck

[15:30:30] Yuval: (you’ll have an accident eventually, but in this particular case your blog posts are saved in mysql, so even if  you completely destroy all the wordpress files, all you need to do is reinstall it and the site will be back)

[15:30:39] Tiffany: oh

[15:31:00] Yuval: i’d be happy to help you again

[15:31:04] Tiffany: yay!!!! :D

[15:31:12] Tiffany: because oh god

[15:31:28] Tiffany: well, the next thing i want to do is set up multi blogs on the same installation

[15:31:33] Tiffany: i’m going to try to help my dad

[15:31:49] Yuval: that shouldn’t be too hard

[15:31:53] Tiffany: epublish his books and set him up blogs for him that he can write in

[15:31:56] Yuval: i’m not sure how wordpress does it

[15:32:01] Tiffany: i got a book

[15:32:02] Yuval: but basically what you need to do is:

[15:32:26] Yuval: 1. figure out what the mechanism for setting up virtual hosts is for nearly free speech

[15:32:38] Yuval: you should be able to have multiple sites per account

[15:32:53] Yuval: but the way it works varies from hosting company to company

[15:33:01] Yuval: 2. figure out how to configure wordpress with multiple virtual hosts

[15:33:15] Yuval: you might need a wordpress installation for each separate site

[15:33:26] Yuval: or there might be a way to do it with just one installation

[15:33:40] Tiffany: i think there is with just one installation

[15:34:05] Yuval: cool

[15:34:23] Yuval: i need to go now, but we do some research

[15:34:34] Yuval: figure out a plan, it’s fine if the details are shakey

[15:34:40] Yuval: and then we can go over it aagain tomorrow, to review

[15:34:52] Yuval: (or a later date)

[15:34:58] Yuval: and then work on implementing like we did this stuff

[15:35:02] Tiffany: lol, i see ‘computing for seniors’

[15:35:02] Yuval: just to review today’s stuff:

[15:35:05] Yuval: heh

[15:35:28] Yuval: 1. ssh gives you a command line prompt on the remote computer, where you can enter commands for that computer to execute for you

[15:35:44] Yuval: 2. every command is basically a series of programs, and arguments to the programs

[15:35:50] Yuval: optionally connected with pipes

[15:36:05] Yuval: (i’m grossly simplifying, it’s actually much more multifaceted, but that doesn’t matter now)

[15:36:09] Tiffany: :)

[15:36:15] Yuval: 3. to figure out how to operate a command

[15:36:18] Yuval: command –help

[15:36:19] Yuval: man command

[15:36:30] Yuval: (you can also google the second one, to view it more easily)

[15:36:49] Yuval: i would also suggest you download a live distribution of ubuntu

[15:36:58] Yuval: like a live cd or pendrive linux

[15:37:01] Yuval: and play around with it

[15:37:09] Tiffany: who me linux?

[15:37:14] Yuval: yes

[15:37:20] Tiffany: i have this virtual drive thing on my laptop

[15:37:28] Yuval: virtual box?

[15:37:33] Tiffany: i think that’s it

[15:37:37] Yuval: yeah that works too

[15:37:43] Tiffany: i put an xp installation in it

[15:37:45] Yuval: ok

[15:37:49] Yuval: so you can add another virtual machine

[15:37:52] Yuval: with ubuntu

[15:37:53] Tiffany: to use a program i couldn’t find for windows 7

[15:37:57] Tiffany: ok

[15:38:05] Yuval: that way you can play around with linux

[15:38:05] Tiffany: but what do i do with ubuntu?

[15:38:10] Yuval: do command line stuff

[15:38:13] Yuval: get comfortable

[15:38:16] Tiffany: i don’t know if i know how to play around

[15:38:23] Tiffany: but ok

[15:38:27] Yuval: try installing wordpress on your virtual machine

[15:38:46] Yuval: it’ll just be much more comfortable/efficient to play aroun on a local machine

[15:38:48] Yuval: than through ssh

[15:38:51] Yuval: you can use the mouse

[15:38:58] Yuval: you can view the files in a normal file browser

[15:39:14] Yuval: you can edit them with a comfortable editor, as opposed to nano

[15:39:22] Yuval: and focus on the details of how to futz with wordpress

[15:39:39] Yuval: it’ll help you get a lot more value out of the nfs hosting

[15:39:47] Tiffany: they’re pretty cool

[15:39:58] Tiffany: but they know stuff, like you

[15:40:00] Yuval: and i think also you will be able to understand their tutorials better now

[15:40:14] Yuval: and of course, you can always send me links to their tutorials and i can explain the parts you don’t get

[15:40:19] Yuval: a lot of this stuff is just learning a vocabulary

[15:40:27] Tiffany: <3 <3 <3

[15:40:34] Yuval: k, i gotta go now

[15:40:40] Yuval: ttyl

[15:40:43] Yuval: happy hacking =)

[15:40:43] Tiffany: ok

[15:40:46] Tiffany: lol!

[15:40:50] Tiffany: thank you <3 <3 <3

[15:40:56] Yuval: you’re welcome

[15:41:07] Yuval: just doing my bit to improve the world =)

[15:41:10] Tiffany: :)

[15:41:14] *** Call ended, duration 1:43:08 ***

One Response to “Literally about”

  1. Delores Karnish September 26, 2012 at 11:18 pm #

    This is a list of phrases, not an essay. you are incompetent

Leave a Reply

You must be logged in to post a comment.