Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

11-13-2017 , 07:15 PM
There is something about those SMB posters. They do like to chase you across forums.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:04 PM
Quote:
Originally Posted by Wolfram
Lol wut??? There's no reason to worry about your devs having different bashrc's. It's a plain text script that sits in the users home directory and runs startup stuff when they open an interactive terminal session. It can be as simple as you want and it doesn't affect anyone that's not using your machine. A normal user will never touch it or just add his personal aliases to it (e.g. alias ll="ls -l")

Baltimore Jones,
If you want to learn more about anything linux related, I recommend the arch wiki. Just google e.g. "arch bash" and you will find very good documentation, albeit a little verbose.
I can't remember but there was some issue we spent a day trying to debug and it turned out to be some dev had a weird .bashrc or bash_profile issue.

As a lead at a big corporation with a big messy set of devs, I need to know all my devs are on the exact same environment.

Last edited by suzzer99; 11-13-2017 at 11:10 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:07 PM
Quote:
Originally Posted by gaming_mouse
+1

as a dev lead you should have no more say about your employees bashrc files that you do about their desktop background.

if we're talking about production machines or docker or something that's another story.
If you know what .bashrc is and you can deal with issues then sure - knock yourself out.

When some dependency asks a dev to modify their .bashrc, then I spend all day trying to figure out what's going on - because this dev is clueless and doesn't even know what .bashrc is much less remember tweaking it - then I have a problem.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:08 PM
Quote:
Originally Posted by kerowo
The only problem with config files is on the Mac when they change from build to build or deployment to deployment and path settings spread over .bashrc .bash_profile and whatever, although it’s only really bad when you let someone else give some magic that you don’t understand and it stops working.
Nailed it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:14 PM
You guys are weird, this is my entire .bashrc

Code:
alias gp="git push origin HEAD"
alias gm="git merge --no-ff"
alias gco="git commit -am"
alias gla="gulp lint-all"
alias gs="git status"
alias gf="git fetch --all"
alias gd="git diff"
alias gr="git reset --hard"
alias gpu="git pull origin HEAD"
alias gl="git log"
alias gc="git checkout"
alias gft="git fetch --tags"
alias ga="git add -A"
alias gca="git add -A && git commit --amend -m 'amend'"
alias la="ls -la"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:36 PM
Quote:
Originally Posted by suzzer99
I can't remember but there was some issue we spent a day trying to debug and it turned out to be some dev had a weird .bashrc or bash_profile issue.

As a lead at a big corporation with a big messy set of devs, I need to know all my devs are on the exact same environment.

I’m going to talk out of my ass and say that forcing everyone to use the exact same environment is going to cost you a lot more than this one error.

Not just in their lost productivity but in alienating a lot of awesome devs that are out there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:39 PM
I use a fairly different build environment than most of the devs on the projects I work on. But I know that, and if I have a problem I can't figure out, I go back to the stock build env before involving anyone else. My env choices are my own problem.

(Mostly, I run unit tests in a non-standard way, where I get much finer control via my IDE than you normally would, because it's a lot faster)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:40 PM
Quote:
Originally Posted by Baltimore Jones
One of my fellow bootcamp grads (we've been working just over 2 years) told me about feeling embarrassed at work for not having a full understanding of what .bashrc is (I barely know what it is as well and just use what's either standard at my company and/or copied from others when I first started). This is something that most CS grads know. For CS grads - where did you learn that? How would you recommend a non-CS grad learn it?

Of course we can look it up and just get the answer that way and have an idea of what it is, but I'm assuming that in some CS class[es] you drilled down deep and have a strong understanding of shell scripts, Bash, Unix, etc. (Or maybe that's an erroneous assumption.)


I don’t think we ever had any classes that went deep into things like shell scripts. I remember one class had ‘negative value assignments’ (if you didn’t do the assignment you lost something like 5% of your final grade) that tested basic Unix commands and tools. They were simple and just meant to introduce tools to people.

Most knowledge about these things came from work or playing around.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:44 PM
BTW, I go back and forth on the utility of using docker, but where it really shines is dev environments. We used to have a multi page procedure doc on how to get a build env set up. Now it is literally "install docker, check out repo, and run docker-compose up"

And recently I have been working on making linux packages for a product, and testing installation on a bunch of machines. It is *so easy* to do repeatable tests with docker, because I get to start with a clean "machine" every time, in the flavor of my choice. I can make a change to the package, restart the docker container, and reinstall as if I'd never installed it before. It's kind of finicky because it's a bootstrap install - you are getting a custom package from a web server that has some things specific to you baked in, so there's a lot of back and forth. I would be pulling my hair out if I didn't have SOME kind of cleanable VM to use.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:49 PM
I'm not at all experienced with backend webdev and am having some sql woes. I'm using sequelize which is a javascript ORM of sorts. I have a threads table and a comments table trying to make a basic forum/commenting type app. I want to get the 5 most recent comments from the 5 most recently updated threads. Yet apparently putting a limit on an associated object doesn't work so great in sequelize.

ie

Code:
Thread.findAll({
  include: [{
    model: Comment,
    limit: 5
  }]
)
does not work.

Now I've dug up some github issues and sql tricks on how to get the data I want,
https://github.com/sequelize/sequelize/issues/1897
https://stackoverflow.com/questions/...he-first-table

but I"m more concerned with how I should go about this? Is doing the n+1 queries to get the comments even a bad practice? At what # of queries does it become a problem? I've also considered just trimming the results before sending the response. Should I just use whatever the ORM api provides to write my own query?

If you were looking over a prospective employees github would making n+1 queries or over fetching data be a red flag? I'm kind of in a weird spot of having some knowledge about these kinds of things but not enough experience to know whats standard and what becomes a performance problem very quickly.

Thanks and sorry for the briandump.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-13-2017 , 11:58 PM
I really don't like ORMs. SQL is not that complicated.

So I guess what your solution is, is to get the top 5 threads, and then do 5 queries to get the top 5 comments in each thread? In some database systems, that's about the best you can do. I'm pretty sure you could do it in one query in postgres, using the "over" partitioning syntax. This page has some examples that I think are near what you want
https://www.postgresql.org/docs/9.1/...al-window.html

I can't think of a way to do it in mysql, in one query, that is very good. It's been too long since I've used oracle or sqlserver to even have an opinion on those.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 12:04 AM
Quote:
Originally Posted by suzzer99
As a lead at a big corporation with a big messy set of devs, I need to know all my devs are on the exact same environment.
Yeah I'm not a fan of this. Out of curiosity, what was the issue you had with a dev changing their environment? At my job we tend to have build scripts set (or check) important environment settings before running the build.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 12:27 AM
Yo suzzer, I gotta +1 the other fellas. Whatever you think is a problem with bashrc is really a problem with something else.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 12:59 AM
Quote:
Originally Posted by jjshabado
I’m going to talk out of my ass and say that forcing everyone to use the exact same environment is going to cost you a lot more than this one error.

Not just in their lost productivity but in alienating a lot of awesome devs that are out there.
Again - if you know what you're doing knock yourself out. I'm not going to force you to do anything.

It was something that required a change to .bashrc that I had to spend all day debugging on a dev's computer who *did not* have any idea what he was doing.

I can't remember what the exact situation was. So I will drop this until it comes to me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 01:00 AM
Quote:
Originally Posted by Baltimore Jones
Of course we can look it up and just get the answer that way and have an idea of what it is, but I'm assuming that in some CS class[es] you drilled down deep and have a strong understanding of shell scripts, Bash, Unix, etc. (Or maybe that's an erroneous assumption.)
At my school, it really depends on which classes you pick. You can graduate not touching shell scripts or you can graduate with lots of experience with it.

I had two classes that gave a deep dive into it, which I'm glad we did since I use it every single day at work. I don't technically remember all the commands but I'm familiar enough to know what to google. And doing that can really increase your productivity.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 01:01 AM
Quote:
Originally Posted by goofyballer
Yeah I'm not a fan of this. Out of curiosity, what was the issue you had with a dev changing their environment? At my job we tend to have build scripts set (or check) important environment settings before running the build.
Quote:
Originally Posted by iversonian
Yo suzzer, I gotta +1 the other fellas. Whatever you think is a problem with bashrc is really a problem with something else.
It wasn't a rock star dev like all of us here obviously. Any dev who knows what they're doing and wants to customize I am fine with. I customize the hell out of my environment, but I know how to figure it out when something isn't working right. I have a whole other set of issues to worry about with offshore devs and spotty contractors.

But I can't remember the issue so I will defer. I just remember spending all day trying to debug some dev's path issue or something. We checked the profile and found nothing. Finally figured out the issue was in some .bashrc file that had somehow been modified. (Or it could be the other way around.)

You guys seriously haven't lived until you've had offshore and onshore devs to look after. I spent a good 8 hours trying to figure out why some offhore devs couldn't log on. Turns out they were using localhost instead of local.[company].com. So the cookie wasn't being set. Well that and some other issues. But it was fun.

Last edited by suzzer99; 11-14-2017 at 01:06 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 02:01 AM
Speaking of offshore. We might be getting a NOC(?) to take care of our oncall issues in the next quarter. If this goes through, it's basically a salary bump and I'll be so happy. I hate having to schedule my life around on-call even though I only go on once every 2.5 months.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 02:37 AM
We have some stuff in bash_profile that sets environment variables for certain dev setup and artifactory. I also have some custom preferences (like seeing which git branch I'm using on the prompt).

I also have a similar file for vagrant that port forwards and some vmware configs.

I assumed they are mostly set it and forget it configs, and while I'm sure the errors are not obvious, when I was helping that senior engineer with her environment, one of the first things I did was check out her vagrant file to make sure it was correct looking.

The first things I was asked when I first started when asking questions was if I had the right bash_profile and I had sourced it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 05:59 AM
I remember recently making a ./bash_aliases file (in Linux Ubuntu), and the ./bashrc file automatically loads the ./bash_aliases file, so you can keep them separate.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 08:23 AM
Suzzer, I don’t know how to reconcile your two posts. Saying everybody has to have the exact same environment isn’t the same as saying people can customize stuff as long as they know what they’re doing.

The problem is that a bunch of people think they know what they’re doing but don’t. I just think that the problems caused by these people are worth it for the benefits you get with people that do know what they’re doing (source: my ass).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 08:56 AM
Speaking of configs, I found this on HN this morning:

it was incredibly stable and a simple matter of telling the mkinitcpio config to use the amdgpu module and not the radeon module when building the initramfs.

For the configs Grue has, I'd be using bash in /usr/local/bin.

I have stuff like "emacs -mm" which just forces emacs to open in full screen.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 10:05 AM
Quote:
Originally Posted by Grue
You guys are weird, this is my entire .bashrc

Code:
alias gp="git push origin HEAD"
alias gm="git merge --no-ff"
alias gco="git commit -am"
alias gla="gulp lint-all"
alias gs="git status"
alias gf="git fetch --all"
alias gd="git diff"
alias gr="git reset --hard"
alias gpu="git pull origin HEAD"
alias gl="git log"
alias gc="git checkout"
alias gft="git fetch --tags"
alias ga="git add -A"
alias gca="git add -A && git commit --amend -m 'amend'"
alias la="ls -la"
Your git aliases should be in ".gitconfig" -- that's what it's for. I do alias "g" to git though in my .bashrc.

Also, I know you're just joking, but customizing your bashrc isn't weird. It's really useful and most experienced command line users do it, for the same reason you do anything ergonomic.

Since you use git alot, eg, you'd immediately benefit from git completion:

Quote:
# autocomplete git branch names
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
https://github.com/git/git/blob/mast...ompletion.bash
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 11:23 AM
Everyone who doesn’t work in a windows environment should learn basic shell scripting if for no other reason than to see what the really olds thought about UI and syntax, nothing beats spending an hour on a script only to find you do need a space between operators and characters....

I think what Suzzer is trying to say is that newbs using standard build environments is a good thing. It’s one of those rules you should learn before breaking...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 11:44 AM
When you phrase it in the general terms, I guess?

But there's a lot of pretty trivial things you can configure (aliases, formatting, editor preferences, random tools, etc.) that I can't imagine ever telling new devs they can't touch the config files.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-14-2017 , 12:04 PM
Quote:
Originally Posted by kerowo
Everyone who doesn’t work in a windows environment should learn basic shell scripting if for no other reason than to see what the really olds thought about UI and syntax, nothing beats spending an hour on a script only to find you do need a space between operators and characters....
I actually think that's the wrong lesson. The details of syntax are often the part bash gets "wrong" -- and someone new to programming might see the stuff like "if... fi" (and plenty others) and think, "lol, why would i learn this outdated weird-looking nonsense when i can just script in python or ruby?"

and that would be completely missing the point, because unix/bash get all the big things right -- the whole system is based on functional pipelines. in fact, that's a massive understatement, because not only is the basic design right, it's way better than the design of majority of all the latest hot ****.

so i'd say the reasons to learn it would be 1. understand an example of great design 2. learn to "see through" syntactic details that don't really matter but that newbs are obsessed with 3. it's just practical to know
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m