HNHacker News
TopNewBestAskShowJobs

3amOpsGuy

535 karma · joined June 2, 2012

submissionscomments
3amOpsGuy··on MySQL vs PostgreSQL
I only skimmed the page, but i didn't find any references or stats to back up any claims in the text?
3amOpsGuy··on Why Folders are holding back hassle-free File Management & Tags are the Future.
Folders work standalone, tags don't.

Tags don't work without a search feature - we might tag religiously but others don't and won't.

If you're implementing a search feature then you no longer need tags.

It won't take off. Especially as these days we seem to be moving away from files full stop.

3amOpsGuy··on Rootbeer GPU Compiler Lets Almost Any Java Code Run On the GPU
That's my experience in a nutshell. The cost of doing a cudamemcpy() far outweighs the advantages for computationally small tasks. The surprising bit for me was what's classed as a small task.

Decompressing a 5MP jpg then applying various filters is too lightweight a task to benefit. I thought that would be more or less a perfect GPU task, not so.

Running on OpenCL, the CPU with vector instructions horses a small GPU performance wise for this problem.

3amOpsGuy··on Essential C
C is an excellent first language when teaching in a CompSci type environment.

If the students are of a different discipline (not aiming to be CompSci grads) or much younger then i think there are better choices e.g. Python.

In a CompSci academic setting i think learning assembly first (that is first programming language but in parallel with the other classes such as computer architecture etc.) is also a valid approach.

Programming from the Ground Up [1] is a very accessible introduction to x86 ASM and even supposing you don't go any further than the examples in this book, you'll still feel the benefits.

[1] http://ftp.igh.cnrs.fr/pub/nongnu/pgubook/ProgrammingGroundU...

3amOpsGuy··on Google's Opaque New Policy Lets Rightsholders Dictate Search Results
"Dictate". I understand policy holders can now influence but not dictate results.

Am i being unreasonable in thinking this use of inflationary language is wrong?

If morally you're on the right side of the argument, which i believe the EFF is, then you must play everything completely straight and by the book - otherwise you just give up your advantage.

What language do we reserve for the really bad things.

3amOpsGuy··on Vim as you IDE
Over the years I seem to have gone full circle with Vim. These days I lean towards few or even no plugins - snipmate is the last plugin i'm struggling to eliminate.

This is more than likely a factor of my environment though. I'm frequently using Vim "away from home" so to speak.

Best approach for this i've found so far is to set a $VIMINIT on remote login (i.e. an admittedly clunky combination of SendEnv set for Host * in ~/.ssh/config). Still on the lookout for a better way though.

3amOpsGuy··on How To Write Good Log Messages
>> Hopefully, you see the irony in this.

>> All I'm seeing is a constant stream of arrogance

Perhaps not...

3amOpsGuy··on How To Write Good Log Messages
>> streaming to a central location via syslog or scribe

Ahh, "man mkpipe", you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem.

>> standard approach in my corner of the world

Syslog streaming has been a common approach since the ~70s i'd guess? Likely before.

>> yet feel entitled to give ops-advice that is at odds with how the rest of the world operates

Hopefully, you see the irony in this.

3amOpsGuy··on How To Write Good Log Messages
>> Sorry but then your monitoring system is broken? Why is its operation tied to log chunking?

Yours clearly bends some unbendable truths of the known universe ;-)

A monitoring system ordinarily samples the logfile at a given point in time, that is an open followed by a close operation on the logfile (lest you run into phantom disk usage issues caused by holding an open file handle to a compressed / rotated logfile).

If between sample 1 and sample 2 the log file is rolled, your monitoring system never sees the data between sample 1 and the end of the previous log.

Possible workarounds include logfile streaming (say via a pipe on the filesystem) but that introduces much larger problems and would in no way be compatible with the app rolling its log files.

A much simpler fix is to roll only on events (bounced the app etc.)

>> A script to identify the file-range for a given time-range via binary search is really easy to write

Contrast with no script required. No bugs, no maintenance time, no different versions in different regions. Just no script. The benefits don't stop there - when you need to query, there's no waiting for a bunch of disk seeks while the script runs against a busy disk controller - you can just get straight on with parsing the results.

>> Easier handling. If you need to offload "50GB" from a given log-host then that's easier to do when you know that will be 50 files.

Moving 50 items is easier than moving 1? I'm unconvinced but still open to any interesting ideas here.

>> You don't risk a scratch disk running full

There is no change to the risk profile, neither approach is better in this regard, unfortunately.

>> e.g. interleaved with stack traces

Just one of the many excellent reasons not to log them in production.

>> you must be well aware how long even the simplest merge-job takes on the slice of a single day?

Yes - it runs at full disk I/O speed with almost no CPU overhead. Remember we are merging sorted data (already in temporal order).

>> which happens frequently

It's clearly a high profile app you're working on (in my experience the people in charge of the pennies refuse to sign off on the cost of disk space for this amount of logging without solid reasoning) i'm surprised it behaves as badly as you say. Concerning, but then it also appears you don't have an ops team either.

>> stitch together context from other files.

I get the impression you're thinking that you should manually stitch these together? On the very rare occassions you need this data, remember both are already in time order, we just instantly merge on the fly.

>> A mere grep on a day's worth of logs takes about 10 minutes for us.

It sounds like you've got it all in one file, i.e. not splitting your audit.log out from your error.log from your trace.log? - techniques which I couldn't do without to be honest (the monitoring system would have to consume every byte logged otherwise, when it really only needs to see a subset of total log output - thus saving CPU time and disk seeks).

>> Any kind of text-processing or "for each line perform lookup in $otherplace" quickly pushes that into the hours.

shakes head

Would you humour me with some context here. What is your background? From your replies i would say you are non-ops staff[1], self-taught[2] and with limited experience[3].

[1] You don't demonstrate any knowledge of basic tools, e.g. you mentioned writing a script for a problem solved by a 35+ year old command found on any unix host

[2] You haven't volunteered anything more advanced than obvious / first order approaches. Approaches that i'd expect any CompSci university grad could suggest off the cuff with no prior experience.

[3] You mention grepping through a single logfile of at least 35Gb, likely much larger.

3amOpsGuy··on How To Write Good Log Messages
>> Only applicable when you produce a small, predictable volume of logging.

No, It's primarily in the larger log volume systems we run into this problem. Take a FIX session adapter (very common software in the financial services world), baseline is around 5Gb/hour but its susceptible to fairly extreme fluctuation.

When you roll the logs at say 500Mb, there's the chance our monitoring system misses an error in the tail of the previous log as the logs roll (which could in the worst cases mean loosing a couple of million or even more).

Multiple logfiles for a day are harder to search through when handling the most common use case for log files, which is not debugging but ops staff answering questions on 'what happened with X?'

What benefits does a split logfile provide? The one use case is transferring logs across the network. However most log management systems already split large logs up before transferring to the archive silo.

You're loosing a lot, but gaining nothing with split logs.

>> When logging high volumes

It makes no difference, when the market swings you're going to need an extra 200Gb anyway, whether the logs are in chunks or not. In large volume apps deleting to make space is often not an option - you're logging in high volumes for a reason (often regulatory).

>> fetching an arbitrary header from the right file for a given context can be rather painful.

That's been a solved problem for a very long time. Just as recombining a separate trace log with a main app log based on time stamp is a solved problem. I believe this highlights the bigger problem, you can go to university or a.n. other school and learn to be a developer. Where can you go to learn operations? The net result is people come up with the own solutions each time instead of building on work already done. That work is available but its often passed on by word of mouth. Surprisingly hard even in today's world to find decent blogs on ops work (thankfully there are more around now).

>> When a serious error occurs then as much context as feasible must be provided

Yes this is the extraordinarily rare case where stack traces can be useful. They still don't belong in the main app log though.

Push to a separate trace log and recombine on the fly when you need to view. The benefits are to the ops team and the monitoring system.

Another approach not often mentioned is black box logging. Log to a circular buffer in memory, the first bytes of the buffer are set to a pattern that can be searched for in a core dump, the remainder is used as a circular buffer. It's fast to log to, takes no disk space and provides crucial context in the event of a crash.

Im not sure I'll be able to convince you based on your tone, but speaking from experience, you are making the most common mistakes.

3amOpsGuy··on How To Write Good Log Messages
One of the hardest things in ops is trying to see what the app is doing without benefit of the code to review.

I know what the app does, I know the process flows involved but 'failed to covert X at MyClass:44' doesn't have enough context for me.

Also log levels - most developers over use warning and error levels and under uses debug and trace in my experience. It makes filtering out the noise harder.

Rolling log files - roll on an event (new day, process bounced etc.) not on reaching a 10Mb limit or an equally arbitrary 1k lines limit.

Use a header in the logfile, contain at least the version number of the code running, the user and host it is running on.

Lastly stack traces, if they even have a use case at all in production, should not be in the main logfile.

3amOpsGuy··on Show HN: Chartulo.us - Chart anything from the command line
Ahh cool, i see the attraction. I went through a phase of using the google chart API instead of GNUplot (you just wget a URL piping your data). Coupled with a big bash history it works fairly well.

I've learned enough R to be dangerous. Ggplot2 looks gorgeous without trying. It's my current favourite torch for shining on perf and capacity issues (I dream of one day identifying a perf issues root cause with nothing more than the correlation function!)

3amOpsGuy··on How ZFS continues to be better than Btrfs.
>> To me, ZFS and Dtrace are of no consequence

>> there are many more people like me

Recently I was wondering how can there be so many tech startups around just now. Nothing under the sun is new so how can they cut a living?

Ive realised this attitude (which there is absolutely nothing wrong with) is the reason. The established players leave gaps for their own reasons and the little guy comes along and seizes the opportunity.

Skipping over cheaply accessible best in class technology, at a philosophical level at least, seems akin to pointing a 12 gauge at your toes.

3amOpsGuy··on Recovery-Oriented Computing
Yeah i have to agree. Crash oriented or crash-only design is to my mind more useful than 'only' recovery oriented - it's also realistically achievable. I've taken to implementing my middleware this way since I've started working against Cassandra back-ends (also crash only design).
3amOpsGuy··on Google's Autonomous cars complete 300,000 miles without an accident
I wonder what kind of denial of service attacks we'll see on autonomous cars once they're popular.

Trivial example, could i choose to always pull out in front of the robot even if it's not my right of way? (presumably safe in the knowledge the robot will always give way to avoid a collision)

Could that escalate to the robot being treated as a mobile speed trap / felony snitch?

Interesting times.

3amOpsGuy··on Please turn on two-factor authentication
Browser compromises are the one I worry about. A remote attack that reveals everything your browser has or knows.

I've been using 2 factor on google for a year or so now. It's not perfect - especially the ways it can be disabled - but it's better than the status quo for now.

3amOpsGuy··on Thinking Functionally with Haskell
Wow, I attended a university synonymous with Haskell. 15 mins of reading here and I've just had an epiphany that eluded me in all those years.

A most insightful post, thank you very much.

3amOpsGuy··on The API Hub: Jeff Bezos-Backed Mashape Launches To The Public With 430 APIs
>> When you’re a marketplace, you always fight the chicken/egg problem and the last thing you want to do is open up a marketplace when you don’t have enough supply yet

What's are your views here?

This is a really interesting question for me. I keep putting off a side project that I'd love to do because it suffers this exact problem.

I want to believe there's another way to handle this situation.

3amOpsGuy··on NSA director finally greets Defcon hackers
It's part of the RHCE exam, to be honest i always disabled it before then. These days though i always use it (in targetted mode).

I'd imagine there are others like me.

3amOpsGuy··on Transparent plug-in hybrid retrofit for any car
Is there potentially a major efficiency issue here, through adding rotational mass in such quantity?
3amOpsGuy··on Server Configuration - Basic Security Part 7
I get the impression you're thinking "secure" is a boolean, if anything it's a floating point. By that I mean "is it secure?" could be viewed as a naive question, a better question could be "how secure is it?".

>> NB: The next point is

Yes but I didn't want to write a counter point to each point. I'd taken the view from the listing of possible problems presented that the basics weren't being considered. It reads as a list of random points in a large space rather than a comprehensive listing.

To give a specific example, the article talks about writable concerns when really we want to be ensuring readable gets the same treatment.

>> even if it's in the web directory, can't leak the data without some other compromise

Or a config error (a botched upgrade disabling mod_php could do the trick, or more obscurely a content negotiation oversight), or a leaked backup (another common one - storing random backups under www root)... There's more than one way to skin a cat as they say.

>> If I can even connect

You're often better to view security as something you provide in layers. I wouldn't expect to be able to hit port 3306 from here, but if you're not expecting me to ever be inside your network, then priviledge escalation is going to be fairly quick for me once i surprise you by getting in.

3amOpsGuy··on Server Configuration - Basic Security Part 7
>> Configuring a server correctly is both 1) hard and 2) critical.

It's not hard, you won't get breathless! ;-)

By the configuration stage, the mental tax can often be as low as checking off items on a checklist.

It is a whole different skill set though and it's trickier in some ways e.g. a developer can often depend on his compiler to tell him if he's messed up the basics.

You could go-live with a host having most attack surfaces battened down tighter than a crab's harris at 50 fathoms, but because nothing told you about DNS tunnelling... (feel free to insert A.N. other rarely talked about but trivial attack)

>> Are directories only writeable by the web server user?

The web server user shouldn't be able to write anywhere except perhaps an upload directory inside its chroot. At no point should it be serving files from that dir (a common mistake).

With tools like SELinux around you can often help cover yourself from midnight mistakes down the line.

A blisteringly common one not mentioned is database authentication details inside .pl, .py or .php scripts.

>> Is PHP installed on your Python server?

Another common one is GCC installed. Often when building perl / python / ruby / nodejs modules or whatever, these will be built on the prod server in small shops. That often means a full compiler suite laying around.

3amOpsGuy··on OpenNews: Why Develop in the Newsroom?
I think i've missed the point. How is this any different from sitting RAD (as in "rapid application development") guys in your business teams?

Lots of companies do this already across many sectors.

EDIT: It's still cool though.

3amOpsGuy··on How the Norwegians Reacted to Terrorism
See that's where i worry about myself.

My immediate thought is, how do i get myself on that gravy train :-)

3amOpsGuy··on All you ever wanted to know about building a secure password reset (NSFW)
Really good article, well written. Easy to read.

>> Everything i believe is important

In the spirit of completeness, you could expand the details of this paragraph:

>> What we want to do is create a unique token which can be sent in an email

There should also be a Time to Live on the token, and it should only be usable once. On the landing page for the link, the user needs to enter* their email address to avoid someone arriving at the url from a means other than the original email.

I feel like i should give an example there, let's say the attacker figured out your random id generation method, say it's a hash of a timestamp for simplicity, if they generate a few thousand links for around 6pm, they may get lucky).

* They don't actually need to enter it, UX guys would be having minor heart attacks at that suggestion, but they could choose their email address from a small table of plausible looking but made-up addresses, or something to that effect, e.g. Bank of America uses a photograph the user setup beforehand.

3amOpsGuy··on The Terrifying Background of the Man Who Ran a CIA Assassination Unit
>> I am not sympathetic to the plight of those who associate with terrorists (even if they themselves haven't committed a terrorist act) and find themselves it Gitmo or dead.

There is a view that the US actions are unfair and unjust. The delivery method is not terrorism but the end result is indistinguishable in terms of justness or fairness. For example, torturing a man not found guilty of any crimes.

With that in mind, you yourself would be a co-conspirator of the nature you mention your lack of care for above.

If A.N. Other opposing, aggrieved party was to become as effective as the CIA at culling people, such as yourself or your loved ones (in no way are you or your loved ones doing anything "wrong" although you do sympathise with the American unaccountable "bully" philosophy) i'm certain your view would change overnight.

3amOpsGuy··on Scalability: PostgreSQL vs MySQL
For small use cases, e.g. Hacking on a developer workstation, MySQL has historically been a lot easier to get started with. No need for Cygwin which used to be the case for postgres, MySql has a GUI installer, mysql has a ton of online help resources, no mental drain to deal with up front - how often should I run a Postgres vacuum? How should I schedule it?

When it comes to scaling up though, Postgres has in my experience, always just worked. This has been true for years. The documentation is excellent and the community extremely helpful and knowledgable.

3amOpsGuy··on Looking with Cassandra into the future of Atlas
I don't think that's strictly true.

With cassandra you choose where the extra reads (or writes) to ensure consistency occur as best suits your use case:

* At write time (write quorum) like a traditional replicated datastore

* At read time (read quorum)

* In the background (read one, with a non-zero chance of read repair)

This is quite nice to be able to bend Cassandra on a use case by use case basis (NB: these are not cluster wide approaches, for different columns / circumstances i can choose different patterns).

3amOpsGuy··on Can a 32-bit OS machine use up all 8GB RAM + 20GB page file?
The top answer seems wrong to me.

>> a process can have more memory than address space

How does that work? The best I can come up with is the author is referring to mmap? In which case the address space is still limited to 4Gb although I concede that with the OS pagefile it would be possible to have more than 4Gb in core at a time via judicious use of mmap.

3amOpsGuy··on Can a 32-bit OS machine use up all 8GB RAM + 20GB page file?
>> I'm assuming this is 1000 vs 1024 issue

It'll likely be your graphics card uses a portion of your main RAM for its memory. This is common.

← PreviousPage 7 of 8Next →