Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


Cheap surveillance with perl and IP cameras

Posted by fliptop on Friday February 28 2014, @09:32PM (#110)
5 Comments
Code

A year ago I wondered if it was possible to use a cheap IP camera I had to record the wildlife activity (mainly deer) on my property. As you may know, most of the cheaper (<$100) IP cameras have shitty firmware and require Java or (even worse) ActiveX in order to view video. Additionally, the software that comes w/ these cameras requires Windows, and since I run Linux that's not going to work.

For what I wanted, though, I figured continuous footage was overkill and started to investigate if it were possible to just pull an image every 10 seconds or so, store it somewhere, then use ffmpeg to tie them all together into an mpeg once a day. All IP cameras have the ability to grab snapshots so I set about figuring out how to accomplish this.

Turns out it's pretty simple. Using a little perl and a few cron commands I was able to get everything working and, once it was put into motion, needed very little babysitting to work.

So over the next couple of weeks I'm going to write about what hardware I used (and what I don't recommend using), how I set my server up, show the code I used, and some results.

First off, some specifications:

  • the cameras must be cheap, less than $100
  • I wanted to use wireless cameras so I didn't have to run a bunch of CAT5 throughout my house
  • the camera I had at the time did not include infrared, but the ones I wound up buying later did, and they were rated at 0 lux
  • I chose to control everything w/ an old computer running CentOS 6 (basic server setup)

Coming up next, the cameras I used.

Mars, Ho! Chapter Four

Posted by mcgrew on Friday February 28 2014, @02:25PM (#107)
0 Comments
Science

Chapter One
Previously

Liftoff
          I woke up to the smell of bacon and coffee and the sound of a woman saying "Good morning, Johnny."
          It took me a second or two to figure out who was talking. I was a little hungover. "Mmmh," I said. "Mornin', Destiny." I got lucky, I usually suck at remembering names but hers was so different it was easy.
          "Come have some eggs before they get cold, John."
          "You made breakfast? Damn, I think I'm in love!"
          She laughed. "Slow down, cowboy."
          I laughed. "Don't worry, I'm a snail. I thought you liked me too?
          She grinned sheepishly. "I do. That's the problem. I didn't want to like you, I wanted to use you. But I can't, I like you.
          "I might even be falling in love, damn it. Shit, I shouldn't have said that."
          I was glad she did. I thought I was falling in love, too. Never happened before, I don't know why I married my ex. But I might be...
          My brain exploded again.
          It was a little awkward but I had a way out. I sighed. "Time to secure passengers and cargo for liftoff. I guess you're first, lover."
          Her eye twinkled. "Lover?"
          "No?"
          She smiled. "Yeah."
            I strapped her in and started on the other two hundred women.

  "Ten... Nine... Eight... Seven... Six... Five... Four... Three... Two..."
          I braced myself for the Gs. "One. Ignition. Liftoff."
          God but I hate liftoff. Hey, you wanted this report to be complete, didn't you? Then shut up and let me talk. Jesus, guys.
          Anyway, after we were in orbit I unleashed Destiny, and she helped me unleash the rest. In fact, most helped unleash the rest. I was impressed, maybe the whores weren't as depraved as I thought?
          It turned out that that was completely wrong. They were more depraved than I could imagine.

This is a crude, rough draft of an upcoming book that is less than 10% finished. This short chapter will be enlarged for the book. Continues...

Mars, Ho! Chapter Three (and more)

Posted by mcgrew on Thursday February 27 2014, @09:35PM (#106)
5 Comments
Soylent

Previously...

Destiny
                The maid woke me up about noon. I hate that damned thing, always noisy as hell. Why does it have to clean at noon?
                "Coffee," I growled. A couple of minutes later a table with a cup of coffee on it rolled to me. Why are those damned things so slow? Anyway, I don't know why I'm putting this in my report except I don't want to get in trouble for leaving anything out.
                I took a shit and drank another cup of coffee.
                I switched on the video and turned to the news. Tornadoes, floods, fires, shootings, robberies, political corruption, some bullshit about the Martian terraforming project that's been going on for a hundred years... Why do they call it "news"? It's never new, it's the same shit all the time. Bored, I switched through the channels. Shit, all boring. I'll get a beer. So I locked up the boat and hailed a taxi with my fone and went to the nearest bar, which was five miles away. Why ain't there no bars near spaceports, I wondered. It was like that everywhere.
                I sat down and ordered a beer. "I'm sorry, sir," the bartender said, "but this says you're underage."
                "What? Christ, lady, I'm forty five!"
                "Well, this says 'underage', no ID carried."
                "Shit," I said, and got out my fone and turned on GPSID. "Try it again."
                "OK," she said, "It worked that time." I checked my balance - wow, beer wasn't cheap here.
                "Hi, Captain."
                "Huh," I said, startled. "Oh," I said, seeing who it was. "The woman that wanted on my boat. Gonna buy me a drink, lady?"
                "The name's Tamatha. You can call me Tammy. If I buy you a drink are you going to let me on?"
                "Nope."
                "Buy your own booze, loser."
                "Fuck you," I retorted. "I ain't cheap like you droppers."
                "I told you, I want to get away from that shit. That's why I haven't gone home, even though I really, really want to. Come on, please, I'll fuck you all the way to Mars!"
                I laughed. "Yeah, you and two hundred other hookers."
                "You're an asshole," she said.
                "So what, cunt," I replied. "Get outta my face."
                "What did you call me?" she demanded.
                "Are you good for anything but putting a dick in?" I asked.
                "OOOOH!!" She shouted, and stomped off. I got another expensive beer. Damn, I should have had the taxi take me to a cheaper part of town, even if the fare would have been more. I guess I could have took the bus, but hell, I got money, I don't need no bus.
                A blonde sat down next to me. "Hi," she said. "I overheard, why did she call you captain? Are you on the Mars boat?"
                "Yeah," I said. "Why?"
                "I'm going to Mars."
                "Yeah? That's what she said. She's not on the manifest."
                "I am."
                "Yeah?" I said, pulling out my fone and checking out the manifest. Of course, as soon as I activated it her face and information was shown. "Why, pleased to meet you, uh..." I glanced at the manifest, "Destiny. Is that your real name?"
                She giggled. "Yeah, it is. Buy you a drink, Captain?"
                "Call me John," I said, shaking her extended hand. "So why do you want to go to Mars?"
                "I want to see what it's like to be a hooker."
                I choked on my beer; women kind of fuck my brain up sometimes. "Huh?"
                "I want to experience everything!"
                She grabbed my crotch. "No charge for you," she said before locking lips with me.
                Wow. I was really looking forward to this trip!
                My boat's really a houseboat. I'd lied to that Tammy woman, it's my boat. I usually only live in it when I'm on-planet; it won't go farther than the moon in any reasonable amount of time, and I live on the company's Captain's Quarters when I'm working. Lots nicer than my houseboat. The company pays me to ferry passengers to their boat, in orbit. A second stage to hold a couple hundred passengers is pretty cheap, it's just a tube with gravity harnesses installed.
                I'd had a wonderful time! I really liked Destiny. Smart, funny, and damned good looking.
        We shared a taxi to my boat, and there were twenty women waiting when we got there. I had to check them all in. "Sorry, Destiny," I said. "You can drop by my quarters when I'm done here."
                "No," she said, and winked. "You can come to mine."
        "Uh, your cabin's in orbit. This isn't the ship, this is just a rocket underneath a harness tube underneath my houseboat. The ship itself's in orbit waiting for us. Just take the elevator to my boat, when we take off you can use a harness there, you don't have to ride in the tube."
                The fucking women just wouldn't stop coming, and most of them acted horny, a sure sign they were high on drops. Most of them hit on me, none too subtly.
                This was going to be a good trip! At least, if I could get all those whores inside the boat. No sooner than I'd start walking to my quarters the damned bell rang. It kept up all weekend. Finally, maybe midnight Sunday, I got what I thought was going to be eight hours sleep. I'd had maybe four all weekend.
                I got two more before the doorbell rang. It was that damned Tammy. "You ain't getting' in. Now go away before I call the cops" I said.
                "Check your manifest."
                I checked it. "You aren't on it."
                "Look at the passengers list."
                Passengers? Huh? Ok, I checked. Damn, she was there. I unlocked the airlock. "17 C", I said, and went to my cabin.
                I got some sleep, finally... an hour later. I really like Destiny!

This crude, rough draft has been edited from /.'s crude, rough draft and is slightly bigger. This story is now Soylent's fiction. Hey, that's better than sy-fy, isn't it? Continues...

I'm Retireded!
Today was my last day of work. I haven't felt like this since I got out of the Air Force! In the words of Martain Luther King and doubtless countless freed slaves after the civil war, "Free at last! Free at last! Thank God almighty, I'm free at last!"

It took four years to write Nobots. I might publish two more this year. Freedom!

Mars, Ho! Chapter Two

Posted by mcgrew on Wednesday February 26 2014, @05:59PM (#102)
0 Comments
/dev/random

Previously

Tamatha
                What got me interested was the fact that they were whores! I was going to have a boatload of horny whores!
                See, I'm not good with women. What I mean by that is women use me and I'm too damned stupid to see it. And I was too damned stupid to realize that whores are women.
                What happened earlier, you know, led to my stupidity. Well, except the stupidity of not realizing whores are women, that was incredibly stupid.
                Did I tell you about women? They've made my life hell. Look at the week before they handed that Mars assignment, for instance. No, never mind, you don't want to hear it.
                Most of what I learned about women I learned from the powers of Evil. What I mean is, women taught me about women.
                For instance:

  • The one thing that will attract a woman, more than any other thing, is another woman on your arm
  • A woman doesn't want you unless she can take you away from another woman
  • A woman isn't impressed by a big dick, but if you have one she'll brag about it to her friends and if you don't she'll make fun of it
  • A woman is incapable of putting anything back where she found it.
  • Women will bitch about the very aspects of their men that attracted them in the first place
  • Most women prefer the sexual vibrators manufactured by the Harley-Davidson corporation
  • A woman will throw the things you want to keep away, and keep the things you want to throw away. She'll throw out the "useless junk" your late great grandfather left you but leave the ball of lint and empty soap box on the dryer.
  • A woman will rearrange your shit so she can bitch about your asking where it is. "Well LOOK for it!"
  • A woman can never get enough sex, but she can get too much sex
  • There is no good answer to the question "is my ass too big?"
  • You're most attractive to any woman right after you've had sex with a different one

                Being stupid, I was happy. I guess that's the secret to happiness - Be stupid. But stupid pays later.
                I went home, took a shower, and checked out Ol' Miss before I went out single party partying.
                "Ol' Miss" is my own boat. It's docked to the company boat when I'm driving the company boat. She was home.
                I went out drinking.

                I woke up sitting on the couch with the doorbell screaming at me, a full whole warm beer on the table. What damned time is it? Five? In the morning? What the hell. I picked up my tablet. "Who is it and what in the hell do you want at this ungodly hour?" I growled.
                "Tamatha Winters, who are you?" the woman pictured on the tablet said.
                "I'm the captain of this damned boat. What in the hell do you want?"
                "I'm part of your cargo."
                "Christ, woman," I said, still irritated but noting that she wasn't bad looking. "We don't leave until Monday and it's only Saturday. At five o'clock in the God damned morning! Damn it, woman, I wanted to sleep late!"
                "I'm sorry, but I don't have anywhere else to go," she said.
                So I'm perplexed again. Or still. Or something. No place to go? A decent looking hooker? "So why not?"
                "Drops."
                "Shit, an addict?"
                "Yeah," the picture of the woman on the tablet said. "I heard there ain't no drops on Mars and I'm sick of the life. You think I like sucking dicks for... well, it ain't a living. More like a dying. I can't seem to stop on Earth, and they want women on Mars so I'm going."
                "They don't want women, they want whores. You'll still be a whore."
                "Maybe," she said. "We'll see. Are you going to let me in?"
                "I have to check the roster to see if you're authorized."
                "Why? Isn't it your ship?"
                "Look, lady," I said, "it's the company's ship. I just live here and drive it where they tell me to. I can't let you on unless I have you on the manifest. Let me look." I looked, there wasn't any Tamatha Winters or record of her face. "Sorry, lady, you ain't on the list."
                "What?!" She said. "Of course I am! Here's my papers," she said, holding out a fone.
                "Sorry, lady," I said. "You'll have to straighten it out with the company. Bye."
                "Wait!" the tablet exclaimed. "I can't go home! There's drops there and I won't make the liftoff!"
                "Sorry, lady, I ain't gonna screw up a good job. I can actually buy shit instead of having crappy printed out shit and I ain't gonna mess it up. GoodBYE!" I said, disconnected, and went to bed. At least the cunt had me in more comfortable sleep, my couch sucks to sleep on.

This crude, rough draft continues...

What's the Best General purpose RAD language...

Posted by gishzida on Wednesday February 26 2014, @10:24AM (#101)
5 Comments
Code
for a casual programmer?

Perl and Python are not good languages to use for a "casual programmer" such as myself. My reasons are as follows:

Their learning curve is steep.

They require an external "runtime" and /or libraries.

They cannot "compile" a stand-alone executable [using wrappers makes the process too complex]

What are the alternatives?

"Scripting" Languages have many limitations. I've used TCL/Tk, Perl, Python, JavaScript. Of these TCL/Tk is the easiest to use simply because TCL is pretty straight forward [within its limitations] and Tk is integrated with TCL so building user facing windowing apps was fairly simple. None of the other languages noted above are as "easy" to write in as they were written for purposes other than human readability or easy functionality. "Back in the day" I used the IBM Basic compiler [MS basic compiler], Turbo Pascal, Realizer [AKA CA-Realizer was a Win31 / Win95 basic compiler that Computer Associates bought and then let MS kill http://en.wikipedia.org/wiki/CA-Realizer ] to write actual "production release" software. More recently I have used both FreeBasic and FreePascal.

I'm one of those foolish oldtimer's that think that OO languages add needless complexity while not actually providing added value to Rapid App Development. So talking C++, Java [and variants] and other OO languages at me is pretty pointless.

JavaScript is said to be the "coming thing" except it seems that it suffers from dialect fragmentation / implementation issues [Anyone remember how MS broke things with its own version of Java?] and last I looked it also had "math issues" [i.e. math is not done by simple expression "A=15+6" there is no specific number types-- Number is too general]

Many years ago [1998?] I wrote an app with JavaScript to run in the original Netscape browser that read in data, processed it and then wrote to disk the results. It was a bitch to write. I did it despite poorly documented features [disk reads and writes at the time were "supposed to be sandboxed". It turns out they were not. I am unconvinced that JS is actually a way forward since it was not designed to be a "general purpose" language.

I'd love to hear what others think the best general purpose language is for a "casual programmer".

Travesty Generators

Posted by gishzida on Wednesday February 26 2014, @08:57AM (#100)
3 Comments
Code
Recently I looked in my "old code repository" to see if I had the source for "A Travesty Generator for Micros" from Byte Magazine [November 1984]. I did not find the code for the Byte version of Travesty but I did find a couple of old DOS apps: Markv and "Babble!".

MarkV is a markov chain text twister written in C. The most famous of the Markv versions was an IRC / USENET bot that emitted posts and comments. For an example of what MarkV can do to a list of "wisdom quotes" see http://markovswisdom.blogspot.com/2014/02/the-book-of-markovs-reminders.html

"Babble!" was a closed source DOS "shareware" app from the 1990s that allowed multiple Markov chains from a maximum of 4 text source travesty streams to be mixed into a single output stream. An example of this can be found here: http://markovswisdom.blogspot.com/2014/02/markov-and-shakespeare-reveal-wisdom-of.html The output combines a small snippet of the "wisdom quotes" + "Hamlet" + Jabberwocky" + "Romeo and Juliette". The problem with the version of "Babble!" I have is a) it is closed source and b) the shareware is crippleware in that the text streams are very limited. I'd very much like to have or develop a useable version of this.

Unfortunately there do not seem to be too many "modern" open source "travesty generators" available and those that I have found are not written in programming languages [Perl, Python] that I am a fluent programmer [which is to say I find neither Perl nor Python are not casual programmer friendly... but we'll save that for another journal entry]

One other thing I have noticed is that there do not seem to be too many "modern" implementations using Markov Chains and other methods to twist text available.

Anyone know where I can lay my hands on source code for "text twister" or Travesty generators?

Mars, Ho! Chapter One

Posted by mcgrew on Tuesday February 25 2014, @03:35PM (#94)
0 Comments
/dev/random

Prologue
        I don't know why they're making me write this damned report, I never had to write a report before. Ain't like I been to college or nothing. I didn't have to write a report after Vesta, why now? Maybe because this trip was so damned out of the ordinary? I don't know, I'm just talking into this thing and I don't know where to start, so I'll just start.

The Meeting
              I was scared shitless; the CEO had called me into his office. Jesus, the fucking CEO! Why would a CEO want a lowly boat captain to talk to him? Yeah, centuries ago ship captains were really important guys, but that was back when they needed crews. I was a glorified bus driver and babysitter.
                I liked hauling passengers because at least I'd have somebody to talk to. It takes a long time to get from planet to planet, and it's usually a boring trip. They pay pretty damned good, too -- cargo boats don't need babysitters.
                Jesus! The CEO! I was shaking as I walked into his office. If I was going to get fired for that little incident on Vesta my chief would have sacked me.
                "Have a seat, Mister Knolls. Coffee?"
                "Uh," I said, "Uh, thank you, sir." I fidgeted in my chair. His assistant gave me a cup.
                "Knolls, your supervisor told me all about Vesta."
                I almost pissed my pants. Shit, they were going to sue me.
                "That was some damned good work, Knolls."
                My head kind of exploded. "Sir? Two men died!"
                "Yes, Mister Knolls, but you saved ten million dollars in equipment and the wrongful death suits were only a million each. God damned good work!"
                "Uh, thank you, sir," I said, wondering how damned evil this man could be.
                "I have a new assignment for you," he said. "Your supervisor told me you didn't like cargo runs, but this time you'll have someone to talk to."
                My head kind of stopped working right then.
                "This assignment is important. You're the man for this job and we're giving you a fifty percent raise."
                "Uh, sir, uh, what's my cargo and where am I taking it?"
                The CEO smiled. "Women. You're to transport two hundred woman to Mars."
                "Women?" I asked, my brain still not working properly.
                "Whores, Knolls."
                Taking a couple hundred whores to Mars? Wow.
                "So, Knolls, are you taking the assignment?"
                What could I say? Of course, not ever having met any whores I had no idea how much of a pain in the ass it would be or that I would regret my decision. "Yes, sir, how could I not? Of course! When do I leave?"
                I wish my brain would have been working. God, what a mistake.

This is a crude, rough draft. Continues...

Mars, Ho!

Posted by mcgrew on Monday February 24 2014, @06:10PM (#90)
0 Comments
/dev/random

The book I'm working on now is the same name as the title of this journal. It was started at slashot, but will be finished here. I'll post it there, but the soyled get it first.

Except that it's already started and from what I can tell, none of the folks here at soylent know me. So for the next few days I'll be posting Martian whores here.

You had no idea what you were getting into, did you?

Neither did I.

What you will read is a crude, first draft. Stuff will be added to existing chapters, stuff will go away, and the order of some will most likely be changed. For an example, look at this finished, edited version of Nobots chapter 7 (which stands on its own as a story) compared to the draft.

I'll start posting chapters tomorrow. Wish Soylent had a "sci-fi" category...

Coming soon: The Paxil Diaries

Posted by mcgrew on Sunday February 23 2014, @03:47PM (#83)
2 Comments
News

This journal probably fits the other site better, since I don't think any of my old fans have come here yet, but I did say I'd post journals here first.

Ten years ago K5 was thriving, and my diaries got popular there. Folks wanted me to make a book out of them, and I promised I would.

I never got around to it, despite people periodically nagging me to. I finally did put together a PDF. I'd excised much of it, thinking it was too long, and emailed copies to those who asked.

Last Fall when I released the hardcover of Nobots I was again chided to get The Paxil Diaries on cellulose.

I'd discovered that no, it wasn't too long at all, and the abridged version was too short. So I redid the whole thing. I've been working on it almost exclusively for months and neglecting Mars, Ho! which I haven't done anything to since fall.

All that's left before publication is registering a copyright (it's half done in another tab), registering an ISBN (I have nine in reserve) and making a cover.

The cover is the sticking point. It's going to be a photo of downtown Springfield with Betty Boop photoshopped in, and I'm waiting for Springtime to take the photo.

So if anyone reading this has been urging me to release a physical book, I'm projecting sometime in April.

Nobots: The whole book is now online!

Posted by mcgrew on Saturday February 22 2014, @01:35PM (#77)
3 Comments
News

Get it here!

So why did I move the release date up? Soylent! Or rather, a... uh, what do we call ourselves? Folks at K5 used to call themselves Kurobots, at slashdot they're slashdotters. What are we? Soylents? Anyway, a fellow here commented "Damn you! I went to see what your book was about and before I knew it I'm on chapter 7 and feel the urge to finish it tonight (otherwise I wont sleep). I've had plans for tonight..."

I'd just gotten my first check for books that had been sold the day before, but comments like that are even better than the check. I mean, I didn't write it to make money, I wrote it to be enjoyed. I walked around with a smile on my face all day and thought "gee, I need to let that poor fellow finish the book." So now you can!

If you're using FireFox to read it, PDF isn't the version to choose since FireFox sucks at rendering PDFs. It is, however, faithful to the printed version. Actually it was used to produce the printed version, and there may be some words in the HTML versions that should be italicized but aren't, I've found and fixed one or two but I'm sure I've missed some. Also, the PDF and printed versions are Gentium Book Basic while the HTML versions are Times New Roman. There is one passage that is Aral and renders funky in the HTML, and later in the book there's a Venusian nursery rhyme that is Comic Sans Serif in the printed and PDF versions.

I haven't posted the e-book version yet because I'm not satisfied with it.

If you select single file HTML (which you can download, of course) the screen will change only slightly, with links to PDF and e-book missing. Links to chapters are internal links.

I hope you folks enjoy it, that's why I wrote it.