Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [bash]

BASH is the GNU Bourne Again SHell, the successor to the classic Unix Bourne sh (shell). It's the default shell for various GNU systems.

30 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
123 views

Semaphore implementation by file locking in a bash script

This implementation is inspired by the POSIX functions sem_wait() and sem_post(). It tries to get rid of busy loops in the code ...
4
votes
0answers
107 views

Backup script for Linux (full and differential backups)

The backup script itself. Make it executable and place it somewhere in your path: ...
4
votes
0answers
70 views

appleseed command line widget (CLW)

─── appleseed on GitHub appleseed v1.0.0 is a command line widget (CLW), I designed for macOS and iTerm2. Its a flexible platform for process automation and added eye candy. It utilizes ...
4
votes
0answers
223 views

WSL LAMP stack script

The following code is aimed to establish a WSL based LAMP environment. This is instead XAMPP or WAMPP based LAMP environment which doesn't allow Bash. The script includes a cat heredocument called "...
4
votes
0answers
137 views

Bash script to symlink configuration files from git repo into home directory

My goals are to: Do it automatically (without adding a line to my script every time I add or change the location of a config file) The files in the git repo folder should not be hidden, but the ...
4
votes
0answers
46 views

Selective Time Machine backup deletion

Time Machine is a useful backup service for Mac, but deleting multiple backups is cumbersome. This script allows mass deletion of unwanted backups while allowing specified "important" backups to ...
4
votes
0answers
68 views

SLOC Counter Script Optimization

I'm a HPC guy so I'm all about "make it work, then make it fast." I have a little bash script which gets a Physical Source Lines Of Code (PSLOC) and Logical SLOC (currently just of Java code, but it ...
3
votes
0answers
46 views

Code to fetch BitBucket repos

This actually works nicely (we have > 2k repos) but I would really like it to start producing results right away as soon as it has any. Mostly so it seems faster than it is (by being more responsive). ...
3
votes
0answers
27 views

NRPE script for monitoring filesystems usage

Next script returns NRPE friendly output. It checks percentage usage of all local filesystems. Desired output if everything is ok: OK | /=56;;;; /boot=20;;;; /opt=40;;;; /var=60;;;; (and ...
3
votes
0answers
25 views

Rename files by editing their names in an editor

Inspired by the a recent question to rename files by editing the list of names in an editor, I put together a similar script. Why: if you need to perform some complex renames that are not easy to ...
3
votes
0answers
121 views

Follow-up: Script to create symlinks for dotfiles in a Git repository

This is a follow up to my previous question on Code Review. I did try to implement most of feedback provided by thiagoalessio. This is what my updated code looks like: ...
3
votes
0answers
32 views

Bash webapp duplicator

I've written the following Bash script used to duplicate a webapp/website you have (say, a Wordpress website) locally on your server environment, for testing purposes, indicating after 2 days if you ...
3
votes
0answers
22 views

Compare timestamps of svgs versus exported pngs and export via Inkscape

This script goes through all svg files in an assets folder and compares them to the exported layers (one level above). If the svg timestamp is newer, it will automatically export the svg using ...
3
votes
0answers
44 views

Bash manual page selection menu (version 2)

This is update to a previously asked question Bash manual page selection menu. This script generates a menu for the user to select which manual page he/she would like to read. ...
3
votes
0answers
184 views

Daemonizing shell scripts - MqSH

This is an mqtt driven, interactive, and asynchronous remote shell daemon written in bash. I call it "MqSH" or simply "mq". It works with bash, the busybox ash shell, and perhaps other Bourne-like ...
3
votes
0answers
569 views

Laravel Docker-Compose

I've created a repo for some Docker containers that work together with docker-compose to make a very easy and quick installation for Laravel including nginx, mariadb, and redis. Laravel is known for ...
3
votes
0answers
72 views

Bashscript - Find and run main.py file (part of vim-Python IDE)

I try to get into Python and thought I build together my own IDE. Most of it consists of different addons for vim and changes in the vimrc (which of course I simply copied of google), but I also ...
2
votes
0answers
10 views

Auto re-connecting to a VPN on OS X and pointing Squid accordingly

We need to tunnel certain applications over a VPN at work. Ideally we would use a dedicated firewall/network appliance for this but the only permanent infrastructure we have are Mac Pro's running ...
2
votes
0answers
67 views

Bash bitcoin blockchain explorer

I wrote a little bash script that displays the transaction info in json: ...
2
votes
0answers
34 views

Bulk File Rename; Improved Safety and Performance

A function that funnels all filenames into a file and opens that file in vim. The user then changes the names, saves, and quits. Finally the function renames the files in the folder with the new names ...
2
votes
0answers
55 views

BASH script to obfuscate android/meterpreter payloads

I have written a little script that does a pretty good job of obfuscating android/meterpreter payloads. It will generate payloads or used supplied msf payloads while also injecting a custom icon. The ...
2
votes
0answers
40 views

Code to backup the history file in Linux

How is the logic, efficiency and can it be improved? This is a snippet from my .bashrc file; I just wrote it and I've tested it and it almost works. This was the ...
2
votes
0answers
590 views

Elastic Beanstalk configuration using ebextensions container_commands combining leader_only and test

For our Django app running on AWS Elastic Beanstalk, we use a web-server/worker setup. The same code is deployed to the web-server and worker environments, and environment-specific configuration is ...
2
votes
0answers
110 views

Read file real time with while loop and trigger action on change

I want to read a file real time with a while loop that is being fed by the stdout of a process (inotifywait). The output could ...
2
votes
0answers
87 views

Copy recently modified files from one directory to another

I am new to bash scripting. Could you please give a review of this code that copies recently modified files from one directory to another in bash? The main commands are in my ...
2
votes
0answers
87 views

Chip-8 Emulator in Zsh

I've spent the last few weeks writing a Chip-8 emulator in zsh. It doesn't run in bash but the syntax is nearly identical. I have it on a GitHub repo here: https://github.com/hcorion/chipzsh a ...
2
votes
0answers
143 views

Log all Google Chrome browser activity

This script documents every website visited and writes the text content of each webpage to its own individual file. It seems to work as intended. Is there anything I could do to improve it? ...
1
vote
0answers
21 views

S3 Bash Tools Part 2

This is a follow on to a previous question: Part 2: Upload/Download All the code I am submitting here is available in github The reason to write these tools is so I can prototype and quickly ...
1
vote
0answers
67 views

S3 Tools in Bash

This is a follow on to a previous question: Part 1: Signature All the code I am submitting here is available in github The reason to write these tools is so I can prototype and quickly verify ...
0
votes
0answers
22 views

bash script at scale for kubernetes kubectl operations

I have my below prototyped script and it runs fine but I need to scale it out at large. So, wanted to get feedback if my script can be improved in terms of performance and if there are any non ...