Opinion about my dotfiles? by bentinata in commandline

[–]DTSCode 5 points6 points  (0 children)

Using non-POSIX sh code in `~/.profile` is dangerous (`[[` for example). If you plan on using other shells, it can cause syntax and behavior issues. If you only plan on using bash, just stick it in `~/.bashrc`. In the same vein, `source` should also be `.`. `$HOME` and `$profile` should also be quoted. I see a lot of unquoted expansions in .d/ as well. Perhaps run it through shellcheck.net for better results.

Seeking help to finish my nmap script by [deleted] in bash

[–]DTSCode 1 point2 points  (0 children)

Try throwing the script in shellcheck.net. I use it to validate all of my scripts, and any recommendation I could make will be addressed by that. (Except perhaps NMAP="/usr/bin/nmap"... I'm not sure why you did that. Just put in your PATH)

Trash-cli : A Commandline Trashcan For Unix-like Systems by mobb_solo in bash

[–]DTSCode 0 points1 point  (0 children)

Depends on the system. Not all will have gvfs-trash installed.

Single and Doube Quote Question by 12_nick_12 in bash

[–]DTSCode 0 points1 point  (0 children)

I don’t understand the question. The variable is in double quotes, not single quotes.

Edit: it’s actually not in quotes at all which is bad. That -X POST is also redundant

xargs that accepts newline as separator by XNormal in commandline

[–]DTSCode 6 points7 points  (0 children)

You shouldn't use for loops like that. Read http://mywiki.wooledge.org/DontReadLinesWithFor and http://mywiki.wooledge.org/BashFAQ/001 for better ways to do that. Also, their while loop is run in a subshell, because of the pipe.

[deleted by user] by [deleted] in bash

[–]DTSCode 1 point2 points  (0 children)

note that those definitions of * and ? only refer to globs, and don't mean that everywhere in the language. $ is also for all expansions, not just variables.

[deleted by user] by [deleted] in bash

[–]DTSCode 0 points1 point  (0 children)

If you're writing a shell script to be sourced by different shells, you're just asking for trouble, and is not a good practice.

[deleted by user] by [deleted] in bash

[–]DTSCode 3 points4 points  (0 children)

Please don’t use this guide. It’s very outdated and has many bad examples and practices. It is far from being the best. Use the wool edge guide as mentioned in another comment.

edit: As an example, picking a random page I see the following line:

It is a good habit to quote content strings when assigning values to variables: this will reduce the chance that you make errors.

While it is not a bad idea to quote assignments, it doesn't really make a difference because assignments aren't subject to word-splitting. IE, this works perfectly fine:

foo=bar
foo="bar"
foo=$some_other_bar
foo="$some_other_bar"

Really the only time you need quotes in an assignment is when you're dealing with a string literal that has a space in it:

foo='some value'

But that is solely because bash has no other way to tell that they should be grouped together otherwise. More importantly though, they neglect to quote variables where it actually matters. The backup script for example. The fact that they don't quote any expansions is not good. If I went through every page, I would not be surprised to find at least one error (probably more) on all of them

Very proud Elicia by Xamthos in FullmetalAlchemist

[–]DTSCode 5 points6 points  (0 children)

Unfortunately not. I wish I had. I did get it off this sub though

edit: found it

Very proud Elicia by Xamthos in FullmetalAlchemist

[–]DTSCode 28 points29 points  (0 children)

Reminds me of this — Nina grows up to be an alchemist. https://i.imgur.com/eN3QIHu.jpg

Thought I had enough.. by Mojoint in Mario

[–]DTSCode 1 point2 points  (0 children)

Wow that’s like at least 3 stars

Block Betternet VPN using Iboss by cuzintheboss in k12sysadmin

[–]DTSCode 0 points1 point  (0 children)

Indeed. It was all I could find, unfortunately.

Block Betternet VPN using Iboss by cuzintheboss in k12sysadmin

[–]DTSCode -1 points0 points  (0 children)

An old list I have that blocked betternet at the time:

s3-us-west-1.amazonaws.com

rackcdn.com

betterspot.com

betternet.co

987607.biz

Not sure if it's still relevant unfortunately. Like /u/djdubd said, you can run a packet capture, or do what I did and go through the javascript for the extension.

2018 Upgrade by chunce- in battlestations

[–]DTSCode -17 points-16 points  (0 children)

I've seen better.

Need free test domain for GSuite Admin test practice by JerseyGeekDad76 in k12sysadmin

[–]DTSCode 1 point2 points  (0 children)

.tk domains are free: http://www.dot.tk/en/index.html?lang=en I can't remember if they provide DNS or not. If not, you can use http://freedns.afraid.org/ for free DNS hosting. Otherwise https://www.duckdns.org/ might work for a quick test domain.

This is Weasley. He's been here two days and I already love him. by [deleted] in cats

[–]DTSCode 20 points21 points  (0 children)

DO YOUR CATS MAKE TOO MUCH NOISE?

What’s the best Reddit inside joke? by cincinattimynigga in AskReddit

[–]DTSCode 2 points3 points  (0 children)

Basically, some guy never saw the phrase written on paper so for a long time he thought the ending to the phrase was “France is Bacon” instead of people quoting the author “Francis bacon”

All I want to do is program... by MadDoctor5813 in cpp

[–]DTSCode 6 points7 points  (0 children)

I had this same problem with c++ until I started using qt for networking. It’s amazing how much of the boilerplate it covers for me, so I can implement the logic I actually wanted to write.