How to send one bash command to multiple byobu windows? - bash

I have a prompt. I want to send a clear or ls to all my byobu windows (opened with F2), by typing it only once.
Is there a way to do that?

This was such a phenomenal question, and something that I've been wanting to do for so long, that I just put a couple of scripts together, added to Byobu-5.73, and released the new feature :-)
As of that version of Byobu, you can now use Shift-F9 to enter a command and send to all panes (splits), or Ctrl-F9 to enter a command and send to all windows.
You can watch a demo here: http://blog.dustinkirkland.com/2014/09/apply-updates-to-multiple-systems.html
This feature is available in Ubuntu 14.04 LTS (trusty), or you can always install the latest version from ppa:byobu/ppa or build/install from source.
Full disclosure: I am the author and maintainer of Byobu.

Related

how can i install heroku in my kali linux operating system?

I cant install heroku in my kali linux operating system. how can i resolve this issue?
isn't it not possible to run heroku in kali linux?
when I have try to install, it show snap command not found.
Heroku no longer supports Snap installs:
Snap installs are no longer supported. Please use another install method below.
Since Kali is derived from Debian, you should be able to use the Debian / Ubuntu method (which doesn't auto-update) or the standalone tarball method (which does). You can also use the NPM / Yarn package if you prefer, though Heroku recommends against it.
All of these options require some amount of trust in Heroku. The first two pull a script down from the Internet and pipe it into sh, which always makes me a bit uneasy. I suspect they both request elevated privileges during the install process. Instead of piping the file directly in to sh as Heroku recommends, I suggest you download it and at least give it a quick read through the first time.
In any case, here is the command that Heroku recommends to install the standalone version:
curl https://cli-assets.heroku.com/install.sh | sh

Git Bash in windows won´t start

I´m really new using Git Bash so sorry in advance if my description is a little rough.
I was trying to use python inside Git Bash for windows so i followed this instructions: https://www.youtube.com/watch?v=M33oOq-c60s&t=2s&ab_channel=chinamatt
When I closed and try to re-open Git,it loaded for a few seconds and closed, without any error message,
Now I can´t make it load even unistalling and re- installing it, the only thing I notice is that at the top of the window it says usr/bin/bash --login i..
I guess it had to do with the '. ${HOME}/.bash_profile' ~ /.bashrc command, but I have no idea since
I´ve had never used {HOME} command before.
First, make sure your git bash works again, by removing any ~/.bahs_profile and ~/.bashrc
Second, consider, if you are on the latest Windows 10, to use WSL2, in which you will be able to install/use Python in a familiar Linux environment, as opposed to Git limited mingw/bash.

Silent/Automated Homebrew Install

I am trying to get homebrew installed remotely on a machine without a terminal open and without ssh access to the machine. Our company uses a Directory-as-a-Service which allows us to remotely push shell scripts to our computers which is great, but it requires the scripts to have no interactivity.
Is there a way to automate the installer and remove the “Press enter to continue” prompt in the install process?
Thanks,
Zach S
The env variable CI seems to silence this prompt:
export CI=1

Command not found in bas

I'm so sorry because I know this is a dumb question, but I've been trying to figure this out for about 2 hours and I can't figure it out. I've created a bash file that uses some other programs (tcpdump, tshark). The bash runs as it should but on every line that I use tshark, tcpdump, etc. it says "command not found".
I'm using Cygwin on my Windows 7 VM. All of the files are in the same folder and I I've tried adding the locations of the other programs to the PATH variable. I tried commands such as export PATH=$PATH:filelocation but when I do $PATH those results aren't showing. How can I get these commands to be recognized?
Thank you.
current errors
Cygwin is not a Linux distro, therefore, you don't have all the functionality like you would if you had a Linux installation.
You could try one of the following.
1) Use Virtualbox to make a VM of some Linux distro and use bash there. You could use Ubuntu server, which has no GUI.
2) Use this site to find packages that will add functionality to Cygwin.
3)Upgrade to Windows 10 and have a native (sort of) bash to use.

OSX Equivalent of WinSCP's Fully-Automated Local-Remote SFTP Sync?

I fondly remember working with WinSCP and using the fully automated local-to-remote syncing functionality, where the app would monitor a directory hierarchy and send changes to the remote server as they happened.
Is there an app available on OSX that accomplishes the same thing? I haven't really been able to find anything. When I do find something promising, it always turns out to be a traditional syncing app, where you need to initiate the sync command manually and it then scans the hierarchy to find changed files. That takes too long and isn't automated.
Been looking at the File System Events API, wondering if a small app could be pieced together with a small utility to trigger hierarchy changes and feed the changed directory to rsync or something.
Thanks for any leads!
There are two Mac-specific utilities you may be able to utilize to make your job easier:
Automator (link and link)
Folder Actions (link link and link)
Both tools have AppleScript as a common thread (which can be used to execute shell commands). You might be able to write a small AppleScript that is launched when a folder changes to call rsync and perform the service you require.
Well, I had the same kind of problem and it is possible using these together: rsync, SSH Passwordless Login, Watchdog (a Python sync utility) and Terminal Notifier (an OS X notification utility made with Ruby. Not needed, but helps to know when the sync has finished).
I created the key to Passwordless Login using this tutorial from Dreamhost wiki: http://cl.ly/MIw5
1.1. When you finish, test if everything is ok… if you can't Passwordless Login, maybe you have to try afp mount. Dreamhost (where my site is) does not allow afp mount, but allows Passwordless Login. In terminal, type:
ssh username#host.com
You should login without passwords being asked :P
I installed the Terminal Notifier from the Github page: http://cl.ly/MJ5x
2.1. I used the Gem installer command. In Terminal, type:
gem install terminal-notifier
2.3. Test if the notification works.In Terminal, type:
terminal-notifier -message "Starting sync"
Create a sh script to test the rsync + notification. Save it anywhere you like, with the name you like. In this example, I'll call it ~/Scripts/sync.sh I used the ".sh extension, but I don't know if its needed.
#!/bin/bash
terminal-notifier -message "Starting sync"
rsync -azP ~/Sites/folder/ user#host.com:site_folder/
terminal-notifier -message "Sync has finished"
3.1. Remember to give execution permission to this sh script. In Terminal, type:
sudo chmod 777 ~/Scripts/sync.sh
3.2. Run the script and verify if the messages are displayed correctly and the rsync actually sync your local folder with the remote folder.
Finally, I downloaded and installed Watchdog from the Github page: http://cl.ly/MJfb
4.1. First, I installed the libyaml dependency using Brew (there are lot's of help how to install Brew - like an "aptitude" for OS X). In Terminal, type:
brew install libyaml
4.2. Then, I used the "easy_install command". Go the folder of Watchdog, and type in Terminal:
easy_install watchdog
Now, everything is installed! Go the folder you want to be synced, change this code to your needs, and type in Terminal:
watchmedo shell-command
--patterns="*.php;*.txt;*.js;*.css" \
--recursive \
--command='~/Scripts/Sync.sh' \
.
It has to be EXACTLY this way, with the slashes and line breaks, so you'll have to copy these lines to a text editor, change the script, paste in terminal and press return.
I tried without the line breaks, and it doesn't work!
In my Mac, I always get an error, but it doesn't seem to affect anything:
/Library/Python/2.7/site-packages/argh-0.22.0-py2.7.egg/argh/completion.py:84: UserWarning: Bash completion not available. Install argcomplete.
Now, made some changes in a file inside the folder, and watch the magic!
I believe transmit does this.

Resources