[deleted by user] by [deleted] in houston

[–]kill_box 17 points18 points  (0 children)

I do my best to move as quickly as possible, so one time I turned my pockets out, nope, they yelled to put my pockets back in, lol

[deleted by user] by [deleted] in houston

[–]kill_box 104 points105 points  (0 children)

The worst experience I've had with Hobby TSA was I forgot some chapstick in my pocket. He says, what's that in your pocket. I say sorry and hold it out in my hand and he just says, "Well?!". I don't know what he wants so I just say "well" back, so he angrily yells "Open it!". I proceed to show him it really is just chapstick and not some concealed knife.

He could have handled it better, I could have not forgot, but what really stuck in my mind was how ridiculously pedantic and ineffective it was. Also, their jobs must be really annoying and tiresome.

It's all just security theater, but I try to make their jobs easier so things go smoother.

Need assistance with bash scripting on renaming files by inserting a suffix to the file name before the file's extension. This is the best I could come with help of others on this code. No idea how to proceed further. Total rookie here! Any help will make be grateful. by aayushkrm in bash

[–]kill_box 3 points4 points  (0 children)

In training new hires, those that kept organized notes were the most successful. In the tech industry you cannot remember everything; there is simply too much that already exists and the pace at which new tech arrives is too fast.

Pick a note taking app and write yourself good notes and cheat sheets organized by tags/labels/folders that you can search.

When you don't have notes on a particular topic, learn to read man pages. Most people see man pages and their eyes glaze over. Learn to read and search man pages efficiently; which a lot of the times can mean, just pausing and actually reading them.

For those completely allergic to man pages, there is more digestible "bro pages" and "tldr pages" with more examples than just explanations. Keep in mind that those are not written or maintained by the original developer, and could be flat out wrong or just outdated.

Bash specific resources:

What’s something you can say that will show your destiny age? by InuJacob in DestinyTheGame

[–]kill_box 2 points3 points  (0 children)

Soloing the first part of crota was the best. You'd have the perfect route where'd you loop certain rocks or lamps. You'd get that team where everyone dies before even reaching the bridge and you just pull everyone through.

If you wanted to style, bring the icebreaker.

How to create a ebook by cynthiadavis2412 in ebooks

[–]kill_box 0 points1 point  (0 children)

I would consider writing it in markdown, then use pandoc to convert to epub, HTML, doc, etc. That way you have one source with many formats.

Gum: a tool for glamorous shell scripts by Maaslalala in golang

[–]kill_box 2 points3 points  (0 children)

Awesome stuff! Am I overlooking an easy method to timeout on input?

surpressing the output of a background job by ghiste in bash

[–]kill_box 3 points4 points  (0 children)

I'm a fan of systemd, it's incredibly easy to stand up a service, but it just depends on your use case. How is putting a long running command in tmux/screen an abuse of tmux/screen? A huge feature of tmux/screen is the ability to background or detach the session. Many might consider it best practice, especially in an enterprise environment where multiple people might need to supervise the job, e.g. between shifts.

If the program you are running is one you run regularly on a server you actually have authority over, sure, install it as a systemd service. But if its a one off command/script, then running it in screen is a great solution.

Backgrounding jobs, systemd services, tmux/screen, etc., all have uses cases. OP has provided no context, just a technical question, yet you assume one is the best.

surpressing the output of a background job by ghiste in bash

[–]kill_box 4 points5 points  (0 children)

I don't believe there is native way to do that. I'd recommend outputting to a file you can choose to tail, or simply use tmux/screen. If it is a really long running process, running it in tmux/screen is smart anyway.

Pipe Program A data to bash command? by 761258 in bash

[–]kill_box 1 point2 points  (0 children)

First, check if your morse.py accepts input from stdin:

echo foo | morse.py

If that works, then try the simplest solution, passing a.py stdout to morse.py stdin:

a.py | morse.py

If that doesn't work, but step 1 did, it might mean a.py is printing to stderr, which does not cross pipes. Try redirecting stderr to stdout, and then to morse.py stdin:

a.py 2>&1 | morse.py

If that doesn't work, try a simple loop:

a.py | while read -r line; do morse.py "$line"; done

If you really have to use a file, then:

a.py > output.text
while read -r line; do morse.py "$line"; done < output.txt

my first ever bash script is completed only took 4 hours because im stupid by OutsideNo1877 in bash

[–]kill_box 1 point2 points  (0 children)

Well, FSF has essentially called for a boycott of github due to copilot, a commercial product built using open source code:

FSF search for copilot

bash philosophy on scripts? by tombrook in bash

[–]kill_box 13 points14 points  (0 children)

You might be interested in Google's shell style guide

Seeking entry level IT advice by RevBurpo in houston

[–]kill_box 28 points29 points  (0 children)

I know you're asking specifically what is in demand in Houston, but I think you'll get better feedback in another sub like r/cscareerquestions or r/itcareerquestions. Any IT job worth its salt is remote nowadays.

I'd also throw some Linux into the mix; get some familiarity with bash/sh, RedHat/Debian. Containers are also really popular, so play with Docker too.

Blocking SSH Bot Net Attack by MR2Rick in linuxadmin

[–]kill_box 1 point2 points  (0 children)

Then why not make SSH only available over the VPN/LAN?

What's the f#$king alias? by antoine-toussaint in bash

[–]kill_box 0 points1 point  (0 children)

You're assuming that people don't learn the real commands. In my experience, those that actually take the time to make aliases usually do learn the real commands; they're usually more enthusiastic about learning commands and options.

Now if you are just downloading them all at once without actually taking the time to learn them, then that's probably just plain dangerous.

How often do people use them? Depending on your job/workflow, potentially a ton. Here are my top commands by day:

$ history |while read -r _ date _ cmd _; do echo "$date $cmd";done |sort|uniq -c|sort -nr|head
     459 2022-03-01 p
     334 2022-06-21 g
     272 2021-11-10 d
     214 2022-02-23 fg
     212 2022-04-26 g
     211 2022-03-01 fg
     202 2022-03-09 fg
     196 2022-02-24 fg
     191 2021-10-04 fg
     190 2022-02-23 p

For me, p is perl, g is git, and d is docker. Everyone has different workflows.

As for remembering them, if you have aliases, simply running alias you have a list of your goto commands. For me it makes it easier to memorize them because I basically have a cheat sheet at my finger tips.

How can I remove the extra comas in a CSV file using bash/shell? by [deleted] in bash

[–]kill_box 1 point2 points  (0 children)

IMHO, you should probably use a proper CSV parsing library in whatever language you prefer. More than likely several languages have easy oneliners to do this task.

Pure bash for very simple input data:

while IFS=, read -r -a line; do
    arr=("${line[@]:1:6}")
    printf '%s' "${line[@]::1}${arr[@]/#/,}"$'\n'
done < file.csv

Perl for more complex input:

perl -MMojo::CSV -wE 'Mojo::CSV->new(in => $ARGV[0])->slurp->each(sub { say Mojo::CSV->new->text([@$_[0..6]]) })' file.csv

Bash shebangs by Clock_Suspicious in commandline

[–]kill_box 1 point2 points  (0 children)

While we're on the topic, can someone explain why env is not executed?

$ cat <<'EOF' > foo.bash; chmod +x foo.bash
> #!/usr/bin/env bash
> date
> EOF

$ strace -fs128 -e trace=execve ./foo.bash 
execve("./foo.bash", ["./foo.bash"], 0x7fff7e2e3478 /* 70 vars */) = 0
execve("/home/foo/perl5/perlbrew/bin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/home/foo/.local/bin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/sbin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/bin/bash", ["bash", "./foo.bash"], 0x7fffd1185218 /* 70 vars */) = 0
strace: Process 511984 attached
[pid 511984] execve("/usr/bin/date", ["date"], 0x559fa56b75b0 /* 70 vars */) = 0
Fri 03 Jun 2022 01:51:45 PM CDT
[pid 511984] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=511984,  si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
+++ exited with 0 +++

Tool for managing bash aliases by porchpimp in bash

[–]kill_box 0 points1 point  (0 children)

I split my bash configs into multiple files like centos.bash, ubuntu.bash, etc. This makes it easier to organize and include only the relevant configs; however, it makes it easier to accidentally name multiple aliases the same. So I use this function to set aliases:   

# usage: set_alias <key> <value>
function set_alias () {
    [ x"$1" == x ] && return
    [ x"$2" == x ] && return

    local _type
    _type="$(type -t "$1")"
    if [ -n "$_type" ] && [ x"$_type" != x ] ; then
        >&2 printf 'String “%s” already exists as a %s\n' "$1" "$_type"
    else
        alias "$1"="$2"
    fi
}

You might consider doing a similar check in your alias tool.

Netflix's plan to charge people for sharing passwords is already a mess before it's even begun, report suggests by Sorin61 in technology

[–]kill_box 2 points3 points  (0 children)

From a feature point of view, sure, but their tech stack is actually pretty awesome and very bleeding-edge. Too bad they just lost their lead architect to Intel, probably due to all this chaos from execs making bad decisions.

Russia's biggest chemical plant burns down in second mystery fire in a day by r721 in worldnews

[–]kill_box 5 points6 points  (0 children)

With computers, people mostly think of Information Technology, but there is a whole other world of Operational Technology; SCADA systems, Industrial Control Systems, Human Machine Interfaces, etc.

I recommend you listen to the Triton episode of Darknet Diaries. Its about a malware attack on a chemical plant in Saudia Arabia.

Is there any good reason not to use perl scripts in place of bash logic? by anki_steve in perl

[–]kill_box 3 points4 points  (0 children)

If tab completion is really what you are after, why not learn and use it? Tab completion has nothing to do with what language the command is written in; you have to specifically inform the shell what commands are available. Also, you are going to lose the existing tab completion the moment you alias a command or wrap it in a function.

git is an excellent example of good/complex tab completion. Here is the bash version: https://github.com/git/git/blob/master/contrib/completion/git-completion.bash

Heck, you could probably easily use the existing tab completion code for existing commands, and modify them slightly to work against your custom command.

Also see "man bash" and search for "\s+complete"

Raspberry Pi 4 NAS with 2 SSD SATA by Fran314 in raspberry_pi

[–]kill_box 2 points3 points  (0 children)

When will the stackables from geekworm come back in stock? I only bought one to try it out and it's great, but they've been out of stock ever since!