How can I run a Java .jar file, fx “java -jar MyJar.jar” automatically on a Linux server, instead every time I login and run it from ssh? I am looking for some way to automatically execute that command, or something to that effect. Also, how can I direct all output to some logfile? (I guess stdio …
Tag: linux
sending email in linux as subject and attachment
I have a file that is about 10 columns wide and try to send it as body. mailx fails sending it as body and sends it as a ATT00001.bin file and as an attachment. mail -s “Subject” emailaddress < file.tsv Is there way to solve this. When I try to send it as an attachment, using uuencode echo R…
A font doesn’t appear in IntelliJ’s dialog of choosing a font
I installed Monaco font using this code. However, it doesn’t appear in Setting -> Editor -> Color and fonts -> Font. What should I do? Answer Try to install fonts in another way. Just use the Font Viewer. I use IDEA under ElementaryOS and it works for me. Update:
cut or awk command to print first field of first row
I am trying print the first field of the first row of an output. Here is the case. I just need to print only SUSE from this output. Tried with cat /etc/*release | awk {‘print $1}’ but that print the first string of every row Answer Specify NR if you want to capture output from selected rows: An al…
The full pathname of a JDK installation for Oracle SQL Developer
I want to run Oracle SQL Devloper on Ubuntu with this command: Then I got this message: Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/aimad/.sqldeveloper/4.0.0/product.conf So I gave the path of jdk as the following: /usr/lib/jvm/java-7-openjdk-i386/ But th…
Shell script: Run function from script over ssh
Is there any clever way to run a local Bash function on a remote host over ssh? For example: Yeah, I know it doesn’t work, but is there a way to achieve this? Answer You can use the typeset command to make your functions available on a remote machine via ssh. There are several options depending on how y…
linux sed, do insert and append at the same time
I have a question about linux sed command. I just want to insert something before every line and append something after every line. And i want to do these things at the same time. For example, assume file.txt is like: I need to output: so I think the command should be like: But the result is not right, a is
not allow multiple option in getopts of bash script
Having bash script as follows Above script run fine with different option but i wanted to extend it to not allow to pass multiple option at same time like as following argument should be not valid means some way it give me error like wrong syntax i achieved it by as follows but it seems to long it is as
Unable to configure folder permissions in Ubuntu
I found many related questions and tried to solve the issue but I was not successful. Actually I created an user named “amit” and assigned the group “www-data”. I gave permission to the folder using this method Change folder and file permission recursively: To change all the directorie…
Can docker run inside a Linux Container?
Koding is a collaborative programming environment, which creates a virtual machine for multiple user to colaborate on software development. They use Linux Containers to virtualize the machines. I’m not being able to install docker on it: Can anyone suggest a workaround for installing docker? Answer Yes,…