Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "linux scripting"
-
A story about how a busy programmer became responsible for training interns.
So I was put in charge of a team of interns and had to teach them to work with Linux, coding (Bash, Python and JS) and networking overall.
None of the interns had any technical experience, skills, knowledge or talent.
Furthermore the task came to me as a surprise and I didn't have any training plan nor the time.
Case 0:
Intern is asked to connect to a VM, see which interfaces there are and bring up the one that's down (eth1). He shuts eth0 down and is immediately disconnected from the machine, being unable to connect remotely.
Case 1:
Intern researches Bash scripting via a weird android app and after a hour or so creates and runs this function: test(){test|test&}
He fork-bombed the VM all other interns used.
Case 2:
All interns used the same VM despite the fact that I created one for each.
They saved the same ssh address in Putty while giving it different names.
Case 3:
After explicitly explaining and demonstrating to the interns how to connect to their own VMs they all connect to the same machine and attempt to create file systems, map them and etc. One intern keeps running "shutdown -r" in order to test the delay flag, which he never even included.
Case 4:
All of the interns still somehow connect to the same VM despite me manually configuring their Putty "favorites". Apparently they copy-paste a dns that one of them sent to the entire team via mail. He also learned about the wall command and keeps scaring his team members with fake warnings. A female intern actually asked me "how does the screen knows what I look like?!". This after she got a wall message telling her to eat less because she gained weight.
Case 5:
The most motivated intern ran "rm -rf" from his /etc directory.
P.S. All other interns got disconnected because they still keep using his VM.
Case 6:
While giving them a presentation about cryptography and explaining how SSH (that they've been using for the past two weeks) works an intern asked "So is this like Gmail?".
I gave him the benefit of the doubt and asked if he meant the authorization process. He replied with a stupid smile "No! I mean that it can send things!".
FML. I have a huge project to finish and have to babysit these art majors who decided to earn "ezy cash many" in hightech.
Adventures will be continued.26 -
Feels great to write a script that downloads consecutive episodes of a series sequentially ..
All because..
Hotstar doesnt support Linux ..16 -
So yesterday was a regular old day where I came into the office and began my work. My office mate that sits next to me happens to be having an issue with her batch script. It wasn't running correctly so she had decided to call in IT and have them take a look at it. What she was trying to do was process some images through a dedicated super-computer located on site.
So as you can imagine with both of them standing right next to me it was hard not to listen in on their conversation. The IT guy decided to go through a barrage of different troubleshooting methods to figure out what was happening with her script. And soon enough they discovered what was wrong. It happened to be an issue with how Windows decides to deal with new line characters. FYI it looks like this shit "\n \r"
The fucking \r looked like a directory to Linux. So it would squeal to a halt every single time she tried to run.
How this happened was due to her using notepad to edit her batch file.
At this point, I made a comment about her use of Notepad.
"Oh, you're using notepad? I've had similar issues like this in the past when I've used notepad. I really hate notepad." I said with a slight chuckle.
And that was pretty much the end of our encounters. However, at the end of the day, she decided to speak up about this.
"I don't appreciate you making comments about my use of Notepad. That was a form of microaggression towards me, and I don't want you to do it again."
Completely taken aback I replied.
"I'm sorry you took it that way, it was a joke and wasn't meant to be taken personally."
"Well, your intent does not change impact. And by the way, I take pride in my code and scripting. I don't need your commentary about my code nor your micro-aggressions." She said in a huff.
"Well again, I'm sorry you feel that way," I replied back
*I'd like to say that this situation is loosely paraphrased, but the essence of what happened is still there.
At this point, this is what I have to say about this situation. Why the FUCKING FUCK are you using notepad to program anything. There ARE A SHIT TON of differing programs that are available for your use and you decide to use fucking notepad?!?! $%&*@#$^
You could use notepad++, you could use Sublime, you could use every-fucking-thing except Notepad!!! If anything I think I had every right to make a comment about your stupid use of notepad. And darling, your script not working was well deserved, I hope you run into more errors like this because you deserve nothing less for your arrogance. So you can take your opinions and shove them up your fat-ass because at the end of the day I don't give a FUCK about your opinions on my micro-aggressions that you're spouting off about.
I suggest the next time you feel attacked about your code perhaps you should take a cold hard look at yourself before thinking that I'm the one that is the FUCKING problem.17 -
The school I went to...
Grade 1:
*GTA and minecraft to let student familiarize with cheating command and console
*Student should find and read the damn documentation him/herself about items, mobs and quests in every game. Be self motivated!
Grade 2:
*Contribute to community for myth hunting, map creation and glitch
*Solve personal networking, graphics problem and understanding hardware limitation.
*Solving game compability problem after Windows update
*Introduction to cracking and hacking
Grade 3:
*Motivation to host a game server
*Custom server scripting => start To really code the first time, Perl, python, etc
*Introduction to Linux server and Debian
Grade 4:
*From DDoS to server security
*Server maintenance and GitHub
*Game Server web development
*Motivation into non-gaming discipline by a random YouTube geek
*Set up mincraft with raspberry pi and Arduino
*Switch to Linux or Mac and just dual boot for gaming
Prepared for the real world.
Congratz for the graduation in the Pre-school of Developers (11-14 yrs old) :)5 -
Me a while ago talking to a recruiter over the phone. This was for a C++ dev position.
(R)ecruiter : So except for the development things, we are looking for someone who has experience configuration linux. Do you have any experience with that?
(M)e : Sure, I use Linux all the time. What do you mean.
R : Well, Just using Linux isn't enough for this position, you need to have experience in configuration Linux.
M : Well. I can't answer your question if you don't specify what you mean. Do you mean that I need to be able to install my own packages? Set up my dev environment? Bash scripting? Being able to configure my bash profile to have good aliases? Use Linux to develop software? Because I can do all of these.
M : Or do you need someone who can write Kernel modules for the OS, because I don't have any experience in that but would like to learn.
R : Oh, I don't really know what it means. But the paper says that you need to have experience configuration Linux. So what would you say your experience with that is?
Me internally : JESUS CHRIST I JUST TOLD YOU WHAT I KNOW AND WHAT I DON'T KNOW HOW ARE YOU GOING TO ASSESS ME CORRECTLY.
Me 😎 : I use Arch and you have to set it up completely from the ground by your self so I know everything there is to know.
Basically every question was like this with the recruiter. I got further in the process but quit because the workplace looked like it would drain my soul when I got interviewed by the employees of the company.
Jesus Christ though, some recruiters could be replaced by an automated phone system.17 -
Them: My company is looking for a junior C++ programmer. You must have 10 years experience with PL, SQL, SQL Server, MySQL, SQL oracle, javascript, HTML, XML, UML, c-sharp, visual basic, java.net, j unit, and win32 api, cutie, gtk, PHP, ASP, Perl, Python, and shell scripting with the windows, linux, and solaris operating systems.
Us: Do i need to know C++?
Them: no
https://youtube.com/watch/...5 -
It's vacation for me for two weeks of which one week will be a vacation outside the country and one will be home-time.
Will work on redesigning my entire server 'infrastructure' and an automated website/openvpn/whateverthefuckiwanttodeployorwhatever system solely written in bash/shell scripting.
Partly because it's awesome to learn new Linux-related stuff and partly because I really want to have this functionality and would love to write it myself.
Also working on three side projects of which two will become a service and one will be released into the open :)
But, tomorrow will be dancing my ass off to quite some of my favourite producers :D8 -
!rant
A rather long(it's 8 hrs long to be precise) story
So I just finished an amazing homework assignment. The goal was to open a new shell on Linux using a C program. We were asked to follow instructions from http://phrack.org/issues/49/14.html . However the instructions given were for 32 bit processors and we had to do same for 64 bit machines. In a nutshell we had to write a 64 bit shell code and use buffer-overflow technique to change the return address if the function to our shell code.
I was able to write my own shellcode within 1hr and was able to confirm that it's working by compiling with nasm and all. Also the "show-off-dev" inside me told me to execute "/bin/bash" instead of "/bin/sh"(which everyone else was going to do). After my assembly code was properly executing shellcode, I was excited to put it in my C code.
For that, I needed opcodes of assembly code in a string. Following again the "show-off-dev" inside me, I wrote a shell script which would extract the exact opcodes out of objdump output. After this I put it in my C code, call my friend and tell him that "hell yeah bro, I did it. Pretty sure sir is gonna give me full marks etc etc etc". I compiled the code and BOOM, IT SEGFAULTS RIGHT IN FRONT OF MY FRIEND. Worst, friend had copied a "/bin/sh" code from shellstorm and already had it working.
Really burned my ego, I sat continuously for 8 hrs in front of my laptop and didn't talk to anyone. I was continuously debugging the code for 8 hrs. Just a few minutes ago, I noticed that the shellcode which I'm actually putting in my C code is actually 2 bytes shorter than actual code length. WHAT THE F. I ran objdump manually and copied the opcodes one by one into the string (like a noob) and VOILA ! IT WORKED !!!
TURNS OUT I DIDN'T CUT THE LAST COLUMN OF OPCODES IN MY SHELL SCRIPT. I FIXED THAT AND IT WORKED !!
THE SINGLE SHITTY NUMBER MADE ME STRUGGLE 8 HRS OF MY LIFE !! SMH
Lessons learnt :
1)Never have such an ego that makes you think you're perfect, cuz you're retarded not perfect
2)Examine your scripts properly before using them
3)Never, I repeat NEVER!! brag about your code before compiling and testing it.
That's it!
If you've read this long story, you might as well press the "++" button.6 -
Powershell should die.
I have a simple bash script I made that allows me to download almost any video from the internet. Works great and took me only a few minutes to make.
The only issue is it bash meaning Windows doesn't run it natively. I am not able to install linux Subsystem or bash, etc on the server.
So I decided to rewrite it in powershell thinking it should be Okay and I have never struggled with so much retardedness in my life. After 40+ tabs in chrome and a massive headache, it finally works.
Microsoft should kill powershell entirely and rethink their scripting language.
Also VBA should have died 10 years ago.16 -
Don't we all just love that guy, that loudly talks about Linux and is almost zealous about it but when questioned about simply stuff, like basic *nix commands and shell scripting, looks like he just arrived from space... :D4
-
Is it just me or what. I had begun learning web development (but prefer C, shell scripting, Linux... ).
One thing that amazes me - besides having to learn 1356367626785576 technologies to get something done and the fact we get a fresh new amazing framework every 0.00000000000234 seconds - is CSS.
Amazing, I made a navigation bar where I wanted the items to be displayed in the horizontal position, so I
.navbar li, a {display:inline-block}
Works fine.
Next day I'm doing the same from scratch, doesn't fucking work. I look the previous design, HTML structure looks identical, I only use a different font face and colors.
After a while I randomly decided to put a <div> around the a element in order to do something else, update the page and... Voilá, text is in line.
Like... Wtf.
I'm like fuck it. No way I want to work with this shit, let's go back to shell.6 -
Why so much hate for Windows? I can do all the scripting that I do on Linux on Windows as well. AutoHotKey for the win! In fact, the hacks that I can do on Windows directly cannot be done on Linux unless I have the terminal open. I'm still learning, yeah, so I'll learn how to do that in due time, but I've never had any issues with drivers, software issues, or security threats while using Windows.
And Windows Defender is so good now! I don't need an antivirus. Well, good browsing habits and common sense is enough of an antivirus so it's a moot point anyway.
Either way, I like embracing the power of AND. Why choose? I love both Windows and Linux!26 -
Been using linux for 10 months now and finally figured how to write looping statements in terminal itself instead of writing a script for that .. Life just became simpler..3
-
Hello! My name is opalqnka and I am a Windows user.
I followed the 12-step program and now I am a step away to being certified LPIC Linux Engineer.
As step 12 preaches, here I humbly share the Program:
1. We admitted we were powerless over Windows - that our lives had become unmanageable.
2. Came to believe that a Power greater than ourselves could restore us to sanity.
3. Made a decision to turn our will and our lives over to the care of Linus as we understood Him.
4. Made a searching and fearless moral inventory of ourselves.
5. Admitted to Linus, to ourselves and to another human being the exact nature of our wrongs.
6. We’re entirely ready to have Linus remove all these defects of character.
7. Humbly asked Him to remove our shortcomings.
8. Made a list of all persons we had harmed, and became willing to make amends to them all.
9. Made direct amends to such people wherever possible, except when to do so would injure them or others.
10. Continued to take personal inventory and when we were wrong promptly admitted it.
11. Sought through bash scripting and kernel troubleshooting to improve our conscious contact with Linus as we understood Him, praying only for knowledge of His will for us and the power to carry that out.
12. Having had a spiritual awakening as the result of these steps, we tried to carry this message to Windows users and to practice these principles in all our affairs.4 -
Obligatory subjective view from inexperienced eyes of a highschooler
I think it's evolving to be more beginner-friendly and more easily accessible. I'm seeing ppl roughly my age can program pretty well (ignoring the mandatory programming classes in highschool that stuff is just no (I know, we had this convo before but do hear me out, although it teaches fundamental programming in Pascal, the execution sucks ball because "mandatory")). I'm not saying we are on par with the in-industry devs, it's just we can code well enough to at least make decent small program/script.
With newer scripting languages that are easy to pick up and syntactically similar to English which is obviously Python, both objectively and subjectively, and its ability to be OOP without scaring first-timers of the what-the-blyn-is-this blank program (looking at you C#) people can be introduced to programming and programming concepts fairly easily and they can switch from Py to other languages with little to some hiccups, from my personal exp at least.
But then there's the "too much kiddies in the field" arguments I saw on dR (I think) a while back then when SO decided to better support newbies. To that, I can only say "Please give us a chance". We're completely oblivious to how the dev world work nor how you guys do your work so before you scold us on this, at least tell us how to work like you before you go on a 2-A4-page rant on how the industry is not as good as before and how it has degraded.
That leads to the problems of politics invading programming. We have it, I hate it, goddammit I wanna murder them. Linux CoC controversy is just...no. And then there's forced diversity in hiring (also ranted on dR a while back) and corporations pissing devs off to satisfy a minor group. I'll just shut up on this. No no no no no no no NO I'm not gonna. Not gonna.
Do correct me if I'm wrong though. I'm a less than a junior dev.2 -
When I was young I'd play games and around age 11 received an Xbox for my bday. Hated the case, so I painted the case. Since I had it open looked into getting a replacement fan.Thats when everything changed. I discovered the modding scene and without having any computer background/literacy got to studying.
The program that caught my eye ran on Linux. *shrugs thinking how hard can it be? * Read about Linux and discover dual booting. To do that I needed to resize windows partition. Learn more about partitions and get to it. Finally prepped... Backup in case of the worst, resized windows partition, working Ubuntu bootable USB, and printed install tutorial. Check, check, and check. Install was good. Sort of.
While Ubuntu worked, the broadcam wireless chipset driver did not. Fast forward a week and I feel that i had mastered the terminal basics. And WiFi worked! Go download the aforementioned program and FTP into the Xbox and BOOM... It doesn't work. More days and hours spent researching. In the end it all chalked up to not setting a static IP address on Xbox.
After all was said and done I had a bitchin Xbox. I think the only thing I didn't put on it was some gold spinning rims.
Sad part about that Xbox is that I never used it after. Instead I just kept messing around with Linux and learning more about computers. Taught myself HTML/CSS. Learned more about shell scripting. Then Windows cmd basics. Tried programming languages but felt a little overwhelmed. Only messed with <10 lines of code to tweak existing programs.
Now I'm learning C# and loving it. Planning on C++ or Java next! -
First day of job. Im doing jack shit. They just make me watch udemy courses of Azure and linux shell and bash scripting all for devops purposes so they can pay a microsoft certificate for me to pass and get certified and they pay for udemy courses. Im basically getting paid to watch courses on the job10
-
Looking to sharpen and pursue a SysAdmin/DevOps career, looking at online job offers to get the big picture of required skills and I say FUCK. It would take me a lifetime.
Azure, AWS, Google cloud platform.
CD tools: Ansible, Chef or Puppet
Scripting ninja with Python/Node and Shell/Power shell.
Linux & Windows administration
Mongo, MySQL and their relatives.
Networking, troubleshooting failure in disturbed systems
Familiarity with different stacks. Fuck. (Apache, nginx, etc..)
Monitoring infrastructure ( nagios, datadog .. )
CI tools: jenkins, maven, etc..
DB versioning: liquibase, flyway etc.
FUCK FUCK FUCK.
Are they looking for Voltron? FUCK YOU FROM THE DEEPEST LEVEL OF MY DEEP FUCK.1 -
The unix shell syntax is weird looking.
Gonna learn it next. Using Arch without knowing how some scripts work isn't optimal.1 -
Dumb question time!
I'm writing a bash script that outputs some progress info to stdout (stuff like "Doing this... ok", "Doing that... ok") before outputing a list of names (to stdout too).
I'd like to be able to pipe this list of names to a second script for processing, by doing a simple :
~$ script1 | script2
Unfortunately, as you may have guessed, the progress info is piped as well, and is not displayed on the screen.
Is it considered a bad practice to redirect that progress info to stderr so it is not sent into the pipe ?
Is there any "design pattern" for this kind of usecase, where you want to be able to choose what to display and what to pipe to a program that accepts input from stdin ?16 -
Is there a mockup/authoring system for linux that I can use to mockup gui interfaces? I want to be able to create pages of screens with button that link to other pages. I first want to use this to document out current app. Then I want to use it to create a new version so that others can review the approach I want to take.
I am first looking at libreoffice because you can draw primitives very easy. It has a scripting backend as well. I had used authoring systems years ago (20 years) on old black and white macs. I have not seen systems like that in a while. Searching for authoring systems for linux brings up a lot of web based ones. I don't want to mock it up on web if I can help it, but it could work if it did relative links to html files in the same directory. That way any browser would work.
I really just don't know what the state of the art tools used for this. Probably using terms I don't recognize.5 -
I cant believe i have to know bash scripting as a devops engineer! Like not linux terminal bash commands, the literal bash Fucking language and syntax coding of automated scripts! Why the fuck? Why cant i just code this shit in java or any other normal language? It would do the same fuckin job and much easier to do. Why i have to code .sh files in devops?!15
-
!rant
Hello everyone
Do any of you python programmers have any tips for simple projects you can do to learn python?
I am mainly a backend/system engineer comig from C++, slowly picking up rust and have been using bash as my scripting language so far. bash is nice because it is so fundamental in the linux world but you just dont get very far with it and its usually not pleasant to write.
So I would like to learn python, though I have no idea what I can do to practice it, so that I can just quickly whip up a script the next time I need something done in the file system or want to write a simple parser for something.
Do you guys have an idea of something small (not necessarily useful) which makes use of pythons strengths? Just looking for ideas here, so stick it all out 👋💕12 -
Question to the Linux-Users on here.
What scripting languages do you know ?.
I want to build a cli-tool, which will be configurated by code, so I want to chose a language, that is relatively wide spread, or easy to learn.12 -
Brilliant rant from Redditor OK6502 in a thread about a "tech screen" being used to get free labor:
Usually when something like this uses the words complex tech stack it means you're going to have to deal with shitty server code distributed over a mix of Azure and AWS nodes and a lone Linux server running under someone's desk, an infuriating configuration hell with no safeguards for keeping dev and prod isolated, a hodge podge of different scripting languages (why not make scripts in pero that call power shell which then calls more perl? Should work right?) and random but critical shit checked into 3 different SVN, stuff stashed on people's shares that will never be checked even though you can't do your homework b without it, usually copied from someone else's share who left the company 3 years ago, no QA process to speak of (while claiming to be agile, somehow) and a front end that is maintained by one exhausted junior dev who inherited a mess of 20 different js frameworks that all load at the same time with every single click, somehow.
The full thread is really worth reading:
https://reddit.com/r/... -
After almost 3 years of professional experience I’d like to specialize more in something but I struggle to because I enjoy almost every aspect of IT: I find front-end really fun, I find very rewarding to build good user experiences and I’m excited for what WASM may bring on the table but I even like to work on the back end on both: legacy monoliths and modern micro services, I love to refactor clunky programs full of “cargo cult” code and redundancies put by people who doesn’t understand the framework they’re using and to make them shine. I’m even good at UNIX/Linux scripting and with Docker (often colleagues asks me advice on these topics) so I’m really tempted to upgrade my knowledge by learning K9S and reading the 1000+ pages of Unix Power Tools to get into operations/DevOps especially considering which the field is the least likely to be overrun by cheap developers coming from a 3 months boot camp.
On top of that I’ve got even into more theoretical topics: I’m following a course on algorithms and data structures in C and in future I want to learn the basics of AI for a personal project but these things aren’t much about employment but personal culture.
Have you got any advice for this disoriented young man?12 -
I'm looking for a project idea in cyber-security...
Any ideas?
I'm good with x86 assembly, c, c++, python and shell scripting.
I'm very well versed with Linux operating systems and basic networking stuff.
I'm willing to learn new concepts11 -
Guys i need some suggestions on how to bring open source and Linux culture in our college. Students already have a subject which teaches basics of ubuntu and red hat and shell scripting.