Tag Info

Hot answers tagged

35

Mark, this is a great question, and was the first one I asked when somebody told me about Juju. Here's some of the big differences. Juju encapsulates services - a charm defines all the ways the service needs to expose or consume config data to/from other services. How a charm does that is the charm's business. It can use any tool from shell scripts to Chef ...


29

The easiest of enabling unattended updates for your system is to edit the file 50unattended-upgrades inside /etc/apt/apt.conf.d/ with your favourite text editor. In it you need to comment out the commented sections of the Allowed Origins block, ie sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades Change Unattended-Upgrade::Allowed-Origins { ...


25

(Disclaimer - I'm the founder of Puppet and CEO of Puppet Labs) I don't know juju terribly well, but from what I can tell, they somewhat sit at different layers. Puppet is great at managing the behaviors and capabilities of machines themselves, whereas juju seems primarily dedicated to talking about sets of machines and largely punts how to make the ...


21

Install unattended upgrades: sudo apt-get install unattended-upgrades Enable unattended updates on the Google Chrome repo by editing the unattended upgrades list and adding the Google Chrome repo in it: gksudo gedit /etc/apt/apt.conf.d/50unattended-upgrades Add "Google\, Inc.:stable"; to the allowed origins: Unattended-Upgrade::Allowed-Origins { ...


19

You can echo the line in to the bottom of the current users crontab like this: #!/bin/bash line="* * * * * /path/to/command" (crontab -u userhere -l; echo "$line" ) | crontab -u userhere -


16

To obtain that output, you can use the command sudo /usr/lib/update-notifier/update-motd-updates-available or, if you don't want to use sudo, cat /var/lib/update-notifier/updates-available Explanation The login application shows the output found in the file /etc/motd, that is a symbolic link to /var/run/motd. This last file is updated by the ...


15

The problem is that your password is required to unwrap the mount passphrase used to decrypt the eCryptfs home directory. Without that, it's not possible; the system doesn't have the encryption key yet. These login styles are mutually exclusive; you can either automatically log in (thereby letting anyone with physical access to your computer be able to ...


14

inoticoming inoticoming is a daemon to watch a directory with Linux's inotify framework and trigger actions once files with specific names are placed in there. For example it can be used to wait for .changes files uploaded into a directory and call reprepro to put them into your repository. Manual page of inoticoming incron incron is an ...


12

Open a terminal window and type in: shutdown -h +60 and just replace 60 with whatever number of minutes you want to take. More info here: http://ubuntuforums.org/archive/index.php/t-473173.html http://www.linux.org/lessons/beginner/l5/lesson5a.html


12

The QA team does extensive automated testing - it's part of the requirements for hardware to get Ubuntu certified. The project they use is Checkbox. Don't be fooled by the quite cut-down version shipped in the checkbox-gtk package - the full suite contains a huge range of tests. The Ubuntu QA mailing list is where you want to go for checkbox questions, or ...


12

Instead of hardcoding the password in the file, store the password in a separate file and protect the file (chmod 700 or chmod 500) so that only the authorised users can access it. Retrieve the password with cat /dir/to/file/with/.password instead of reading the file and storing the content of it into a variable.


12

You can use dconf-editor to change this setting. It's under: com -> canonical -> unity -> lenses and is called remote-content-search. As far as I know there are only two options none and all. When set to all the slider is set to "On" in system settings and when it is set to none the slider is at the "Off" position. You can change this ...


11

AutoKey can do everything you're asking for. You can find it in the Ubuntu Software Centre.


10

There is Gnu Xnee, which enables you to record and replay actions on the desktop. You can install it from the software center. "GNU Xnee is a suite of programs that can record, replay and distribute user actions under the X11 environment. Think of it as a robot that can imitate the job you just did."


10

Autokey is a linux equivalent of AutoHotKey for Windows. Some of its features KDE and GTK versions available, making AutoKey integrate well into any desktop environment. Write Python scripts to automate virtually any task that can be accomplished via the keyboard Built-in code editor (using QScintilla in KDE or GtkSourceView2 in GTK) Create phrases ...


9

First off, install numlockx (click here to install numlockx). Basically this allows you to write scripts to set the state of Num Lock - see the numlockx man page for details. Next we need to start delving into the fun of udev rules. First we need to find out how the keyboard is identified. You can do this by ls /dev/input/by-id/ This should give you some ...


9

Install gnome-schedule from the Ubuntu Software Center, load the program from Applications > System Tools. Use it to add an entry for the time you want the program to be closed like so: This will kill all instances of firefox at a certain date/time, you can also have reoccurring events that kill off certain programs at certain times, for instance to ...


9

Why can't you just run this? /usr/lib/update-notifier/apt-check --human-readable That's what /usr/lib/update-notifier/update-motd-updates-available does to collect the information, at least in the version of Ubuntu I'm using (12.10).


8

sed, the stream editor, is your friend here. For example. sed -i.bak -e's/<p id="first"/<p id="second"/' file.html would change all the paragraphs with the id 'first' to id 'second' in file.html, and create file.html.bak into the bargain.


7

What kind of service? Certain services have other methods to authenticate, e.g. SSH keys for SSH in conjunction with SSH agent. I'd store the password separate from the script, and make sure that all path components have the correct permissions set. E.g., make sure that in the path /path/to/file, /, /path and /path/to are owned by a user you trust (root) ...


7

In vim: :set softtabstop=0 :set expandtab :set smarttab :set shiftwidth=2 gg=G :retab EDIT: Explainations: lines 1-3: sane default line 4: indent with 2 spaces line 5: gg: top line =: indent until... G: ...end line 6: insure that all tabs are converted to spaces


7

LinuxMCE is a free, open source add-on to Kubuntu. Linux Home Automation has a lot of links.


6

This is on Ubuntu 10.04. Manually swapping the Windows and Alt keys System -> Preferences -> Keyboard Layouts tab Click "Options..." Expand "Alt/Win key behavior" Choose between: Default (when using the PC keyboard) "LeftAlt is swapped with Left Win" (when using the Apple keyboard) Semi-automated swapping I have added this to my .bashrc: # Output ...


6

If you have AutoHotKey scripts to automate Windows applications running in Wine, then AutoHotKey is exactly the program to use. Fortunately, AutoHotKey is very easy to install in Wine, as the Wine project uses it for our automated QA tools. The easiest way on Ubuntu is to just enable the Wine PPA and install the Wine package there. This will pull in the ...


6

You need the dbus-monitor The script will look something like #!/bin/bash interface=org.gnome.Rhythmbox.Player member=playingUriChanged # listen for playingUriChanged DBus events, # each time we enter the loop, we just got an event # so handle the event, e.g. by printing the artist and title # see rhythmbox-client --print-playing-format for more output ...


6

What is Autopilot? From the Ubuntu wiki: Autopilot is a functional testing tool for Unity. It simulates user actions by generating keyboard and mouse events, and then testing the internal state of Unity and associated applications. You can get involved with testing by joining the QA team. Here is a link to their mailing list - ubuntu-quality, their ...


6

You could create a crontab for the specific user like so: crontab -u <username> -e Or more simply, you could just run crontab -e when logged in as that user. Alternatively, you could prefix your command in your (root) crontab with sudo -u <username> to run the command as the specified user.


5

To capture script output to a file, use: script.sh >file.txt To remove comments (lines starting with #) but leave the blank in their place, use: script.sh | sed 's/^#.*//' >file.txt To do all of the above while also displaying the information on the terminal, use: script.sh | sed 's/^#.*//' | tee file.txt Explanation > is the shell's ...


5

add-apt-repository has a -y flag you can use, which should do the trick. Though I really want to suggest that you look at configuration management systems like puppet or chef to configure servers. They'll save you a lot of time!


5

I didn't like the polling approach, so I did some digging on bluez and DBus. I ended up writing the following script: #!/usr/bin/python import dbus from dbus.mainloop.glib import DBusGMainLoop import gobject import subprocess # ID of the device we care about DEV_ID = '00_1D_54_AB_DC_72' dbus_loop = DBusGMainLoop() bus = ...



Only top voted, non community-wiki answers of a minimum length are eligible