Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms (4)

4
votes
0answers
52 views

How to catch the command failure events in ubuntu?

I am trying to execute the script whenever the command fails. We all know that if the command is failed $? value will not be equal to 0.It gives the value 127 if command fails. The script is ...
4
votes
0answers
103 views

How to Create A Startup Script for Keyboard LED

Freshly installed 14.04, CoolerMaster Storm keyboard. I'm not at all concerned with being able to toggle/turn off the LED, I simply want the LED to turn on before login, i.e. while looking at the ...
4
votes
0answers
2k views

How to transfer an iPhoto Library to a file based structure and how to manage them properly?

I need to export my old iPhoto Library to a file based structure similar to the format of shotwell. There are some possiblities: Just use the iPhoto Master folder Use Shotwell to import the photos ...
3
votes
0answers
47 views

Script on reboot

So, I programmed a simple script to alert on slack whenever the server is rebooted. What I did: In /etc/rc6.d/R99reboot-slack: (I tried with R01reboot-slack) #!/bin/sh /scr/msg.sh "Server restarting.....
3
votes
0answers
34 views

How to run a program in its own, temporary, xdisplay (runx)?

For background I like to play some older games that really run better in super low resolutions and having the whole desktop switch to 320 x 400 is really not that great. I've gotten around this by ...
3
votes
0answers
43 views

How to trigger a script on entering/exiting a workspace?

This is regarding ubuntu 15.10. I have enabled workspaces, and would like unity launcher sidebar to show open application icon only if it was opened in the current workspace. To do so, I have already ...
3
votes
0answers
38 views

How to find the last valid information possibly spread over several log files

I have a fleet of busses that send me a monitoring log file every morning regarding the status of the vehicle the previous day. The log updates various information every 5 minutes. Among the data ...
3
votes
0answers
13 views

How to keep a local ~/bin folder up to date with updates from various Github repositories?

~/bin contains a number of scripts that I downloaded from various Github repositories for which the Ubuntu default repositories do not provide the latest version and/or PPAs do not exist. What are ...
3
votes
0answers
32 views

How to resolve conflict between two aplay running at the same time

I use a lots of sounds in my shell-scripts, so it's not rare, when two or more scripts begin a conflict for audio channel. If one of my script already play sound and the other wants too, than it will ...
2
votes
0answers
30 views

How to add custom menu items to system menu?

I'm wanting to write a few shell scripts which I can run from clicking their respective items from the system menu (with the power options). I cant seem to find anything online about adding items to ...
2
votes
0answers
40 views

Facing errors with running shell scripts at startup and poweroff

I am using Ubuntu 14.04 LTS and I want to run 3 scripts at startup. They are named as follows: voe.sh startUp.sh and runDown.sh The script voe.sh is the main file which will in turn call the other 2 ...
2
votes
0answers
45 views

Script crashes when starting from .desktop file

When I execute script from terminal by hand, it runs without problems: gksudo /path/to/module.sh But when I use .desktop file to run script on startup: [Desktop Entry] Type=Application Exec=gksudo ...
2
votes
0answers
37 views

Submitting serial jobs

I want to submit a serial job on my ubuntu desktop (PC), not on any HPC cluster. I am working with genomic data and have several runs to do. I want to complete job#1 which creates certain files the ...
2
votes
0answers
65 views

How to automatically run a script once, after installing lubuntu from a pen drive?

I've got this usb stick I'll send to my sister, and I couldn't put int Ubuntu in it (just little less than 1 gb and few MB short of fitting in 14.04). So I decided to go with Lubuntu. Then, I've ...
2
votes
0answers
212 views

preseed file and installation script

I am using a preseed file to auto install ubuntu 12.04. I create a normal user account (able to use sudo), I skip the creation of a root account. At the end of the file I have put this (seen it from ...
2
votes
0answers
548 views

How to run program/application in full screen mode

I am running my program/application from command line like sudo ./MyApp and some of programs I run like sudo ./MyShFile.sh ( in .sh file I just call/run my programs). But I want that my program ...
2
votes
0answers
1k views

rc.local doesn't run on startup

I know this question has been asked a lot of times already, and I think I might have tried everything suggested on the internet, but I just can't get it running /etc/rc.local: #!/bin/sh -e while : ...
2
votes
0answers
102 views

error insserv with script

I try to install Unbound with the following website: http://www.unix-tutorials.com/go.php?id=3681 I copied the script : #!/bin/sh # # unbound This shell script takes care of starting and ...
2
votes
0answers
658 views

How to customize the font style in notify-send?

I am trying to change the format of text appearing in pop-up notification while using notify-send command. Here I saw that it can be done using HTML formatting. But that doesn't seem to be working for ...
2
votes
0answers
243 views

Ubuntu 12.04 LTS scripts in /if-up.d not executed

Since this morning have been trying to achieve something: System: Ubuntu 12.04 LTS, Network-Manager is not installed Goal: Every time, the eth0 network interface is started (if-up.d) we want to ...
2
votes
0answers
181 views

solaris tail on ubuntu

Is there a way to make linux tail understand the Solaris tail syntax (precisely like tail +2)? The short story is that I have some update scripts written for Solaris on the repo and I cannot modify ...
2
votes
0answers
397 views

How do I force nmcli to reconnect to different uuid?

I have a bash script that checks my network environment and mounts shares accordingly. If I'm at work and have a hard-wire connection to the LAN, then I'd like to activate a hotspot connection for ...
2
votes
0answers
74 views

Upstart - unable to read /etc/shadow unless sudo

In the following script in Upstart, I'm unable to read /etc/shadow in pre-script phase, unless I use $(echo mypass | sudo -S cat /etc/shadow | grep myusername) The script works fine if I provide my ...
2
votes
0answers
660 views

Port redirection for a specific (dynamic) IP using iptables script

What I want: Incoming TCP and UDP connections on port 900 from the resolving IP address of myip.dyndns.org (dynamic IP) should redirect to port 5050 on the local machine. All other IP addresses ...
2
votes
0answers
68 views

suppress all interaction while installing apt-fast

I want to ask whether there is any method to suppress any interaction while installing apt-fast using apt-get. I add the ppa source and then use the next command to install apt-fast: sudo apt-get -y ...
2
votes
0answers
532 views

How to persistently maintain cloned mac address on Network Manager?

I'm on Gnome 3, and it seems like I'm able to add cloned mac address to my network interfaces from the GUI wizard of Network Manager. The catch is, every time I reboot my computer the cloned mac ...
2
votes
0answers
215 views

Activating USB audio with /etc/pm/sleep.d script that runs pacmd commands

Ubuntu annoyingly switches the device for audio input and output from my USB headset to the built-in sound card every time I log out, hibernate, or shut down my computer. This takes place even though "...
2
votes
0answers
314 views

Block unauthorized usb device. Disable automount

I wrote a bash script that checks every second for new mounted USB devices. When a new device is mounted, my script gets its serial number and compares it with the serials I wrote in a text file, ...
1
vote
0answers
20 views

Why is my script for the powerbutton not working under 14.04 LTS an 16.04 LTS any longer?

I have an little homeserver based on ubuntu 16.04 LTS without a graphical userinterface. He was set up with 10.04 LTS an always upgraded. In version 13 I changed the behaviour of the power button via ...
1
vote
0answers
13 views

DLNA Play-To on Script

Is there a way to push content to a DLNA capable TV via script on a loop. We have a situation where TVs in a public place keep getting turned off by people walking by. Would like to be able to push ...
1
vote
0answers
90 views

Launch python script fullscreen on startup (Ubuntu 14.04)

I have a python program that I would like to automatically run after logging in. This shouldn't be much of a problem, however, I would like the terminal to be in fullscreen mode while running the ...
1
vote
0answers
44 views

notify-send not showing popup message

I have a script which executes on certain conditions, whenever I manually execute the script, the popup appears, however if i try to aumotate the script(i.e. run the script right after system is ...
1
vote
0answers
96 views

Not able to execute a url from python script running via Cron

I have a script web.py which I am trying to run on the aws EC2 Instance using cron. It basically has these line of codes: import webbrowser webbrowser.open('http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx') If ...
1
vote
0answers
61 views

Compress a folder but skip compressing specific file types and include them as such

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~190 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
1
vote
0answers
70 views

Scripting dconf changes

I've written a simple script for our Ubuntu machines at college which sets some dconf overrides to set the theme, background etc. However I cannot seem to get it to correctly set the login screen ...
1
vote
0answers
23 views

xrandr reporting wrong resolution after booting from script started with upstart

I have a script in /home/username/.config/upstart myscript.conf ... description "my startup scripts" start on desktop-start exec ~/scripts/startup.sh start that startup script eventually calls ...
1
vote
0answers
124 views

how to automatically copy new files from sd reader to disk on connect?

im new with ubuntu and linux, and poor knowleadge of english, sorry if i cant write clarely. I need a script or something to automatically move new photos (.cr2) from my camera's sd when i put it on ...
1
vote
0answers
46 views

Bash script to display XKCD comic - crontab not executing

I wrote a bash script to display the current xkcd comic in my web browser (using the RXKCD package in R). I want to schedule this so that the current xkcd comic displays every morning at 8am when I ...
1
vote
0answers
15 views

Start a GUI in NetworkManager if-up.d script

I was wondering if it was possible to start a graphical application from a bash script when my openvpn is up. I was trying with command like this: gksudo -u username "sh -c '(/usr/bin/firefox &) ...
1
vote
0answers
22 views

Incorrect permission set received

In the following shell script: default_conf_file_path="/etc/apache2/sites-available/"; default_conf_file=$default_conf_file_path"000-default.conf"; DocumentRoot=$(grep "DocumentRoot" $...
1
vote
0answers
25 views

Is it possible to use the dancing lights trick?

On Windows, you can make a Visual Basic script to make your keyboard lights blink, but is this possible on Ubuntu? Furthermore, would I be able to hack all my hardware?
1
vote
0answers
26 views

Check which user changed file in directory

I want to use inotifywait to check if a file is modified in a directory (more specifically in samba). Is there a way to also extract which user changed the file? Thanks!
1
vote
0answers
137 views

How to run a golang restful api as service in ubuntu server

I need to run golang restful server that build using gin framework and mongodb as service in my ubuntu server.how can do this? (every time i run the go script i need to this also gvm use go1.4)
1
vote
0answers
33 views

Upstart Ruby version issue

I am trying to get Upstart to fire up Sidekiq (https://github.com/mperham/sidekiq/wiki/Deploying-to-Ubuntu). I can manually start it but the same command fails in the Upstart script. I have piped ...
1
vote
0answers
18 views

Nautilus scripts not showing up (although on the right folder and executable)

I just installed ubuntu 14.04 and I'm setting everything up. I wanted to add a couple of scripts to the right click menu. Putted them on ~/.local/share/nautilus/scripts . Made them executable. Reboot....
1
vote
0answers
20 views

App/Script consumes too much memory. Ubuntu may be killing it. How do I verify/check this assumption?

Hosted on Digital Ocean Ubuntu 14.04 1GB RAM, 30GB HDD I am running a python script that is reading a 200MB+ file line by line. Each line is parsed into a JSON object and then appended to an array. ...
1
vote
0answers
41 views

How to make a key stroke recorder (for non-malicious purposes)?

When you first look at this question and its title you are going to assume that I want this for malicious purposes, however that is not the case, it is because I type a lot of things, and sometimes (...
1
vote
0answers
117 views

Creating an upstart service for dumping and uploading a mysql database on shutdown

I am running Ubuntu Server 14.04 LTS x64. I have two KVM guests. One is a file server and another runs mysql server. I have a script that I run on the file server. The script connects via ssh to the ...
1
vote
0answers
80 views

Are there any basic templating preprocessors that I can use for nginx configuration files?

I've been using nginx variables to simplify my templates for a few years now. It turns out this is apparently a "rather slow" way of doing things and that my static configuration should be static. ...
1
vote
0answers
128 views

init: Failed to spawn telnetd main process: unable to execute: No such file or directory

kernel: [ 43.208320] init: Failed to spawn telnetd main process: unable to execute: No such file or directory I get this message several times at start up on Ubuntu 14.04. telnetd is a script which ...