How to save screenshot to specified directory using xfce4-screenshooter without dialogs? - screenshot

xfce4-screenshooter --help says that -s option is needed to specify saving directory.
But there is a problem: when I run in the console (or using key bind) xfce4-screenshooter -ws ~/screenshoots, it opens Save as... dialogue instead of just saving to specified directory.
What can I do?

You can try -o option:
mv "$(xfce4-screenshooter -wo ls)" ~/screenshoots

Related

Mac: Replace "users/<computer-name>" in all terminals

I'm running into an issue with hiding my computer name. I want all terminal outputs on my mac (iTerm ->zsh & IntelliJ) to stop showing my computer name and show ~/. Can someone help me achieve this, I'm not sure what setting I'm looking to change.
ie.
From
users/ComputerName/app/src/main/java/com/virtualprodigy/android_compose_template
To
~/app/src/main/java/com/virtualprodigy/android_compose_template
Prompt format in zsh is controlled by PROMPT or PS1 variable. You can check if one of these variables is set up in ~/.zshrc (if there's no such file, create it by running touch ~/.zshrc).
If in your .zshrc you see a line setting either PROMPT or PS1, in its value substitute %/ (absolute path) with %~ (relative to home path).
If there's no such line in your .zshrc, you can just add this:
PROMPT='%~ %# '
Then save the file and restart your terminal.
You can change the prompt in your terminal to display ~ instead of the full path by modifying your shell's configuration file.
For zsh, you can add the following line to your ~/.zshrc file:
PROMPT='%~ %# '
For bash, you can add this line to your ~/.bash_profile or ~/.bashrc file:
PS1="\w \$ "
This will change the prompt to display only the current directory, represented by ~ for the home directory, and the command prompt symbol ($ for normal users, # for superusers).
You will need to either restart your terminal, or run the command source ~/.zshrc or source ~/.bashrc to apply the changes.

Cant start linux "screen" with logging to specific output file

I have the problem that I want to enable logging of a screen session at the start of it which then saves the log to a specific file.
What I have until now was:
screen -AmdSL cod2war /home/cod2server/scripts/service_28969.sh
while service_28969.sh is a shell script that will call other scripts which produce output.
I started multiple of those screen-sessions with different names, for example
screen -AmdSL cod2sd /home/cod2server/scripts/service_28962.sh
-L enables logging as the screen's man say, and will safe the ouput in a file called 'screenlog.0', now since I have multiple of those screens only one of it produces output saved in that log file (I can't find other 'screenlog.*' files in that folder).
I thought to use the -Logfile "file" option from the same man page, but it doesn't work for me and I can't find out what I'm doing wrong..
screen -Logfile cod2sd.log -AmdS cod2sd /home/u268450/cod2server/scripts/service_28962.sh
will produce the following error:
Use: screen [-opts] [cmd [args]]
or: screen -r [host.tty]
Options:
[...]
Error: Unknown option Logfile
and
screen -AmdS cod2sd /home/u268450/cod2server/scripts/service_28962.sh -Logfile cod2sd.log
will run without any error and start the screen but without the logging at all..
You can specify a logfile from within the default startup ~/.screenrc file using a line like
logfile mylog.log
To do this from the command line you can create a file mystartup to hold the above line, then use option -c mystartup to tell screen to read this file for setup instead of the default. If you also need to have ~/.screenrc read, you can add the source command to your startup file. The final result would look something like:
echo 'logfile mylog.log
source ~/.screenrc' >mystartup
screen -AmdSL cod2war -c mystartup /home/cod2server/scripts/service_28969.sh
This works for me:
screen -L -Logfile /Logs/Screen/`date +%Y%m%d`_screen.log
The configs I checked:
screen version 4.08.00 (GNU) 05-Feb-20 on FreeBSD 12.2
and
version 4.06.02 (GNU) 23-Oct-17 on Debian GNU/Linux 10 (buster)
and
version 4.00.03 (FAU) 23-Oct-06 on Mac OS X 10.9.5.
I just ran into this error myself and found this solution that worked with my python file, wanted to share for anyone else who might run into this issue:
screen -L -Logfile LOGFILENAME.LOG -dmS SCREENNAME python3 ./FILENAME.PY
I have no idea if this is the 'correct' way but it works.
-L enables logging
-Logfile LOGFILENAME.LOG declares what to call the log file and file format
-dmS SCREENNAME, dm runs in detached mode and S allows you to name the session
python3 ./FILENAME.PY in this case is my script but I assume that any other script here functions
I have tried a different ordering of these commands and this was the only way I managed to have them all run without issues. Hopes this helps.

Executing command in Plink from a batch file

I want to automate the export process which I take using expdp command in Oracle.
Following is the contents of batch file I have created to open PuTTY.
#echo off
"C:\Program Files\PuTTY\plink.exe" username#Ip_Addr -pw password -m Open_Putty.txt`
Following is the contents of Open_Putty.txt to execute different commands.
echo $ORACLE_SID;
Read oraenv;
But after opening Open_Putty.bat it disappears without showing any output.
Please help me with this. I want to set oraenv and run some more commands to take the backup.
It's unlikely that plink.exe disappears without showing any output. I assume you execute the batch file from a Windows Explorer or other GUI application, so the Plink console window disappears once Plink finishes (possibly with error) and you cannot read the output (error).
Make sure you execute plink.exe from a console window (typically a cmd.exe) or add pause command to the end of the batch.
Make sure Plink can find the script file (Open_Putty.txt). As you do not specify a path to the file, it has to be located in your current working directory. Safer is to use a full path to the script file:
"C:\Program Files\PuTTY\plink.exe" username#Ip_Addr -pw password -m "C:\path\Open_Putty.txt"
The backtick symbol at the end of the command should probably not be there.
The name "Open PuTTY" is bit confusing. You are not using PuTTY at all. And even if you refer to Plink by "PuTTY", your script file (Open_Putty.txt) is not opening PuTTY nor Plink. It's executing remote commands. So you should better name it export.txt or similar.

GNU screen source a custom bashrc file for new windows

At the office, we have a shared user we use half the time. I'm trying to get screen to automatically load a custom bashrc file that I created for myself when using the shared user. So far I have this which works well:
alias screen='screen -d -R -S redhar -c /home/redhar/.screenrc bash -rcfile '\''/home/goldenuser/.bashrc_redhar'\'''
This works well for the very first window it creates. The problem comes when I create a new window. Is there anyway to get a newly created window to automatically use the same rcfile?
So far I have considered the following option, but I'm looking for a more streamlined solution along the lines of a missing GNU screen config option I overlooked or something. My proposed solution:
In regular .bashrc which gets loaded automatically:
if [[ $SCREENFLAG == "REDHAR" ]]
then
. /home/goldenuser/.bashrc_redhar
exit
fi
Set alias to:
alias screen='SCREENFLAG=REDHAR screen -d -R -S redhar -c /home/redhar/.screenrc bash -rcfile '\''/home/goldenuser/.bashrc_redhar'\'''
Discovered the solution is to create a file with
bash -rcfile /home/goldenuser/.bashrc_redhar
then set your shell command in .screenrc to it
shell='<path to file created above>'

How to use iTunes Connect Transporter

Is there anyone that can explain to someone that doesn't know how to use Terminal what are the commands to use Transporter for iTunes Connect?
I tryed to follow the guide but with no results....
These are my steps till now:
I put this command in terminal:
export TRANSPORTER_HOME=`xcode-select --print-path`/../
Applications/Application\ Loader.app/Contents/MacOS/itms/bin
and my terminal change like this:
~ myname$ Applications/Application\ Loader.app/Contents/MacOS/itms/bin
so I guess with this now I am in the transporter folder...
Now I want to etrieve my app’s current metadata Using Lookup Mode, and I tryed with this command:
$ iTMSTransporter -m lookupMetadata -u [myname#gmail.com] -p [mypassword] -vendor_id [id999999999] -
destination [Applications/Application\ Loader.app/Contents/MacOS/itms/bin]
but I get this:
$ iTMSTransporter -m lookupMetadata -u [myname#gmail.com] -p [mypassword] -vendor_id [id999999999] -
-bash: Applications/Application Loader.app/Contents/MacOS/itms/bin$: No such file or directory
I assume I'm writing the destination in a wrong way....
So how should I write that command?
And also... when I will have to upload my edited file... what shoud I put?
Thanks a lot for any help with this issue
Start by putting the export command into a single line.
export TRANSPORTER_HOME=`xcode-select --print-path`/../Applications/Application\ Loader.app/Contents/MacOS/itms/bin
Then you have to use the full path to the iTMSTransporter Binary. You can use the variable you just defined for this.
"$TRANSPORTER_HOME/iTMSTransporter" -m lookupMetadata -u ... -vendor_id ... -destination ~/myapp
The destination is the directory where the app data will be put. ~ means your user directory. So if your username is blue ~/myapp means /Users/blue/myapp.
Don't use Xcodes directory for this.
I would recommend to NOT specify your password with the -p parameter. You don't want your password to appear in bash_history. If you don't specify the passwort you will be asked for it.
Again. Make sure that this is in one line. You must not spread the command over more than one line. Unfortunately if you copy and paste from the pdf document you get a multi line command that won't work.
I suggest to open a text editor, paste the command from the pdf into the text editor and format the command so it is on a single line.
Then go to https://bugreport.apple.com and file a bug about the crappy documentation of iTMSTransporter