The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

This does the job in sed, though it isn't especially pretty: $ cat foo.txt foo = { gdb_name = "XXXXX" sid_name = "XXXXX" createContainerDB = "True" numberOfPDBs = "1" pdb_name = "XXXXX" oracle_database_sid = "XXXXX" } database = { gdb_name = "XXXXX" sid_name ...


0

This worked for me because I needed not only to print the result in one line but also I needed to specify how it had to be separated and you can specify that with ORS ls -1 | awk '{ ORS="|"; print; }'


0

You can do the following: MESSAGE="this is my message: \nhello \nnewline \nin logger" logger "$(printf "$MESSAGE")"


0

For us, it was that we were sending an nc payload from one machine to another via a python script. In the python, when we explicitly encoded the payload in 'UTF-8', it just worked.


0

try rootsh package in Linux. just setup a server, as your ssh-server and ask your users to authenticate to this server fist, in order to connect other devices.you may use access-list or any other filtering mechanism to limit your systems or devices to get logged in, only from your ssh server. this package, logs all the commands entered by the user, and all ...


1

You can simply use SSH. Typically you would use a public/private key pair to allow the master to log into the slave without requiring a password. Then use SSH user@slave.IP "command" Note that command can be a single command, a comma separated list of commands or even multiple lines. You can use single quotes for an exact command or double quotes if ...


1

You didn't specifically mention that the commands are to be invoked from the web-app, so I'll assume that's not the case, as this would make the question more 'solution specific'. The simplest method, assuming you have ssh access. Do this on the terminal of serverA: $ cat > script.sh cat /proc/sys/kernel/hostname ^C $ scp script.sh ...


0

simplest way ? if A has a web app on it, make server A have a url server B can query for, like blah.html?shouldidothatthing that returns 'yes' or 'no. then have server B poll for it in a loop. this avoids auth issues, or needing to restrict what server B can let server A tell it to do, etc. but if you want to pass sensitive info wont work well. ...


4

The easiest solution would be to use git-shell as the user's login-shell. A detailed description on how to set this up can be found here: https://git-scm.com/docs/git-shell or alternatively on the git shell manpage man git shell


0

In the authorized_keys file you can add options/restrictions to what is allowed when authenticating with a particular key pair. Add the restrictions: no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty See authorized_keys file format description in https://www.freebsd.org/cgi/man.cgi?sshd(8) for their meaning cat ~/.ssh/authorized_keys no-...


5

No, a basic Bourne/POSIX shell (/bin/sh) cannot be expected to include any built-in facilities for TCP connections. See comparision of command shells in Wikipedia. The bash shell would have TCP and UDP client capabilities with a special handling of certain filenames: for example, using /dev/tcp/<hostname>/<port> in input/output redirection on a ...


2

Most probably you have a reference to a database 'rb' in the sql file rurdevdrpl.sql. It could either be that rb has been defined as the default database with USE rb; or as an option to a sql statement like e.g. INSERT INTO TABLE rb.test (a, b, c) VALUES (1, 2, 4); So check your file for occurences of these two. To replace them you could use sed, but it'...


1

find ./ -maxdepth 1 \ -type d \ -name 'app-deployment-*' \ ! -name 'app-deployment-245a578' \ -exec echo rm -rf {} + Explanations: -maxdepth 1 mean without recursion; -type d mean search only for directories; -name 'app-deployment-*' is a pattern of directories you are searching for; ! -name 'app-deployment-245a578' is a ...


2

in Bash, execution of code after each command can be achieved using the "trap" builtin and the "DEBUG" level. in bash do: help trap or refer to bash manual page, and look for the trap section example: trap 'date' DEBUG This will execute the command "date" juste after each command. Of course you can format the timestamp as you want, refer to the "date" ...


Top 50 recent answers are included