2016-08-16 UTC
KevinMarks, mindB, mindB2, KevinMarks_ and rascul joined the channel
AngeloGladding joined the channel
# 05:02 rascul i got distracted reading about soveriegn identity
# 05:02 AngeloGladding hey rascul, KevinMarks_
# 05:03 AngeloGladding i wanted to abstract 63-69 out of download function so that other distro-specifics could be handled at the main level
# 05:04 AngeloGladding KevinMarks_ is there dynamic "source"ing going on in those files or what do you want me to be looking at?
# 05:04 AngeloGladding rascul: my problem specifically was..
# 05:04 rascul btw i don't think fbsd has wget installed by default, but it does ship with fetch
# 05:04 rascul so that might go into the os specific stuff also
# 05:05 AngeloGladding cool.. i imagine ammending this file until it is utterly grotesque -- that'll make me feel complete
# 05:05 AngeloGladding once I've got a nice clean Python3 env I can get back to my purity
# 05:06 AngeloGladding so i'll remember that
# 05:06 AngeloGladding but my problem..
# 05:06 AngeloGladding setting shatemplate
# 05:06 AngeloGladding shatemplate="SHA1 ($filename) = $sha1sum"
# 05:06 AngeloGladding setting that inside the function allows me to use the variable
# 05:07 AngeloGladding setting it outside the function.. is there any hope?
# 05:07 AngeloGladding the local variables $filename and $sha1sum
# 05:07 rascul you want to set it in the function but also use it outside the function?
# 05:07 AngeloGladding i want to rip that conditional out of `download()`
# 05:08 AngeloGladding i don't know really a) if it's possible or b) how
# 05:08 rascul ahh, so that should already be set before download()
# 05:08 AngeloGladding was the idea
# 05:08 KevinMarks_ No, more that I end up writing python scripts that call other python scripts and do their own directory walking rather than using shell for it
# 05:09 rascul essentially, move that whole if block to near the top of the script, before it gets to anything important, take out the lines that specify local for those variables, and adjust function calls to not pass those
# 05:09 rascul so you're basically making those global variables and running the steps to set them right at the beginning
# 05:10 rascul KevinMarks_ is that python script just for recursively copying files around?
# 05:14 AngeloGladding KevinMarks_: have you ever solved the "source" a Py2 env from Py3 script or vice versa?
# 05:15 AngeloGladding oh ok.. no need for locals.. everything proceeds in a single execution thread anyway..
# 05:15 AngeloGladding let me read those links you gave me, set up a testing environment and rerun w/ the changes
# 05:15 rascul don't do any of those changes yet though, just focus on the download stuff
# 05:16 rascul read them and implement that stuff (if you so desire) later, once you get the download stuff changed and working
# 05:18 AngeloGladding yeah and i want to give you the quickest feedback
# 05:18 AngeloGladding give me a couple of minutes
# 05:21 AngeloGladding so are you saying turn `local urlbase=$1` to `urlbase=$1`?
# 05:22 AngeloGladding maybe you can advise a better overall approach
# 05:22 AngeloGladding to lines 38-90
# 05:23 AngeloGladding just download, verify and unpack
# 05:24 AngeloGladding i'm tempted to turn it into python but I've been down this path before..
# 05:25 AngeloGladding i'm certain bash can handle it
# 05:27 rascul urlbase can stay local, but local isn't really necessary here because there's not a global $urlbase
# 05:27 rascul move lines 63-69 up to the top, line 15 or so
# 05:28 rascul you might need to declare $shafunc and $shatemplate before that though
# 05:28 rascul oh, looks like that's all you might need to do
# 05:29 rascul you can also set other os specific stuff in those if statements if necessary so they'll apply to the entire script
# 05:30 AngeloGladding the if statements contain the variable names from the download() function though
# 05:31 AngeloGladding so when those strings are set, outside of the context of download() they appear to evaluate to ""
# 05:31 AngeloGladding so define them outside of the if statements?
# 05:32 rascul that's what you wanted? or did i misunderstand?
# 05:32 rascul btw you should "quote" all those variables on lines 85-89
# 05:32 AngeloGladding so $shatemplate contains variables that are set inside the download() function
# 05:33 rascul also every time you cd "$variable" it should be quoted
# 05:33 AngeloGladding i'm having a hard time describing the problem
# 05:33 AngeloGladding do you see what i'm talking about?
# 05:33 rascul hold on, lemme make a few changes and show you so you can let me know if i'm thinking the same thing you are or not
# 05:35 rascul i'm also kinda drunk so my human interpretation skills might be subpar right now
# 05:37 AngeloGladding several beers in myself
# 05:37 AngeloGladding conclude the conversation at any time
# 05:37 AngeloGladding i've got some reading to do
# 05:38 AngeloGladding on bash that is
# 05:38 AngeloGladding do you see my problem though w/ $shatemplate?
# 05:39 AngeloGladding that's the crux
# 05:39 AngeloGladding $shafunc is fine because its static
# 05:39 AngeloGladding $shatemplate is reliant upon the variables passed into download()
# 05:40 rascul i'm adding a slight bit of spice for you to ponder over too, almost done
# 05:45 AngeloGladding to state the obvious you can exit out after the first call to download, supply the script with six arguments and test away
# 05:51 rascul i think i got it, lemme look and make sure i did it right
# 05:52 AngeloGladding i'm still here
# 05:54 rascul nevermind, ijust thought of something then discarded it
# 05:58 AngeloGladding i see your changes
# 06:00 AngeloGladding if "type -p sha1sum > /dev/null && shafunc=$(type -p sha1sum)" isn't a trick i don't know what is
# 06:00 AngeloGladding VOODOO MAGIC!
# 06:00 AngeloGladding carry on
# 06:00 AngeloGladding i searched the google for cross-platform shell scripting
# 06:00 AngeloGladding didn't find a canonical resource
# 06:01 AngeloGladding seems like this kind of thing would be solved on stackoverflow or s/t
# 06:01 AngeloGladding or like a forum circa '97
# 06:01 AngeloGladding totally n00b here lookin' for some guidance :)
# 06:02 rascul line 17 means you can do 'shafunc=sha1sum ./plant_sapling.sh' and skip the os check
# 06:03 rascul you might not use it or care for it, but i mostly did it to show you that trick
# 06:04 rascul the $shatemplate actually could be set in the if statements up top but i didn't feel like trying to remember how to do that
# 06:04 AngeloGladding quite the situation i've backed myself into here..
# 06:05 AngeloGladding i guess.. fuck it..?
# 06:05 AngeloGladding a bit of verbosity won't kill a bootstrap script
KevinMarks joined the channel
# 06:06 AngeloGladding but can you describe your line 17 magic?
# 06:06 rascul also because of the if at line 26 it will exit instead of trying magic it can't do
# 06:06 rascul If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
# 06:07 rascul it's more useful for setting default values and letting them be overridden from the environment
# 06:07 AngeloGladding so what is the word in this case?
# 06:08 AngeloGladding interesting
# 06:08 AngeloGladding alright
# 06:08 rascul so that way the if on the next line sees that it's empty and figures it out, or sees that it's set and skips the os check because it's not necessary
# 06:08 rascul but then if it's not set right, the stuff in download() will go bonkers though
# 06:09 AngeloGladding real quick
# 06:09 AngeloGladding did you pick up on my question earlier about "source"ing a virtual env from within a python script?
# 06:09 rascul feel free to use it or not, i mostly just put it there to show you that trick
# 06:09 AngeloGladding i'm learning everything about bash at this point
# 06:10 AngeloGladding no python?
# 06:10 AngeloGladding no venv?
# 06:10 rascul i setup single purpose users for stuff that people like to use virtualenv for
# 06:11 rascul then i can pip install --user whatever and not care
# 06:11 AngeloGladding ahh.. --user flag
# 06:11 rascul no need for hacky stuff when it's so simple to begin with
# 06:11 AngeloGladding haven't used it but heard of it
# 06:11 AngeloGladding kind of a pseudo-venv
# 06:12 AngeloGladding alright
# 06:12 AngeloGladding envs are kinda hard to manage
# 06:12 rascul because it's a spearate user specifically and only for that app
# 06:12 AngeloGladding interesting..
# 06:12 AngeloGladding how about a VPS setup
# 06:13 AngeloGladding i'll check that out as well
# 06:13 AngeloGladding i'll read about those bash changes you've recommended
# 06:13 rascul no need for that fancy crazy hacky stuff to do what linux has done since the beginning
# 06:14 rascul for dev stuff it's much more useful because you probably don't want to play with different users all the time
# 06:14 rascul but that's not something i've ever had to concern myself with for my stuff
# 06:14 AngeloGladding but for deployment.. so far all hosts provide multiple users..
# 06:14 AngeloGladding that's probably the best takeaway here
# 06:15 rascul then you can use the os permission and ownership concept and acls and stuff to tune priviledges and whatnot as needed
# 06:15 rascul and at that point it's all simple, basic stuff that every admin knows and loves
# 06:16 AngeloGladding i'm going to ponder the consequences of each sober
# 06:17 AngeloGladding and i'll keep you apprised
# 06:17 rascul i can give examples, i host python and php and whatever the same exact way
# 06:17 AngeloGladding could simplify things a bit
# 06:18 AngeloGladding so what about system packages
# 06:18 rascul create new user, install app into home, throw a new config file in nginx and uwsgi, live happily ever after
# 06:18 AngeloGladding do they carr over?
# 06:19 rascul and install the stuff in requirements.txt with the versions
# 06:19 rascul and pip will ensure you have the appropriate version installed
# 06:20 AngeloGladding the options
# 06:20 rascul if you have the correct version already installed system wide, pip won't bother installing it in ~
# 06:20 AngeloGladding i feel like that'd be great on a single-user VPS but then i think of my dev machine
# 06:20 AngeloGladding i'd love the installer to work in both contexts
# 06:21 AngeloGladding and shit
# 06:21 rascul just need a --venv and a --user options, and require one of the two
# 06:21 AngeloGladding the whole point of needing to source was this:
# 06:21 AngeloGladding my setup requires supervisord which requires 2.7
# 06:21 AngeloGladding and my code is written in 3.x
# 06:21 AngeloGladding is that compatibile
# 06:22 AngeloGladding that's how py's venvs are making me feel
# 06:23 AngeloGladding so the script is downloading nginx, redis, creating a py27 for supervisor to manage nginx, redis, a uwsgi app, a background task manager and a crawler, .. more to come
# 06:24 AngeloGladding manage all the things
# 06:24 AngeloGladding and more to come
# 06:24 AngeloGladding damnit loqi not now
# 06:25 rascul uwsgi can run as a service and handle the process management type stuff
# 06:26 AngeloGladding swarm is a task manager.. sequentially fulfilling bg tasks..
# 06:27 AngeloGladding kaleidoscope is a semantic crawler
# 06:27 AngeloGladding canopy is a uwsgi app
# 06:27 AngeloGladding i intend to have at least a bittorrent app as well
# 06:27 AngeloGladding *definitely* going to have more manageable services
# 06:27 AngeloGladding so while i hate that i need a second env to accomodate supervisor
# 06:27 rascul nginx and redis are probably already setup to be capable of running as system services, managed by init
# 06:28 AngeloGladding is that even a thing for VPS?
# 06:28 AngeloGladding init is a weak spot of mine
# 06:29 rascul freebsd is a bit different, and i don't currently have any freebsd boxes
# 06:29 AngeloGladding debian is most familiar
# 06:29 rascul same conce3pts apply on fbsd though, they just do it a little differently
# 06:30 AngeloGladding well i suppose the more important one is my host
# 06:30 rascul then probably systemctl enable uwsgi-emporer; systemctl start uwsgi-emporer
# 06:30 AngeloGladding webfaction: CentOS
# 06:31 AngeloGladding that requires su?
# 06:31 rascul i don't know much about centos, but probably almost the exact same thing applies
# 06:31 AngeloGladding vps don't got no r00t
# 06:32 AngeloGladding asteria is not in the sudoers file. This incident will be reported.
# 06:32 AngeloGladding not vps?
# 06:33 AngeloGladding i'm targeting the lowest cost hosting
# 06:33 rascul vps though is the lowest cost hosting you could target
# 06:33 rascul this doesn't appear to be something you could do generally with shared hosting
tantek joined the channel
# 06:35 AngeloGladding and that'll give me root?
# 06:36 rascul then you can do essentially whatever you want
# 06:36 AngeloGladding of course...
# 06:37 rascul i can give you referral for digitalocean, you get $10 credit
# 06:37 AngeloGladding 100% of the other homebrew attendees are on 1&1 and GoDaddy..
# 06:37 AngeloGladding homebrew club LA that is
# 06:37 AngeloGladding i know....
# 06:40 AngeloGladding keep it simple
# 06:40 AngeloGladding or do it right
# 06:40 AngeloGladding supervise everything out of the home dir and support as many providers as possible
# 06:41 AngeloGladding now i see i have realistic options
# 06:41 AngeloGladding thought root-level hosting was out of the price range
# 06:42 AngeloGladding sheesh.. gettin' tired
# 06:42 AngeloGladding i'll look into my options tomorrow
# 06:42 AngeloGladding just want to get my code live on all the hosts
# 06:43 AngeloGladding just want to get my code live on all the things
# 06:43 AngeloGladding don't leave me hangin' loqi
# 06:44 AngeloGladding you rascal
# 06:45 AngeloGladding don't even know where to begin
# 06:45 AngeloGladding called loqi a rascal for not meming my last statement
# 06:45 AngeloGladding clearly i've been brainwashed by your username
# 06:45 AngeloGladding and am delerious at this late hour
# 06:45 AngeloGladding + too much bash
# 06:46 AngeloGladding and i'm angelo
# 06:46 AngeloGladding nice to meet you ray
# 06:46 AngeloGladding verbatim.
# 06:47 AngeloGladding get rascul.io live and i'll add it to my crawl
# 06:47 rascul costs too much for .io when i can get domains for $1
# 06:48 AngeloGladding but your github
# 06:49 AngeloGladding static html derived from a rust generator
# 06:49 AngeloGladding and we come full circle
# 06:50 AngeloGladding wow man
# 06:50 AngeloGladding check my github in the next couple of days
# 06:50 AngeloGladding i feel the same way
# 06:51 AngeloGladding `canopy-software` should obviate github
# 06:51 AngeloGladding alright
# 06:51 AngeloGladding i'll see you in the chat no doubt
# 06:51 AngeloGladding RASCAL!
KevinMarks_, KevinMarks, tantek, loicm_ and AngeloGladding joined the channel
rMdes joined the channel
mindB, doesntgolf, cmal and rMdes_ joined the channel
rMdes_, singpolyma, ChrisAldrich, KevinMarks, mindB, gRegorLove and rMdes joined the channel
# 16:07 aaronpk omg i just realized i have a very short path to implement my collection posts again
cmal joined the channel
rMdes_ joined the channel
# 16:38 gRegorLove aaronpk: this-week uses the locations listed on /events, right, not the p-location on the event permalink?
doesntgolf joined the channel
# 17:15 gRegorLove It's confusing. It looks at the event permalink to get the photo, so it seems it would look there for locations too.
chrisaldrich1 and KevinMarks joined the channel
# 18:11 aaronpk correct, it only gets the photo off of the permalink. everything else is from the list
# 18:12 aaronpk would probably be a good idea to use the permalink info for that too, but hey that's what happens when this code slowly grows
# 18:30 aaronpk one commit from 2 years ago, and that's nothing like the code that's running now :P
rascul joined the channel
# 19:13 GWG I am having some structural problems with Vouch.
AngeloGladding joined the channel
# 19:24 GWG aaronpk, how I can implement it in WordPress effectively.
# 19:25 GWG It has one small change to help Webmentions
# 19:25 gRegorLove GWG: I think ben_thatmustbeme's method is a good guide. I followed that, at least.
# 19:26 GWG I have three more that I hope to get into 4.7
# 19:26 gRegorLove record referrers, async verify they link to you, store verified ones as possible vouches.
# 19:29 GWG Gregorlove, you know WordPress structure, any ideas? I am giving some serious thought to writing in preliminary support in my experimental plugin.
# 19:29 GWG I am stalled on my other project so I think I could use a switch.
# 19:30 GWG Of course, now I have to check all my plugins for 4.6 compatibility issues.
# 19:31 aaronpk speaking of upgrades, Laravel 5.3 is almost released, so i'm going to have to upgrade my site to that soon
# 19:32 GWG I am worried about race conditions
# 19:35 gRegorLove (I'm presuming you mean sending and receiving Vouch, btw. Referer stuff is needed only for sending.)
# 19:40 GWG I worry about expensive queries in wp cron.
rMdes joined the channel
# 19:55 gRegorLove I process only one row at a time, but that's mainly because of the latency of getting the URL's HTML and verifying it links back.
# 19:56 gRegorLove Which reminds me I need to do some heuristics about huge pages. Ran into a problem with it trying to verify a huuuuge page (which was spam)
# 21:24 aaronpk always a little terrifying updating dependencies. hopefully all of these changes are backwards compatible.
chrisaldrich_, KevinMarks and singpolyma joined the channel
# 23:10 rascul how do i make {{rascul}}
on the wiki go to User:Rascul.xyz instead of User:Rascul.io?
KevinMarks joined the channel
# 23:23 aaronpk now i want to add a map interface so i can search by location!
KevinMarks and ChrisAldrich joined the channel
# 23:36 Loqi rascul has 36 karma (1 in this channel)
# 23:39 rascul hrm much of the let's encrypt section needs changing also
# 23:39 bear yea, letsencrypt section hasn't been touched since alpha
# 23:40 bear rascul++ for keeping security info fresh
# 23:40 Loqi rascul has 37 karma (2 in this channel)
# 23:42 aaronpk would you assume search results on my site would be in reverse chronological rather than by highest relevancy?
# 23:46 rascul i think maybe relevancy, but an option to sort chronologically might also be nice
# 23:47 aaronpk i think i'mg oing to default to reverse chronological until i come up with a use case for sorting by relevancy
# 23:47 rascul i'm going to look more at the https page later, got some things to do for a bit
KevinMarks and KevinMarks_ joined the channel