HNHacker News
TopNewBestAskShowJobs

nonamegiven

404 karma · joined January 15, 2013

submissionscomments
nonamegiven··on Tell HN: Don't stay up late commenting on HN
No, thank you.
nonamegiven··on Ask HN: how did you learn the command line?
And ...

I realized/remembered while reading the other comments that knowing what's available is a necessary part of "just use the command line a lot."

So try this, to get a good list of what's available (and for more command line composition)

  $ man -k $(ls -1 /usr/bin |egrep -v "\[") 2>&1 |egrep -v "nothing appropriate"
See if you can figure out what 2>&1 does (it's a very common idiom, probably easy to find), and figure out why it's needed here.

That's a long list of stuff, look at it a page at a time:

  $ man -k $(ls -1 /usr/bin |egrep -v "\[") 2>&1 |egrep -v "nothing appropriate" |less
That's still a lot of stuff, save it off in a file in your home directory for later:

  $ man -k $(ls -1 /usr/bin |egrep -v "\[") 2>&1 |egrep -v "nothing appropriate" > ~/wholelottacommands.txt
nonamegiven··on Ask HN: how did you learn the command line?
Me too, that's all there was. And that may be the answer: only allow yourself the command line for longer and longer periods of time. Force yourself to learn it.

I really like this book, even today: http://shop.oreilly.com/product/9780596003302.do

The key to being proficient at the command line (as distinct from writing shell scripts) is to think of it as composition.

For example, run this:

  $ file $(which $(man -k python | cut --delimiter " " --fields 1))
(The first '$' is your command line prompt, yours may differ; you don't type that. The other '$' characters you do type.)

Now run each command from the inside out, starting with the man command. See what each command does. Build it up bit by bit, that's exactly what I did, like this:

- the man command

- the man command piped into the cut command

- the man command piped into the cut command after reading "man cut" to remember about the --delimiter option

- the output of that pipeline fed to which

- the output of which fed to file

Note that I didn't use any for loops or variables, the shell did the right thing for me.

Read the man pages for each of those commands.

set -o vi or set -o emacs (or their equivalent in .inputrc) helps a lot when you compose things incrementally. esc-k k k (etc) is your friend if you set -o vi.

Read man bash. It will take you a long time. For today, read the section on READLINE. While in man bash, search for the word READLINE at the front of the line, like this:

/^READLINE

Slash = search

^ = anchor the search to the front of the line

READLINE = what you're searching for in the current man page.

For now, all you need in your ~/.inputrc file is:

set editing-mode vi

This will give you vi command line editing in bash, as well as any other program that uses readline, like the python REPL.

For more info on .inputrc,

  $ man readline
which is documentation for the C interface to readline, but is mostly about how readline is used by a user. For example, in man readline

/VI Mode bindings

gives you all your command line editing commands when you use vi mode.

Get a mostly table of contents of man bash, for your searching pleasure:

  $ man -P cat bash |egrep -v "^ " |egrep -o "^[^ ]+"
Sort it:

  $ man -P cat bash |egrep -v "^ " |egrep -o "^[^ ]+" |sort
nonamegiven··on Learning to code, with no Internet access.
Bring a few thumb drives for backup.

In addition to LPTHW and dbond's very complete suggestions:

$ sudo apt-get install python-doc

This is not installed by default. It will install the entire python.org documentation site, probably at /usr/share/doc/python/html/index.html

Decide whether you want to use python2 or python3. Python 2.7 is probably what's installed by default on your linux distro (unless you use Arch). The following is not in the installed docs, it's an external site:

http://wiki.python.org/moin/Python2orPython3

Read PEP 8

http://www.python.org/dev/peps/pep-0008/

$ aptitude search python |grep framework

Pick a lightweight framework or two to install before you leave (unless you've packaged up the repository as dbond suggests). bottle, flask and pyramid come to mind. When in doubt, install it. Don't start off using a framework though, learn the basics of plain html, then css, then javascript, then a lightweight framework (or the framework first then javascript).

$ sudo apt-get install sqlite3

Install a database. sqlite is lightweight and more than good enough for learning, and won't bog you down with learning how to run a database server. Alligators and swamps ...

I wouldn't bother installing a web server, python comes with a rudimentary web server module.

General background on python web programming: (skim it)

file:///usr/share/doc/python/html/howto/webservers.html

The module you'll likely use to play around:

file:///usr/share/doc/python/html/library/simplehttpserver.html

Learn the python debugger, it's rudimentary but very helpful when you're learning.

file:///usr/share/doc/python2.7/html/library/pdb.html

Learn the python REPL, or the interpreter as they call it in the docs.

file:///usr/share/doc/python2.7/html/tutorial/interpreter.html

Install, learn and use a better python REPL:

sudo apt-get install ipython

If you can afford it, Oreilly has some good ebooks.

http://oreilly.com/python/

http://search.oreilly.com/?q=html

http://search.oreilly.com/?q=css

http://search.oreilly.com/?q=javascript

http://shop.oreilly.com/product/9780596805531.do

http://shop.oreilly.com/product/9780596517748.do

If you can't afford it, but you can afford the weight, search for books you like on AbeBooks: (used or internation edition books)

http://www.abebooks.com/

Dive Into Python is available online and downloadable: http://www.diveintopython.net/

Eventually you'll want to know more about sql: http://news.ycombinator.com/item?id=5087439

Learn you a shell:

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

http://www.tldp.org/LDP/abs/html/

Install vim and emacs and decide which one you like, but any simple arrow-key-based editor that comes with your desktop is good enough to get started.

Install git, eventually you'll lose some work and you'll see the light. Just go real basic with git if you haven't done much source control before. Don't get bogged down in learning git, you want to learn python and web programming. As you go, you'll eventually want to know more; you'll know when that is.

$ sudo apt-get install git

http://git-scm.com/

http://jk.gs/everyday.html

Appropriate first web projects would be any of the example projects that come with the lightweight framework docs.

Appropriate first python-specific projects would be the same, in whatever python tutorials you like.

Appropriate next projects would be whatever catches your interest as you're going through all of the above. Keep a notebook/file of project ideas. Actually that would be a nice first project right there, a simple web app for a project notebook.

EDIT: Also, learn to rely on the man pages.

$ man man

$ man bash

$ man python

$ man -k python

$ man woman

No manual entry for woman

nonamegiven··on EA Employee Chastises Company Over SimCity in Public Letter
I have no doubt that mission statements are real at some companies, and that they influence results in a positive way.

After making my comment, I made a short search, and posted this: Sex, Lies and Mission Statements. http://news.ycombinator.com/item?id=5352298

It's from 1997. Things may have improved, I don't follow HR research. But it's at least a description of how things can go wrong, and probably still do.

Summary: Most managers report that their company's mission statement is ineffective, and many report that it's counter productive. Employee involvement in creating the mission statement is correlated with positive influence on behavior, yet that involvement is rare. Free coffee cups for everyone!

nonamegiven··on Former TSA screener says the job does little to keep fliers safe
There are 14,000 TSA screeners at Newark Airport alone. (It's in the text in the image of the patdown.)
nonamegiven··on EA Employee Chastises Company Over SimCity in Public Letter
That's so cute. As if anyone at the C level believes in a company's mission statement and values. They're just there so the coffee cups aren't plain white.
nonamegiven··on [dead]
Maybe he means java.lang.Runnable.
nonamegiven··on Ask HN: What is your personal website setup?
Linode, nginx, uwsgi, django, postgresql. It's for a vanity site that no one reads, and one thing I like is that the whole stack hardly uses any resources when nothing's happening.

I do site admin with key based ssh/scp and nothing else. The key has a passphrase, and my Ubuntu desktop manages the passphrase nicely.

I don't like that I tried to leverage django's out of the box admin module too heavily; I should have written (or reused?) a small app for site management.

I'll be moving to a lightweight python framework, like bottle or flask, for the next incarnation. The framework will manage creation of static content (posts and comments) and everything will be served as static as much as possible.

nonamegiven··on Mark Shuttleworth: Canonical leads Ubuntu, not 'your whims'
Linux Mint: it's an Ubuntu derivative, and I suspect that Ubuntu/Canonical will one day either be hostile or at least actively unhelpful to derivatives.

Downloads: http://www.linuxmint.com/oldreleases.php

Everything there is an ubuntu derivative, except in the middle there's a debian rolling release edition.

I suppose the mainstream ubuntu derivative will be great for stereotypical "mom's", as long as Ubuntu's eye doesn't turn in that direction.

For more hacker types that want some creature comforts, are the debian versions a good choice? I would expect/hope that some of the multimedia "just works" benefits would be in there. http://www.linuxmint.com/release.php?id=14

Or would I be better off on debian/LXDE, and manage the few packages that I most care about on my own?

nonamegiven··on Mark Shuttleworth: Canonical leads Ubuntu, not 'your whims'
Ubuntu used to be one thing, and it was exactly what I wanted.

Now they're something else, and that's OK, but it's not what I want, and that's OK too.

At the moment I'm hanging on to the parts I want by my fingernails, running the nicely minimal Lubuntu. But I think the writing's on the wall that eventually Ubuntu/Canonical will have no interest in supporting the various Ubuntu derivatives, and I'll need to fall back to something like LXDE on Debian. And that's OK too.

Ubuntu used to be one thing. Now they're something else. That's OK. So long, and thanks for all the updates.

nonamegiven··on Ask HN: Who is in charge of the open source letter?
have you searched your browser history?
nonamegiven··on Unix tricks
Duly noted. :)
nonamegiven··on SimCity Burning: A Warning to Publishers on The Dangers of Always-Online DRM
This is like the "good old days" of TV and movies, when you could only watch the Wizard of Oz once a year at Halloween, and you couldn't watch any old movies at all unless they came on the Late Show or showed at a local art theater.

I don't know why a game publisher wouldn't want to sell new copies of old games forever, like you can do with movies in the good new days.

nonamegiven··on 'Too Big to Jail' Admission Changes Debate
Large mistakes and crimes would have smaller impact.
nonamegiven··on Unix tricks
"Add "set -o vi" in your ~/.bashrc to make use the vi keybindings instead of the Emacs ones." Better to do this kind of thing in .inputrc, as:

set editing-mode vi

(or set editing-mode emacs) because any application that uses readline gets to use those settings. So for example you get command line editing in various command line apps. bash uses readline, so you'll get that. The python repl will give command line editing with .inputrc set as above.

  $ apt-rdepends -r libreadline6 |egrep -ve "^ " |wc -l
  8995
psql (postgresql) and mysql (mysql) are really handy with command line editing.

"'ctrl-x ctrl-e' opens an editor to work with long or complex command lines"

If you've set -o vi, or set editing-mode vi in .inputrc, then on a command line type:

  esc-v
(Escape key to get out of insert mode, then the 'v' key) That will open a full vim session for editing your complex command line.

  :wq
exits vim and gives your command to bash to execute.
nonamegiven··on How do free services on the web make money?
That's not bait and switch.

> "Bait-and-switch is a form of fraud used in retail sales but also practiced in other contexts. First, customers are "baited" by merchants' advertising products or services at a low price; then customers discover the advertised goods are not available. Other products are "switched" for them; however, these items are often costlier." https://en.wikipedia.org/wiki/Bait_and_switch

Bait and switch means that you're promised or enticed with one specific thing, but that thing is not available and you're offered something different. The idea is that you wanted something, so fuck it just buy it and get it over with. And of course some people won't even notice the switch.

Free now pay later and the other schemes are not bait and switch. When you get there/sign up, you have the free version right now, exactly as advertised. And there is no attempt (usually) to hide the fact that free is only for N days, after which you'll need to sign up.

Similar for free/paid for reduced/enhanced. You're getting exactly what's being offered.

nonamegiven··on LayerVault Sends DMCA Takedown Letter re Flat-UI
What he says sounds kind of reasonable.

But then when I see the side by sides that have been posted here, even the things that have been taken down, I get a big "fuck off" stuck in my throat.

Similar is not copy. Unless you want the same environment for copyright that we have right now with software patents.

nonamegiven··on Gnome cofounder: Desktop Linux is a Chernobyl of Fail
I think he's right, for desktops that try to do a lot, or for people who expect their desktops to do a lot. Gnome and Unity and KDE try to do too much, if you want what they're trying to do you might think of Windows or Mac and ssh to a VM or a server. That's fine.

My own view of the linux desktop is just something to give me nicely presented terminals and a very wee bit of eye candy. I use Lubuntu for that. Some urxvt terminal windows, a nice basic graphical browser and imap client, I'm good to go. I don't care if I can watch a movie or not (I can), most of the sound I want plays and never stops working (can't play midi for some reason, meh).

The tool chain he talks about is right here.

I want minimal things on the desktop, and Linux does that, minimal things, really well. Especially with something like Lubuntu or vanilla LXDE, it's a really nice implementation of the screen or tmux idea.

nonamegiven··on Linus Torvalds is considering the Chromebook Pixel as his primary laptop
Shipping goes a long way.
nonamegiven··on Where are the “big problem” jobs?
Old people care. Because, as you point out, we really need it.

How many old people are stuck in a job because of health insurance. There's a lot of old people.

nonamegiven··on Silicon Valley is high on innovation. And pot
But in both cases one can choose to let it be known or not. You can choose to share that you smoke or not, and you can choose to share that you're gay or not. It's that choice to share information or not that I'm talking about.
nonamegiven··on Silicon Valley is high on innovation. And pot
You may not know many people who regularly smoke pot because you "find it cripples productivity and turns me into a zombie. I stay away from it." You may be seen by users as either hostile, or at least not obviously friendly to their activity, so they self select you out of that information.

I think similarly, people who are anti-gay don't seem to know a lot of gay people, despite the fact that N% of the population are gay.

nonamegiven··on How not to send password reset notification email
I got a reset message from Evernote, and I didn't even remember that I had an account. I must have tried it for my typical 30 seconds to conclude "meh" and moved on, then forgot it. I'm still not 100% sure what they do beyond ... note taking?

But I initially assumed it to be ballsy phishing, a brazen attempt to capitalize on Evernote's current trouble. Why? BECAUSE IT HAS A FUCKING LINK TO THE SERVICE IN THE EMAIL! That's the very minimum definition of phishing. Sheesh!

I hovered over it, saw that it was to evernote, but hovers can be faked, and my intuition and experience told me that this smells like phishing no matter what. Sheesh.

nonamegiven··on Is there a script that will generate a mind map from an iOS project's code?
Probably nothing that would make a mind map, but ...

Doxygen may or may not work, it probably doesn't understand whatever language iOS uses (objc?). Also I think there are better solutions than doxygen these days.

But if you look at Doxygen then you'll know the kind of thing you're looking for. Note that you do not have to have marked up your code in order for doxygen to produce documentation for you.

Also I think doxygen, and probably whatever is better these days, can produce intermediate output which you could then easily process and produce a mind map on your own, if that's what you really want.

nonamegiven··on Ubuntu Rolling Release Proposal
Depending on what you do with your machine(s), it might make sense for you to go with whatever versions come with the vast majority of the packages, but for the few that matter to you, manage them yourself. For example, I use Oracle's Virtualbox PPA, and it just updated as a normal software update last night. That's 4.2.x, compared to Ubuntu's 4.1.x. For things that aren't PPA'd, you'd need to pay closer attention. It's an option.
nonamegiven··on Ask HN: Is it too late to start learning to code?
For the rest of your life, no matter how old you are, if you want to do something then fucking do it.

Here endeth the lesson.

nonamegiven··on This Is Why You Can’t Have Nice Things, Yahoos
If she knows who's not logging in to the VPN, then fire them.

Why would you want those people coming in to the office?

Fire them.

Don't punish the responsible people. And if the managers don't know which ones those are, fire them and replace them with their underlings.

nonamegiven··on Apple’s Deleting iCloud Emails That Contain The Phrase 'Barely Legal Teens'
Putting a scalpel in your drawer is a simple one-step operation. Anyone can install a scalpel.

Using it effectively, and knowing the dark corners of scalpeling, is quite another thing. It would be easy to get into deep trouble with a scalpel.

nonamegiven··on Yahoo Responds to Work-From-Home Outcry
"If there are unproductive employees within Yahoo, the onus should be on their managers to find and address the issue."

But that would be a management decision by the same people who decided to get all their butts in chairs from 9 to 5. There are no out of band managers, they're stuck with who they have.

Unless someone fired those managers. But that would be the CEO, and there are no out of band CEOs, they're stuck with her.

Unless someone fired her, and I guess their board is good at that at least.

← PreviousPage 4 of 8Next →