Thursday, May 29, 2014

My php[tek] Schedule


20.May.2014



Build your first Symfony2 application (09:00)
Stefan Koopmanschap
My Notes
Their Slides



Hacking Sites for Fun and Profit (14:00)

David Stockton
My Notes
Their Slides



21.May.2014



Inside the Tech Challenges of Wikimedia (09:00)
Terry Chay
My Notes
Their Slides


Accelerating Web Applications with Varnish (10:30)
Samantha QuiƱones
My Notes
Their Slides
Adaptive Delivery - The other responsive (12:00)
Josh Trout
My Notes
Their Slides
Building scalable PHP applications using Google’s App Engine (14:00)
Ian Barber


My Notes
Their Slides
Becoming a GoPHPer (15:30)
Paddy Foran
My Notes
Their Slides
JavaScript's Difficult Concepts (17:00)

Jeff Carouth
My Notes
Their Slides
22.May.2014



How to Get There (09:00)
Larry Ullman
My Notes
Their Slides
From SQL to noSQL (10:30)

Derick Rethans
My Notes
Their Slides
Obtaining Closure with Anonymous Functions (12:00)
Andrew Cassell
My Notes
Their Slides
How To Be A Great Developer (14:00)
Ed Finkler
My Notes
Their Slides
HHVM in 2014 (15:30)
Elizabeth Marie Smith
My Notes
Their Slides
Groking Browser Performance (17:00)
Josh Holmes
My Notes
Their Slides
23.May.2014

Shell Revolution (10:30)
Chris Stone
My Notes
Their Slides

How to Get There - Notes

My Notes From: How to Get There
https://joind.in/10668
@LarryUllman

Walk Long Enough

* Knowledge
    Know Thyself
    Understand Your Brain
    Say "I Don't Know"
    Except That You Could Be Wrong
    Learn How To Ask Questions The Smart Way
    Rethink Brilliance
    Never Stop Learning
    Get Off the Computer

* Experience
    Be Honest
    Try
    Fail Quickly
    Learn to Fail Gracefully
    __Add Exception Handling to Your Life__
    Vary Your Strategies
    Watch Your Assumptions
    When You Can, Start Helping Others
    Being a Decent Person Matters

* Money
    Rethink How You Think About Clients
    Communicate Well
    Value Time
    Give It Away
    Do More Than You Say You'll Do

TLDR;
Be Honest
Work Hard
Never Stop Learning

Inside the Tech Challenges of Wikimedia - Notes

My Notes From: Inside the Tech Challenges of Wikimedia
https://joind.in/11352
Musics & Silly Video
joind.in/event/phptek2014

Inside the Challenges of Wikipedia
PHP Terrorist
Middle Management
Does a good job of upselling talks the rest of the day.

** Frames
Using "Tax Relief" already frames the debate so you win.

*** Core Values
Vision Statement

** Features Engineering
Minions
 Visual Editor Team UI/UX
 Affordance (Discovering without thinking)

 Parsoid Team (Parsing)
 JQuery and still JQuery because V8 is fast enough

 Growth Team
 Viral Coefficient
 A/B Testing

 Core Team
 Gameification Habit Loop
 Cognitive Excess (Farmville vs. Wikipedia)
 Echo & Flow (Notification & Messaging)

 Fundraising and Engineering
 Data-Driven Framing
 "X Tagged You In a Photo" - People want photos.
 Data-Informed Framing

 Services
 Service Oriented Architecture Framing

 Challenge: Mobile
 He really likes Josh
 Desktop vs Mobile PageViews
 "Dimensionless Numbers" -> Use Comparisons to Other Numbers
 Current mobile strategy was trumped up when compared to global mobile usage.

 Challenge: Resistance to Change
 Arrows Impossibility Theorem
  - unrestrictred domain, non-dicatorship, pareto efficitency, independance of irrelevant alterntaives.
  - Initial distribution of goods is inherently inefficient.

** Parting Shot
Imagine Internet as City
 Public spaces on the Internet (Park, Museum, Church)

* There are only 60,000 users and they are all dicks to each other.

Shell Revolution - Notes

My Notes From: Shell Revolution
https://joind.in/10644
*Chris Stone

Black window puts fear in their heart.

Lost Art...
ls,mv,cp,ps,echo
Fish,Screen,Mosh,Vagrant

Fish Shell Script - Chris says look into it, but it wasn't his cup of tea.
Screen - Detach and reattach sessions/sockets
MOSH - The MObile SHell
    New, but built by MIT
    Roaming
    Drop In replacement of SSH
    Mac = mobile-shell, Linux = mosh
    No Terminal Scrollback
Vagrant
    Manage virtualization providers
    Support for Docker containers
    Gets rid of "works for me"

PHP straight on the CLI
    $argv[]
    get_options()

SED
    Parse and Tranform Text
    sed 's/regexp/replacement/g' inputFile > outputFile
    Find and replaces string and write to new file

AWK
    ps ax | grep Dropbox | awk '{print $1}'

NANO
    He doesn't like VI very much. Nano is good for quick and dirty work.

Resources
    edx.org - Courses Online

TMUX

Groking Browser Performance - Notes

My Notes From: Groking Browser Performance
https://joind.in/10620
Josh Holmes
slideshare.net/joshholmes

* Define Performance
* Web Runtime Architecture
* Performance Measurment Tools
* Demos

Fewer DOM Elements is better
Fewer CSS Rules are better
Fewer Lines of Script

JQuery off the CDN actually makes a big difference.
Performance is a very odd duck.

Network/CPU/GPU are important things to think about.

Web Runtime Archetecture Flow Chart (Networking to Compositing)
6 items are able to be loaded from a server at the same time.
More subdomains -> More connections available
If you had wildcard subdomains would that just be really awesome?

DOM Tree -> CSS -> JS -> DOM API
Layout is just a great game of Tetris

JS rewriting the DOM can cause rewrite thrashing.
60hz = 60fps

F12 Developer Tools

UI Responsiveness Tool

If you aren't going to use a script code don't include it.
It'll affect render time even if it does nothing.

You can check for Memory leaks by taking memory snapshots and comparing

requestAnimationFrame will allow things to run at the current framerate

Creating a valid display tree can take a long time.
Be careful how you ask for it.

Debugger can ignore any library code so it doesn't get debugged.
You don't have to walk through minified code... because that's terrible.

HHVM in 2014 - Notes

My Notes From: HHVM in 2014
https://joind.in/10623
HipHop Compiled PHP to C
JIT (Just In Time Compiler)
HPHPc is dead.
Runs anywhere on 64-bit x86 Linux
Plug and Pray.

Splat and Variadics Syntax

Easy to install on Ubunutu (Binaries!)
45 Dependancies

Working on making it more open source.
Pushing people toward FastCGI Drop in.

HHVM Bytecode Interpreter
Won't see any performance improvements on a Mac without JIT

"Repo Authoratative Mode" assumes no changes so you get 10% performance gain.

Large Complex codebases show great results.
Quicker response and more responses.

phpng is an official PHP JIT.

Politics of open sourcing
    Feedback from users
    Affect change in the market place
    Competition
    Cross pollination

Hack -> Google via hacklang/hack.lang
    Strict typing
    Type hinting
    Static analysics

Don't run Hack in strict because it'll say your code is BAD BAD BAD
Run in partial mode so it'll behave.
Change the syntax in your file by putting a comment after
Constructor arg promotion
    Removes a bit of boiler plate code.
Generics
    Placeholders for type are allowed
Collections
    Specialized array objects, not just an Array/Hash Table
    Frozen/Mutable
Async Functions
    Implementation isn't complete
    Parallelizing
XHtml for PHP
    Sees complete blocks of HTML as long as they are properly formatted/closed
    Don't need to use double quotes

HPHPd -> Debugger

Extensions
    Normally Messy
    You can write a HHVM extension in PHP
    You can write parts of an HHVM extension in C++ because blurring lines is fun.

PHP is Edgecase hell due to lack of a spec.
Compatibility layer for PECL extensions.
No Name Parameters

How To Be A Great Developer - Notes

My Notes From: How To Be A Great Developer
https://joind.in/10624
C64 Theme

*Practice Empathy

Understand how/why a person feels.
Most important skill.
Don't assume you know how a decision was made.
Keep in mind users and rest of the team.
    Asking questions in a non judgemental way.
    "Can you explain to me why you did things this was?"
    Developers interact with computers on the edgecase.
    UIs/UXs/Tablets

*Practice Humility

You are wrong about a great many things.
The less you fear being wrong, the more confident you can be.
    Nobody has maxed out thier technical level of expertese.
    Gender/Cultural politics.
Understand what you do well, and what you don't

*Always be Learning

Liberally learn new tech, conservatively use them.
Any tech could be the right choice for the right situation.

*Avoid Tribalism

Make it a safe place.
Choices in tech only search what you make.
Nothing should be absolute (pro or con)
    100% Advertising
X vs Y arguments isn't worth the time.
Loyalty to people, not brands/companies/tech

*Better Your Community

Make other's lives better.
Make the community around you better.

Obtaining Closure with Anonymous Functions - Notes

My Notes From: Obtaining Closure with Anonymous Functionshttps://joind.in/10657
Andrew Cassell
Loves Closures!
Normal Regular Named Functions. 
Boring!

Lambdas
$sum = function () { return true; }
echo $sum;

Lambdas are instance of Closure

callable, or Closure are good for type hinting.

Anonymous Functions aren't scary.

function($a) {return $a; }

Lambda and Closures have scope.

$LperGal = 10;
$galToL = function($gallons) use ($LperGal) {
echo $gallons * $LprGal;
}
echo $galToL(10);

Pass by reference... &$LperGal if you want to edit the value.

Closures have..
bindTo
--- bind ----
--- __invoice ----

bindTo changes the scope of $this when used inside the function.

Reasons to use.
Don't pollute namespace with functions.
Fewer function names laying around - reduces cruft.
Map/Reduce/Filter
array_map, array_reduce
Database
Currying
Memoization????
Monads
Dependancy Injection

Don't use function_create or the Closure::bind .... because???

Curry/Database Display using his funky library.
Database ORM thing that's popular in Russia??

Memoization -> the same as caching
Just storing stuff in an array to avoid double computation.

Monads -> MonadPHP
Allows you to focus on just making sure the data you want is available instead
of testing all the data.... I think??

From SQL to noSQL - Notes

My Notes From: From SQL to noSQL
https://joind.in/10640
Derick Rethans
@derickr

Relational Database
    Row/Colum/Table/Results
    Normalization -> 1NF/2NF/3NF

Key/Val -> MemCache/Redis
Column -> Cassandra/Hadoop
Graph -> neo4j
Document -> CouchDB/MongoDB

Relational Databases value ACI
Theoretical Ideas.

NoSQL solutions value CAP
Consistency/Availability/Partition Tolerance

*Document
Must have an _id field
Schemaless
Documents can have embedded documents or embedded arrays.
Duplicated data in a NoSQL is not a bad thing, but more complicated.

Don't need to create database and schemas.
$m = new MongoClient;
$m->dbname->steps->insert([name => 'derick']);

Use single quotes everywhere.
Query operators start with a $ so that can be obnoxious for PHP.
Greater than or Equal -> '$gte'

Update
Inc, Set, Unset, '$addToSet', '$push'

Use and Atomic value like INC (increment) to avoid race conditions.

No Schema, No Schema Validation, No Checks and Balances.
Having a good model becomes very important.

Don't use values as keys. ie derick => 'twitter user'

Not inforced foriegn keys are allowed
IE: blog post content with blog post views
Article collection and Views collection.
Probably keep a Article View Counter in the article collection rather than counting on the view collection.

Master/Slave Replication
Master/Slave Replication with Failover
Multi-Master Replication
Sharding

Maximum of 12 server in a Replicaset

Eventual Consistency
    Only Gaurantee Perfection by reading from Master
    A delay of seconds to slaves is probably acceptable in most cases.

Wednesday, May 28, 2014

JavaScript's Difficult Concepts - Notes

My Notes From: JavaScript's Difficult Concepthttps://joind.in/10647
This is all Vanilla JavaScript.
Nothing about JQuery or MooTools or whatever.

*Scope

Global vs Function
Always use **var** keyword when you name a variable inside a function.
Declare all variables at the top of your function.

*Context

The **this** keyword
callbacks are commonly used in JS???

The __this__ keyword and the context within the function depend entirely on how the function was invokes.

The default context will be the global context for functions invoked by name or variable name within the global context.

.call() is how you use __this__ properly. --> Switch the context of this.
.apply() is different.. allows more params??
Yeah!

Using .call and .apply gives you the control you might need over the context inside a function or method

The **ProtoType Chain**
"The most complicated inheritance model ever created"
Classless, Instance Based

// ** Use a Capital Letter for the function name as a Construction
function Person(name) {
    // blah
}
Person.prototype.talk = function() {
    return "wah";
}

Always use Function.prototype to add methods to your constructor functions for performance reasons.

// Extend the Person object
function Dev(name) {
    Person.call(this, name);
}
Developer.prototype = Object.create(Person.prototype); // Inherit
Developer.prototype.constructor = Developer; // Override constructor type

// Override
Developer.prototype.talk = function() {
    return "wooo";
}

All Objects have the prototype through which we can accompolish inheritcan in JS

Recommendations!!

Becoming a GoPHPer - Notes

My Notes From: Becoming a GoPHPer
https://joind.in/10650
Paddy Foran

* What is It?

Modern Magic C
The language was designed.
No Manifests -> Code should be self documenting
Nothing is automagic
Automate with tools -> Allow Tools to update your code for newer versions
Meant to Innovate Programming Practice
A Philosophy Driven Language rather than a Feature Driven Language.

* What is Wierd?

Go is compiled
Go is a system language, not a web language by design
Packages are the equivalient of Library/Namespaces
"main" is a special package.
It is the entry point.
Packages are imported from code repos
Go uses **structs** instead of Classes -> like JS
Structs can be combined.. that's odd.
Static Typing
Initialization is not assignment i := 0
Garbage Collected normall though.
Scope is pickier about shadowing, but can notify you on compile (modifying inside foreach loop)
Visibility is Lexicographic
    Capitalize first letter in variable makes it public (PublicVariable vs privateVariable)
Pass By Value, not Pass By Reference
You have to use &Pointers to get things to work like we are used to.

* What is Good?

go build -> Build
go test -> Automated Testing using Testing Library
go fmt -> Automated Code formatting
go get -> Fetches the dependancies
race detector, test coverage, profilers
runtime environment is the operating system (actually globally works?)
stdlib http server is production ready
Interfaces are "Duck Taping"
Concurrency: GoRoutines -> Threads
    go RunThisThingThreaded(x, y) // That's concurrent Kyle

* What is Hard?

Static Types
No Frameworks
No time waiting for Go to compile

* After Hours

Vendors -> No specific way to do it. Hopeful the community will make a decision.

Building scalable PHP applications using Google’s App Engine - Notes

My Notes From: Building scalable PHP applications using Google’s App Engine
https://joind.in/10618
*Ian Barber
**Google Developer Relations

There's a command line tool for Google stuff.

Scale Up or **Down** based on usage.
Free to start
PaaS, IaaS

php-minisell.appspot.com

GeoLocation is included in the Request.
You don't get to see proper traffic because it isn't a proper server. It's an app.

Normal PHP gd/json/simplexml PHP 5.4.22
Read Only File System (Google Cloud Storage)

Google URL Fetching Service is automatically used for fetching.
Can't use cURL

Modules - His "Single Favorite Thing" about AppEngine
Scaling modules manually (fixed) or basic (max num) allow control

YAML configs.
Handlers are like Mod Rewrite - Redirect everything to index.php
Static Content you need access to, use static_dir config

app yaml
api yaml
dispatch yaml
queue yaml
cron yaml
dos yaml (DDOS)

**Storage
CloudSQL (MySQL 5.5/5.6)
Cloud Data Store (Schemaless, NoSQL) - FREE TIER!
CDS available via REST API

Reading -
Google_Client() is a bit overly verbose (support for PHP 5.2)
Authentication you may as well use Google_Client for that because it's a huge pain.
Data Store using the Google_Client means highly optimized connection.

Caching -
Memcache - One big pool. No charge for usage. You can pay for fewer evictions by paying for storage.
'Cache-Control' http header. (Classical Gas)

Writing -
Google_Service_Datastore_CommitRequest()
Faster if you type your properties (int/string/etc)
Mutation Upsert

Logging -
Developers Console already takes care of it.
syslog writes to the dev console logging

Polymer Ajax -> Just another Buzzword JS/Display Framework?

Sign In -
Oath - PHP Google Service

Deployment -
appcfg.py --oauth2 update api.yaml app.yaml
git push appengine master (configure for automatic deployment)

Is the Queue good?
Mostly not. One way queue.
You just submit the request and cross your fingers.

A bunch of "Messaging Stuff" in the pipeline.

Data center closest to the user will start new machines if neccessary.
Cloud Data Service runs similar for closes geography.
CloudSQL is a much more normal VM of a DB.

Adaptive Delivery - The other responsive - Notes

My Notes From: Adaptive Delivery - The other responsive
https://joind.in/10656
* The Other Responsive
Responsive -> **Client** adapts the site
    CSS(Media Queries) / Javascript / Single Code Base
    More CSS Code that everybody downloads - More Processing time.
    Less Testing / Less Debugging

Adaptive Delivery -> **Server** adapts the site
    Networking to multiple code bases
    Single code base for different content

Device Definition Library
    WURFL (Community Version) -> Plugin to Apache
    Giant XML file with API

Gannett's Solution
    Dual application with shared library of code
    Network level adaptive delivery handled by Akamai (Same URL)

7" Tablets get Mobile Layout
10" Tablets get Desktop Layout

Lower end mobile devices don't support scroll support, but do have touch.
They use a "..." for clicking instead of scrolling.

And... he's done early.

Accelerating Web Applications with Varnish - Notes

My Notes From: Accelerating Web Applications with Varnish
https://joind.in/10648
* About Me
Varnish is the first real revolutionary tech encountered

Static content continues to dominate the web
No One Likes Stale

Dynamic content is expensive to delivery but cheap to maintain

Content Delivery via HTTP (Historical)

Dynamic Backends
Databases! Venerable! Relational!
More and More Complex Databases Start to Be Terrible

SQL Query is Relational Algebra

Cacheing
Eliminate repeated interactions at cost of freshness.
Increases performance of course (throw in front of a DB)
Reddis: Cache and Datastore are starting to merge.
Cacheing proxies

Memcache is developer focused
CDN is not flexible
Static Pre-Rendering
  Just render all files statically and serve those
  Hides terrible performance
Cache Reverse Proxies
  Symfony2 Comes with a Reverse Proxy

Varnish 3 (Varnish 4 exists and is cool/fun)

Virtual Memory is a cache!
Caching-Reverse Proxies.. Squid writes objects to disk, written to memory when requested

Varnish works within the Operating Systems VM.
Trusts the kernel to do the kernel's job.

varnish-cache.org
varnish-software.com

VCL is Varnish Config Language (You can Inline C Programming if you are crazy)
VCL is compiled into memory and can be hard to configure

-f VCL file to load
-s Config storage
-T Where Varnish listens for admin
-a Where Varnish listens for HTTP

Backend - Apache, NGINX, etc.
Can use a cluster of backends.

Logical clusters of backends

Load Balancing to Varnish Server.
Varnish Server to Load Balanacing to Origin Servers.
Round Robin to a bunch of servers.

Directors are rules that Varnish follows so you can tell Varnish how to run

Probes
Kind of Object Oriented VCS. Something about Varnish 4.

ACLs
Bypass the proxy for local clients.

Hooks
Pre-defined points in the request-response cycle.
recv,pipe,pass,hit,miss
fech,backend_fech,

Grace Mode
If it can't access a resouces you can make it return the last available resouce.

Saint Mode
Return expired objects
200/50x

Managing Varnish
Command Line Interface is available

Purging is pretty simple.
PURGE /obsolete/resource
Clears memory
Not instantly happening

Banning Objects
Never delivery from cache, always origin.
Is Instant, but doesn't clear memor.

Vary
gzip/deflate are usually variations of the same thing so no need to try both.

Edge Side Includes
Varnish supports a subset of ESI
esi:include
esi:remove

Replaying Traffic
A log that can be played on cold Varnish to warm it up

Complex
A programming language that you have learn.
Default is an ugly flow chart.
It is C so you can break it easily.

Politico doesn't use memcached now.
All services live behind varnish servers.

Varnish -> Application -> Varnish -> API

VCL has "Objects" that are modular.
Modular Stuff!

Varnish does suport SSL (according to the documenation)

A/B Testing Server Side stuff would be terribly more difficult than the JS stuff we do.

Hacking Sites for Fun and Profit - Notes

My Notes From: Hacking Sites for Fun and Profit
MailCatcher
SQL Injection

?id=5 and 1=1
?id=5 and 1=2
?id=5 and substring(@@version)

XSS send session to another site.

Filter Input. Escape Output.

Command Injection
Escape Shell Arg

Code, Regex, Log, LDAP Injection

Session Puzzling

** Admin Password From the Forgot Password Form
Forgot Password with Username "admin" and email of registered user.
Emailed to the user without any problems.

** Registration Form
username1').('email', 'fist2', 'last2', 'x', 'pw2', 'username2'
first
last
email
password

** Search Input
Passing the input unescaped into a grep command. *; ls -al
gouda *; cat....

** Dev Mode
http://192.168.33.199/apigility/ui#/

Hackathon On Wednesday
Get involved in OpenSource and a Project

Build your first Symfony2 application - Notes

My Notes From: Build your first Symfony2 application
https://joind.in/10662
** Framework Overview

** History
Mohave
Standard Distribution

** Use Composer
"Doc-Treen"
composer create-project symfony/framework-standard-edition myProject/ 2.4.4

777 app/cache
777 app/logs

app directory is where all the app stuff lives.
bin directory containst a couple binaries
src where all custom code
vendor third party librarires
web is document root

assetic is a thing

use composer again!

config/config.yml
config/routing.yml
config/security.yml

Resources

** Web Directiory
app.php
app_dev.php
bundles

** Bundles
controllers, entities, views, configs, forms, etc.

** Libraries
Composer install should update all the things.

app console generate:bundle
namespace - then Bundle becuse you need to name bundles "Bundle"

He prefers annotation configuration
app/AppKernel.php

routing.yml??

app/console cache:clear
sudo app/console cache:clear

** Doctrine Databases
He's having problems... Ooops.

app/console doctrine:generate:create
app/console doctrine:generate:entity

app/console doctrine:schema:update --dump-sql
app/console doctrine:schema:update --force

Doctrine Migrations??
Not going to show you those right now.

app/console doctrine:generate:crud

Doctrine has a soft delete extension.
Remove removes it from the database hard.

Make sure you have a service layer between your controller and doctrine.
It's the best practice.

** Twig!
Define Blocks

** Forms!
Forms! Objects! Validation!
PostType extends AbstractType

Just reviewing the automatically generated code for form.

Group Validators ??

Propel (http://propelorm.org/) is an alternative to Doctrine.

** Services

Creating a PDO service from scratch.
When creating a PDO service don't register a service for "/PDO" but use "PDO" instead

Never inject the container because it's untestable.

Sunday, January 5, 2014

Raspberry Pi as TimeMachine

Install the 2013-12-20 Wheezy Rasbpian disk image on an SD card. This will probably work fine on later versions, but I'm being overly specific.

You'll probably want to install a new user instead of the usual pi/raspberry user so follow the guide I wrote here: Change the Default Pi User.

Install vim because great Caesar's Ghost I can never get vi to work right.
sudo aptitude install vim
 Change your hostname because you don't need any extra devices on your network called "raspberrypi"
sudo vim /etc/hostname
sudo vim /etc/hosts
I called mine "BackupPi" because I'm so clever and interesting.
Install enough tools to allow your Macs to find your Pi.
sudo aptitude install avahi-daemon netatalk
Restart your Pi so that you know nothing went crazy.
sudo shutdown -r now
Connect a hard drive to the USB port formatted as EXT4. I don't care how it is done, just do it. Mine shows up as /dev/sda1 but yours might be different.
Now mount your drive.
sudo mkdir /media/external
sudo chmod 775 /media/external
sudo chgrp pi /media/external
mount /dev/sda1 /media/external
Test it to make sure you have proper access to it.
touch /media/external/test_touch
Okay, good work. Now make sure it mounts on boot.
sudo vim /etc/fstab
Add an additional line to the configurations.
/dev/sda1      /media/external      ext4      defaults,rw      0      0
Restart your Pi so that you know nothing went crazy and your disk will auto mount.
sudo shutdown -r now
After it comes back hopefully you can see what is in your drive.
ls /media/external
If you don't see what you are hoping for something went wrong. Crap. Sorry.
If you get to see the test_touch file you created before, congratulations. You did it!
Now you need to get your Mac to know that what you created is a good spot to put your backups. Make a copy of the original settings and create a new file.
sudo mv /etc/netatalk/AppleVolumes.default /etc/netatalk/AppleVolumes.original
sudo vim /etc/netatalk/AppleVolumes.default
Put the following in the new file:
:DEFAULT: options:upriv,usedots
/media/external "External Storage" options:tm allow:@pi
Save it and restart. Cross your fingers.
sudo shutdown -r now
Once it restarts You should be able to easily see that there is a machine with shares available on my network with the name you chose previously. Mine is "BackupPi" and it has a shared folder of "External Storage" so now just tell Time Machine to backup to that folder.

Saturday, January 4, 2014

Create Your User on Raspberry Pi and Remove the Default

Since Raspbian comes with a standard user/password for all installs it makes some sense to create your own user/password combination in an attempt at some security.

I'm going to be creating the user "spoon" and deleting the user "pi" today.
sudo adduser spoon
This command will prompt you for a lot of information. Fill in as much as you want. The password bit is the only real important part.

You want to make sure the user "spoon" has the same groups as the user "pi" so checkout the groups that pi is in.
groups pi
Now set those same groups to the user spoon. I like to see they are exactly the same so using these commands sets them in the exact same order
sudo usermod -g pi spoon
sudo usermod -G gpio,spi,input,netdev,users,games,plugdev,video,audio,sudo,cdrom,dialout,adm,pi spoon
Now compare them to make sure they are the same. These two commands should look identical.
groups pi
groups spoon
Lastly, log out, login as your new user, verify you have sudo power, and nuke the user "pi" out of the sky.
sudo deluser -remove-home pi