Off-Topic (screen/byobu programming)

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Off-Topic (screen/byobu programming)

Post by crythias »

This is slightly off topic, but if you're developing, love using shell/vi[m], but don't want to open a bunch of putty windows or tabs, here's what I've been doing.
(This is in Linux. You probably use Notepad++ or some other GUI in Windows, so you can stop reading now).

First, install byobu (or tmux or screen) and run it.
then, for expediency, you may want to create a file that opens multiple screens (otrsscreens.sh) for OTRS:

Code: Select all

cd /opt/otrs/Kernel/Config
screen -t Config
cd /opt/otrs/Kernel/System
screen -t System
cd /opt/otrs/Kernel/Modules
screen -t Modules
cd /opt/otrs/Kernel/Output/HTML/Standard
screen -t Standard
cd /var/log
screen -t Logs
then make it executable or just sh otrsscreens.sh

now, you'll see (if you have the list enabled, and you start in "0")

Code: Select all

 1*$ Config  2 System  3 Modules  4 Standard  5- Logs 
By default, you'll have ctrl-a as your "command" key, which enables you to run screen commands. The most important of which is ctrl-a,ctrl-a (last screen) and ctrl-A,2 (for instance.)

"Why do this? I have fancy GUI thing?"
Don't do it, then. This is for people who are using, for instance, PuTTY to connect to an OTRS server who don't have the ability to run a GUI.

"OK, so I have these windows screens ... what am I supposed to do with it?"
Here's a case:
Let's say you're modifying/developing a Module ... ctrl-a,3 (or whatever your Module screen number is). Now, you're able to edit AgentTicketZoom.dtl ... just edit there.
Now, you've added some fields you need to display in a .dtl ... instead of changing directories, just ctrl-a,4 (or wherever Standard is)
But it's not working well .. ctrl-a,5 (or wherever Logs is) and tail -f syslog (or messages or apache2/errors.log)
Ah, you see the problem, you can ctrl-a,3 because it's a Module error, edit, save, ctrl-a,ctrl-a and observe the logs (ctrl-a,ctrl-a returns to the last screen).

What's even better is that this is screen. If your viewing system disconnects, you're going to be right where you left off if you resume the session. You can stop, go home, close your laptop, go to sleep, open, and you're right where you stopped.

To create a new screen, just ctrl-a,c.

Let's say you're working on different projects.

byobu -S Project1
sh Project1ScreenList.sh
ctrl-a,d (detach)

byobu -S Project2
sh Project2ScreenList.sh
ctrl-a,d
next time you run byobu, you'll get a list of Sessions. You can now choose that session, detach, run byobu, connect to a different session, detach, go back ... (Note that if you have configured byobu to run at startup, you may be disconnected from your ssh session putty at detach.)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply