1
vote
1answer
26 views

Prevent SSH from logging out after running initial commands

I'm using ssh to connect to a remote Linux machine like this: ssh -i .ssh/path/to/id_rsa -p 22 user@host 'cd /path/to/dir' I'd like some commands to be executed upfront (such as cd /path/to/dir) ...
3
votes
1answer
40 views

Connect to a VPN with a password from the commandline

I can trigger the start of connection to my VPN by saying nmcli con up id WORKVPN But I have an RSA SecurID that is part of the authentication, which means I can't store a password. Without a ...
2
votes
1answer
247 views

How to reboot automatically and run terminal command(s) on startup?

So I run a Minecraft server on Ubuntu Desktop 12.04. It runs very well except every so often the computer does need a reboot, as it should considering it runs 24/7. I'm relatively new to Ubuntu ...
1
vote
2answers
73 views

How to automate my startup?

I am not sure how I am supposed to automate such delicate tasks on my daily routine. Let me describe it: open Sublime Text in first desktop open Chrome in second open two terminal windows in third, ...
12
votes
0answers
691 views

How can I make apt-get wait for another instance to finish? [duplicate]

Is there any way I can make apt-get wait for the other apt-get (or another package manager) process to finish? I know that, generally, apt-get can only run one instance at a time and if we try to run ...
2
votes
2answers
108 views

How to create scripts that create another scripts

I am writing an script that needs to generate another script that will be used to shutdown an appserver... This is how my code looks like: echo "STEP 8: CREATE STOP SCRIPT" stopScriptContent="echo ...
2
votes
1answer
227 views

How to run command on connect to network

How can I automatically run a command whenever my computer connects to a network? I want it to run in these situations: On power on and login to Unity On waking up from suspend or hibernate When it ...
0
votes
1answer
77 views

Use grabc in python script

I want to work with the return value of grabc. If it returns #000000 then I want to take it to a=#000000. But this outputs the value in terminal. So How can I do this? [N.B: grabc is a tool for ...
7
votes
1answer
886 views

How can I combine multiple images into a single GIMP file with the command line?

How can I combine multiple JPEGs into a single, layered XCF via the command line? Using GIMP's graphical interface I can choose File ▸ Open as Layers..., but I don't see an analogous command-line ...
4
votes
1answer
2k views

How do I run LibreOffice Calc without Text Input dialog?

I have a CSV file written by a python script of mine. I want to make a shell script that opens the file in read-only mode, which I have done. #!/bin/sh libreoffice --view ~/Documents/timeclock.csv ...
1
vote
1answer
191 views

Scripting question (youtube-dl and xclip)

I have youtube-dl and xclip installed. Is there a way I could write a script that can run commands from both? For example: youtube-dl -l --extract-audio (url) but instead of pasting a url could I ...
6
votes
1answer
625 views

How can I make a script to place files older than each day before into their own folder?

I'm running an unnecessarily complex script which looks similar to this command: find /home/user/videos/*.avi -mtime +0 -exec mv -f {} "/home/nb/videos/1 day old" \; And then I run the same ...
1
vote
1answer
206 views

How to modify configuration file from command line?

For example, I often need to login to a new virtual machine just to open "/etc/ssh/sshd_config" and set "PasswordAuthentication" option to "no". In this way, I can not automate this process. How to ...
2
votes
1answer
406 views

A simple email autoresponder

I have a POP3 email account, that I do not use anymore. It is on a server out of my control. Several of my contacts keep on sending email to that address, though I told them. So I decided to set an ...
19
votes
3answers
4k views

How to find the number of packages needing update from the command line?

I'm working on some system admin automation using fabric and I'd like to be able to monitor the number of packages that need upgrading on a given machine. This is the same information that I can see ...
2
votes
1answer
3k views

How do I run BleachBit from the terminal?

On their website, they say to simply enter bleachbit --(argument here) but all that does is open the program. Am I doing something wrong?
4
votes
1answer
236 views

Automation Extracting Many Passworded Archive

I have many 7zip Archive with same password. When I extract it, both using GUI application and command line, I must enter same password again and again. When I read the 7za command manual pages, I ...
4
votes
1answer
738 views

How can I automate creation of videos from an image and an audio track?

There are many videos on sites such as Youtube that simply contain album art and an audio track. This is easy to do with tools such as openshot or pitivi but it is time consuming. Is there a script or ...
5
votes
3answers
228 views

I need a command to remove all files from a directory (and subdir) that are under 20MB

With the exception of certain file extensions. (removing junk other than subtitle files from a video directory)
2
votes
2answers
4k views

Auto-login to console as root - no Xserver

I'm setting up a PC for a very specific purpose. It's going to do some stuff deep underwater... round about 3km. We don't fear fish hijacking the box locally ;). I'm trying to set up a login: no ...