• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. NaNoWriMo Starts Next Week! Who's Participating?

      This will be my third attempt over the last 5 years but it'll also be the first time I have real time to dedicate to actually doing this. I'm really, really excited. I have a Chromebook now so...

      This will be my third attempt over the last 5 years but it'll also be the first time I have real time to dedicate to actually doing this. I'm really, really excited.

      I have a Chromebook now so I'll likely be writing primarily on Google Docs. What are your writing plans? By hand? Scrivener?

      20 votes
    2. Have you ever had a lucid dream?

      I never have, and I find it both fascinating and exciting that people can control exactly what happens in their dreams. Has this ever happened to you, and if so, does it happen regularly? Are they...

      I never have, and I find it both fascinating and exciting that people can control exactly what happens in their dreams. Has this ever happened to you, and if so, does it happen regularly? Are they generally good or bad experiences for you?

      20 votes
    3. [Weekly] What'd You Munch This Week?

      hey all! i see these kinds of posts in ~music where people talk all about what they're listening to that week, what they checked out for the first time, what they really enjoyed or hated. i...

      hey all!

      i see these kinds of posts in ~music where people talk all about what they're listening to that week, what they checked out for the first time, what they really enjoyed or hated. i thought it'd be cool to do a food version!

      did you try a new recipe this week? how was it?

      eat at a cool new restaurant?

      try a new dish that you absolutely loved / hated?

      grab a plate and dive on in!

      7 votes
    4. What does the online / social media world look like to you, what would you want?

      Some of you may have heard that Google+ will be shutting down in August, 2019. Though much criticised (including by me), the site offered some compelling dynamics, and I've reflected a lot on...

      Some of you may have heard that Google+ will be shutting down in August, 2019. Though much criticised (including by me), the site offered some compelling dynamics, and I've reflected a lot on those.

      I'm involved in the effort to find new homes for Plussers and Communities, which has become something of an excuse to explore and redefine what "online" and "social" media are ("PlexodusWiki").

      Part of this involves some frankly embarrassing attempts to try to define what social media is, and what its properties are (both topics reflected heavily in the recent-changes section of the wiki above).

      Tildes is ... among the potential target sites (there are a few Plussers, some of whom I really appreciated knowing and hearing from there), here, though the site dynamics make discovering and following them hard. This site is evolving its own culture and dynamics, parts of which I'm becoming aware of.

      I've been online for well over 30 years, and discovered my first online communities via Unix talk, email, FTP, and Usenet, as well as (no kidding) a computerised university library catalogue system. Unsurprisingly: if you provide a way, especially for bright and precocious minds to interact with one another, they will. I've watched several evolutions of Internet and Web, now increasing App-based platforms. There are differences, but also similarities and patterns emerging. Lessons from previous eras of television, radio, telephony, telegraphy, print, writing, oral traditions, and more, can be applied.

      I've got far more questions than answers and thought I'd put a few out here:

      • What does online or social media mean to you? Is it all user-generated content platforms? Web only? Apps? Email or chat? Wikis? GitHub, GitLab, and StackExchange?

      • Is social networking as exemplified by Facebook or Twitter net good or bad? Why? If bad, how might you fix it? Or is it time to simply retreat?

      • What properties or characteristics would you use to specify, define, or distinguish social or online media?

      • What emergent properties -- site dynamics, if you will -- are positive or negative? What are those based on?

      • What are the positive and negative aspects of scale?

      • What risks would you consider in self-hosting either your own or a group's online presence?

      • What is/was the best online community experience you've had? What characterised it? How did it form? How did it fail (if it did)?

      • What elements would comprise your ideal online experience?

      • What would you nuke from orbit, after takeoff, just to be sure?

      • Are you or your group seeking new options or platforms? What process / considerations do you have?

      I could keep going and will regret not adding other questions, but this is a good start. Feel free to suggest other dimensions, though some focus on what I've prompted with would be appreciated.

      19 votes
    5. a few poems

      i'm slightly bored and ~creative hasn't had a lot of posts recently so i guess i'll toss some of my lot in here. here's some of the mediocre stuff i pen up more or less without editing in my off...

      i'm slightly bored and ~creative hasn't had a lot of posts recently so i guess i'll toss some of my lot in here. here's some of the mediocre stuff i pen up more or less without editing in my off time. i have plenty more of these, but most of them require so much context that it'd be a pain in the dick to post them, so they're not likely to see daylight here any time soon. anyways

      (note: now hopefully with less formatting fuck ups, lol.)


      quick, general scribbles

      scribble, scribble [unfinished]

      No, you don’t matter—
      you don’t matter, matter, matter…
      like a symphony of voices in
      the night, their uproarious cacophony
      of noise inescapable,
      rumbles—shaking. No sleep
      to be found, no—you don’t matter…
      Sleep is impossible, escape is…
      impossible. Draw your mental curtains
      in every window and bolt every lock shut—
      shut in… shut in with the noise, no you
      don’t matter, matter, matter—
      Why do you shut yourself in? Why
      do you shut yourself inside if you matter?
      The voices tremble with fury—but peaceful
      they are compared to the noise, echoing, booming—
      If you did matter you wouldn’t hide!
      You wouldn’t refuse to face the music, oh
      if you mattered you’d admit that you’re crazy.
      If you mattered the voices wouldn’t be. The
      thoughts wouldn’t be. They wouldn’t be, no—
      you don’t matter, matter, matter…
      some symphony of voices the voices can be—
      rattle like a rattle, regurgitating the same sound—
      endlessly, on loop. Never enough to deafen the
      thoughts, the thoughts never enough to silence
      the voices. If you mattered you’d be free
      of the voices, you see. Just another crazy
      person you are. All alone, you and me...

      Bor · der · line

      Always, when meeting, be skeptical.
      Be cynical, so when the deal falls through
      you can pretend you never wanted
      what was offered to you in the first place.
      Pretend it doesn’t hurt every time
      to tear everything down from day one when
      you know it’s irrational action—
      when you know if you could just be “normal”…
      Go through the process a hundred times
      over, stay up every night thinking
      why it has to always be this way
      and why you’re like this, why you’re so crazy—
      never change, always an amorphous
      blob of a person, never able to
      fit into anything, to be what
      you truly want to be, deep down. Normal.
      Such is the life of an internet
      vagabond—a sacrifice to the great
      altar of the untreated mental
      illness—crucified by their loneliness.


      some stuff for my grand worldbuilding

      Time (1921) // by Donas Beyten-Aytek

      A dragon always cares for time,
      for often he knows that it does rhyme.
      And always grows up with the fable,
      of the dragon that was able.
      For ‘once in time’ a dragon ruled,
      and ‘once in time’ that dragon fooled.
      So ‘once in time’ that dragon lied,
      and ‘once in time’ that dragon died.
      And now a dragon lives with fears
      of the changes time endears,
      and hopes that time will one day cease
      and leave his life alone in peace.
      But no more is it ‘a’ dragon alone,
      instead it is all which to fear is prone.
      In face of time, no dragon is steady.
      In face of eternity, no dragon is ready.

      Dragons will not hail to a tyrant (1981) // by Tadin Aledi Geren

      Dragons will not hail to a tyrant—
      that much must be made clear
      and shouted for the world to hear.
      For a dragon enslaved and martyred—
      on the altar of Bira, their blood spilled—
      can never by any man be killed.
      Yet dragons long have been enslaved—
      by despot, by tyrant, by foreign power—
      and it seems always the dragon should cower.
      But soon, one day soon, the dragon
      will rise from their ashes, from their grave
      and find a dragon world to save.

      Revolution (2009) // by Nesye Kalane-Aiselain

      Revolution means nothing
      if you don’t act.
      If you don’t let the hillsides ring
      with upstart revolutionary zeal
      you are no true revolutionary—
      you are no better than a tyrant king!
      You can’t be a revolutionary
      if you never let the proletarians sing.

      6 votes
    6. Good use for Twitter?

      I hear a lot about how Twitter is a bad concept, because the character limit means things can be oversimplified, taken out of context, and posted without a source. I've never used it myself, but...

      I hear a lot about how Twitter is a bad concept, because the character limit means things can be oversimplified, taken out of context, and posted without a source. I've never used it myself, but recently I've been wondering if it can be useful to me. For example, some bloggers I follow might post some insights on Twitter that they don't anywhere else, and help me discover other interesting blogs.

      Have you found a good use for Twitter besides as a social network or news aggregator?

      13 votes
    7. I feel like one of the biggest digital losses of the last five years was the rise and fall of independent news networks

      There was a brief (an oh-so-brief) period in youtube history where all types of non-corporate content thrived. I'm referring, if memory serves, to the timespan from around 2011 - late 2014. This...

      There was a brief (an oh-so-brief) period in youtube history where all types of non-corporate content thrived. I'm referring, if memory serves, to the timespan from around 2011 - late 2014.

      This was after youtube initially got big, but before Google decided that it wanted to step in and maintain the cultural status quo rather than redefine it. Ad revenue paid creators fairly-ish in most cases, and the talk of the town was machinima assfucking it's segment of poor souls that signed into it, rather than youtube pulling the same moves universally as it did a few years later.

      (Suffice to say I have no love for the platform).

      It's important to note that at this time, Youtube was a bit like a small-scale television enterprise, before it dreamed of deliberately becoming one. Youtube had everything from animations to product reviews, news to reality programming to VFX extravaganzas.

      One of the most incredibly important innovations of the time, and one that's been all-but-lost, was the birth (and subsequent heat-death) of youtube news channels.

      These channels mirrored cable news, but without the influence of corporate sponsors getting in the way, and without the ravenous need to appease political parties and harebrained cable tv viewers. They were biased - good god were some of them biased - and they weren't perfect, but they were set up in such a way that, had youtube not fucked it up (sigh...) they might've someday dethroned CNN, MSNBC and Fox.

      With the next election coming up and shaping up to be a small-scale repeat of 2018s (you're kidding yourself if we're every going to go any other direction than further down at this point - after all, it works!) it's important to remember that there was, for a beautiful gleaming moment, a chance for not a corporation, but a community, to rise up and redefine the way people received news in a way that hadn't been seen since the conception of the newspaper.

      Instead, youtube squandered it. Real events and engaging content don't generate views. People can't sit and watch hours of current events like they do for whatever-the-hell youtube trends nowadays (list videos and toy openings, I guess?), and why would they? If you get on youtube to watch today's news, you're not going to stick around for yesterday's. So youtube's 'algorythm', a word I've come to absolutely detest, doesn't favor them just like it doesn't favor basically anything else that once made youtube great.

      The icing on the cake: rather than embrace even a tertiary aspect of the community, they went for the safe option and the ad revenue. No Phillip Defranco for you, we'll show you Jimmy Kimmel. No TYT, we'll fill trending with clips of CNN, MSNBC and Fox News. The only real survivor of the era was infowars.

      Here's to you, youtube news. Dead and gone, but not forgotten.

      9 votes
    8. Light Analysis of a Recent Code Refactor

      Preface In a previous topic, I'd covered the subject of a few small lessons regarding code quality. Especially important was the impact on technical debt, which can bog down developer...

      Preface

      In a previous topic, I'd covered the subject of a few small lessons regarding code quality. Especially important was the impact on technical debt, which can bog down developer productivity, and the need to pay down on that debt. Today I would like to touch on a practical example that I'd encountered in a production environment.


      Background

      Before we can discuss the refactor itself, it's important to be on the same page regarding the technologies being used. In my case, I work with PHP utilizing a proprietary back-end framework and MongoDB as our database.

      PHP is a server-side scripting language. Like many scripting languages, it's loosely typed. This has some benefits and drawbacks.

      MongoDB is a document-oriented database. By default it's schema-less, allowing you to make any changes at will without an update to schema. This can blend pretty well with the loose typing of PHP. Each document is represented using a JSON-like structure and is stored in something called a "collection". For those of you accustomed to using relational database, a "collection" is analogous to a table, each document is a row, and each field in the document is a column. A typical query in the MongoDB shell would look something like this:

      db.users.findOne({
          username: "Emerald_Knight"
      });
      

      The framework itself has some framework-specific objects that are held in global references. This makes them easily accessible, but naturally littering your code with a bunch of globals is both error-prone and an eyesore.


      Unexpected Spaghetti

      In my code base are a number of different objects that are designed to handle basic CRUD-like operations on their associated database entries. Some of these objects hold references to other objects, so naturally there is some data validation that occurs to ensure that the references are both valid and authorized. Pretty typical stuff.

      What I noticed, however, is that the collection names for these database entries were littered throughout my code. This isn't necessarily a bad thing, except there were some use cases that came to mind: what if it turned out that my naming for one or more of these collections wasn't ideal? What if I wanted to change a collection name for the sake of easier management on the database end? What if I have a tendency to forget the name of a database collection and constantly have to look it up? What if I make a typo of all things? On top of that, the framework's database object was stored in a global variable.

      These seemingly minor sources of technical debt end up adding up over time and could cause some serious problems in the worst case. I've had breaking bugs make their way passed QA in the past, after all.


      Exchanging Spaghetti for Some Light Lasagna

      The problem could be characterized simply: there were scoping problems and too many references to what were essentially magic strings. The solution, then, was to move the database object reference from global to local scope within the application code and to eliminate the problem of magic strings. Additionally, it's a good idea to avoid polluting the namespace with an over-reliance on constants, and using those constants for database calls can also become unsightly and difficult to follow as those constants could end up being generally disconnected from the objects they're associated with.

      There turned out to be a nice, object-oriented, very PHP-like solution to this problem: a so-called "magic method" named "__call". This method is invoked whenever an "inaccessible" method is called on the object. Using this method, a database command executed on a non-database object could pass the command to the database object itself. If this logic were placed within an abstract class, the collection could then be specified simply as a configuration option in the inheriting class.

      This is what such a solution could look like:

      <?php
      
      abstract class MyBaseObject {
      
          protected $db = null;
          protected $collection_name = null;
      
          public function __construct() {
              global $db;
              
              $this->db = $db;
          }
      
          public function __call($method_name, $args) {
              if(method_exists($this->db, $method_name)) {
                  return $this->executeDatabaseCommand($method_name, $args);
              }
      
              throw new Exception(__CLASS__ . ': Method "' . $method_name . '" does not exist.');
          }
      
          public function executeDatabaseCommand($command, $args) {
              $collection = $this->collection_name;
              $db_collection = $this->db->$collection;
      
              return call_user_func_array(array($db_collection, $command), $args);
          }
      }
      
      class UserManager extends MyBaseObject {
          protected $collection_name = 'users';
      
          public function __construct() {
              parent::__construct();
          }
      }
      
      $user_manager = new UserManager();
      $my_user = $user_manager->findOne(array('username'=>'Emerald_Knight'));
      
      ?>
      

      This solution utilizes a single parent object which transforms a global database object reference into a local one, eliminating the scope issue. The collection name is specified as a class property of the inheriting object and only used in a single place in the parent object, eliminating the magic string and namespace polluting issues. Any time you perform queries on users, you do so by using the UserManager class, which guarantees that you will always know that your queries are being performed on the objects that you intend. And finally, if the collection name for an object class ever needs to be updated, it's a simple matter of modifying the single instance of the class property $collection_name, rather than tracking down some disconnected constant.


      Limitations

      This, of course, doesn't solve all of the existing problems. After all, executing the database queries for one object directly from another is still pretty bad practice, violating the principle of separation of concerns. Instead, those queries should generally be encapsulated within object methods and the objects themselves given primary responsibility in handling associated data. It's also incredibly easy to inadvertently override a database method, e.g. defining a findOne() method on UserManager, so there's still some mindfulness required on the part of the programmer.

      Still, given the previous alternative, this is a pretty major improvement, especially for an initial refactor.


      Final Thoughts

      As always, technical debt is both necessary and inevitable. After all, in exchange for not taking the excess time and considering structuring my code this way in the beginning, I had greater initial velocity to get the project off of the ground. What's important is continually reviewing your code as you're building on top of it so that you can identify bottlenecks as they begin to strain your efficiency, and getting those bottlenecks out of the way.

      In other words, even though technical debt is often necessary and is certainly inevitable, it's important to pay down on some of that debt once it starts getting expensive!

      7 votes
    9. Let's talk best-practice Jenkins on AWS ECS

      [seen on reddit but no discussion - if it's not okay to seek out better discussion here after seeing something fall flat on reddit, I am very sorry and I'll delete promptly] I've had some...

      [seen on reddit but no discussion - if it's not okay to seek out better discussion here after seeing something fall flat on reddit, I am very sorry and I'll delete promptly]

      I've had some experience in this realm for a while now, but I'm having a little trouble with one issue in particular. Before I divulge, I'll present my thoughts on best practice and and what I've been able to implement:

      • Terraform everything (in accordance to terragrunt's "style guide" i.e. organization)
        THIS IS A BIG ONE: for the jenkins master task, make sure to use the following args to make sure jenkins jobs aren't super slow as hell to start:
      -Djava.awt.headless=true -Dhudson.slaves.NodeProvisioner.initialDelay=0 -Dhudson.slaves.NodeProvisioner.MARGIN=50 -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85
      

      THIS IS A GAME CHANGER (more-so on k8s clusters when the ecs plugin isn't used... hint, it's shit).

      • Create an EFS (in a separate terraform module) and mount it to the jenkins ECS cluster at /var/jenkins_home. Makes jenkins much more reliable through outages and easier to upgrade.
      • Run a logging agent (via docker container) like logspout or newrelic or whatever IN USER_DATA and not as a task - that way you get logs if there are issues during user_data/cloud_init... this I'm actually not sure about. Running a container outside the context of an ECS task means the ECS agent can't really track it and allocate mem/cpu properly... but it does help with user_data triage.
      • Use pipelines and git plugins to drive jobs. All jenkins jobs should be in source control!
      • Make sure you setup docker cleanup jobs on DAY 1! If you hace limited access to your cluster and you run out of disk due to docker cache, networks, volumes, etc... you're screwed till the admin ssh's in and runs a prune. Get a docker system prune going or the equivalent for each docker resource with appropriate filters... i.e. filter for anything older than a few days and is dangling.
      • Use Jenkins Global Libraries to make Jenkinsfiles cleaner (I always just use vars instead of groovy/java style packages because it's easier and less ugly)
        Jenkinsfiles should mostly call other bash files, make files, python scripts to generate and load prop files, etc. The less logic you put in a Jenkinsfile (which is just modified groovy) the better. String interpolation, among other things, is a fuckery that we don't have time to triage.
      • (out-of-scope) Move to using k8s/EKS instead of ECS asap because the ECS plugin for jenkins is absolute shit and it doesn't use priority correctly (sorry whoever developed it and... oh wait abandoned it and hasn't merged anything for years... for for real it's cool, just give admin to someone else).
      • (cultural) Stop calling them slaves. "Hey @eng, we're rotating slaves due to some cache issues. If you have been affected by race conditions in that past, our new update and slave rotation should fix that. Our update may have killed your job that was running on an old slave, just wait a few and the new slaves will be ready" <--This just doesn't look good.
        Hope that was some good stuff for you guys. Maybe I'm preaching to the choir, but I've seen some pretty shit jenkins setups.

      NOW FOR MY QUESTION!

      Has ANYONE actually been able to setup a proper jenkins user on ECS that actually works for both a master and ephemeral jenkins-agents so that they can mount and use the docker.sock for builds without hitting permission issues? I'm talking using the ecs plugin and mounting docker.sock via that.

      I have always resorted to running jenkins master and agents as root, which means you have to chmod files (super expensive time and cpu for services with tons of files). Running microservices as root is obviously bad practice, and chmod-ing a zilliion files is shit for docker cache and time... so I want to get jenkins users able to utilize the docker.sock. THIS IS SPECIFICALLY FOR THE AWS ECS AMI! I don't care about debian or old versions of docker where you could use DOCKER_OPTS. That doesn't work on the AWS Linux image.

      Thanks! And happy Friday!

      5 votes