Archive

Archives pour la catégorie ‘Système’

Use a classic menu in Unity

28/04/2024 Comments off

Source: WebUpd8

If you find Dash to be confusing and want to use a classic menu in Unity, you have at least two alternatives: Cardapio or a new ClassicMenu Indicator.

ClassicMenu Indicator

Classic Menu Indicator Ubuntu
While the idea is great, there are a few annoyances: you can’t move indicators in Ubuntu so you can’t move the menu to the position you want on the panel and also, ClassicMenu AppIndicator doesn’t display icons for the menu items. You can get it to display icons by using the commands posted here.
Still, ClassicMenu Indicator is a great menu alternative for those who don’t like Dash and I’m sure it will improve in the future (this is the first public release).

Update: there’s now a PPA too:

sudo add-apt-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install classicmenu-indicator

Cardapio

Cardapio Unity launcher

Cardapio is a main menu alternative with quite a few cool features: it comes with Zeitgeist integration, includes plugins for performing inline searches of Files (via Tracker), Software Center, Google, Wikipedia, and much more.

A long time ago, when Cardapio didn’t have an Avant Window Navigator applet, we posted about adding Cardapio to AWN using a feature that displays Cardapio near your mouse using a command (« cardapio show-near-mouse« ). Well, using the same command you can create an Unity panel launcher to run Cardapio, like you can see in the screenshot above.

To use the launcher, firstly install Cardapio:

sudo add-apt-repository ppa:cardapio-team/unstable
sudo apt-get update
sudo apt-get install cardapio
To make things easier, I’ve created the Unity launcher so all you have to do is download it and drag it to the Unity Launcher.
So download the Cardapio launcher from HERE, extract it and place the file under~/.local/share/applications/ (important: if you don’t place it here, it will disappear once you restart your computer). « .local » is a hidden folder in your home directory so press CTRL + H to see it. Then drag the file to the Unity Launcher.

This is an AppIndicator (so it’s displayed in the AppIndicator area) that behaves like a regular GNOME menu.

 

Categories: Logiciel, Système Tags:

Allow A Normal User To Run Commands As root Under Linux / UNIX Operating Systems

27/04/2024 Comments off

Source: nixCRAFT

You need to use the sudo command which is use to execute a command as another user. It allows a permitted user to execute a command as the superuser or another user, as specified in the /etc/sudoers (config file that defines or list of who can run what) file. The sudo command allows users to do tasks on a Linux system as another user.

sudo command

sudo is more more secure than su command. By default it logs sudo usage, command and arguments in /var/log/secure (Red Hat/Fedora / CentOS Linux) or /var/log/auth.log (Ubuntu / Debian Linux).

If the invoking user is root or if the target user is the same as the invoking user, no password is required. Otherwise, sudo requires that users authenticate themselves with a password by default. Once a user has been authenticated, a timestamp is updated and the user may then use sudo without a password for a short period of time (15 minutes unless overridden in sudoers).

/etc/sudoers Syntax

Following is general syntax used by /etc/sudoers file:

USER HOSTNAME=COMMAND

Where,

  • USER: Name of normal user
  • HOSTNAME: Where command is allowed to run. It is the hostname of the system where this rule applies. sudo is designed so you can use one sudoers file on all of your systems. This space allows you to set per-host rules.
  • COMMAND: A simple filename allows the user to run the command with any arguments he/she wishes. However, you may also specify command line arguments (including wildcards). Alternately, you can specify «  » to indicate that the command may only be run without command line arguments.

Lire la suite…

Categories: Système Tags: , ,

How To SSH Run Multiple Command On Remote Machine And Exit Safely

23/04/2024 Comments off

Source: nixCraft

I have a backup sync program on local server. I have an ssh password less login set up, and I can run commands on an external server in bash script doing:

ssh root@server2 "sync; sync; /sbin/shutdown -h now"

How do I run multiple commands in bash on a remote Unix or Linux server? What is the best Way to SSH in and Run various unix commands in bash?

There are various ways to run multiple commands on a remote Unix server. The syntax is as follows:

Simple bash syntax to run multiple commands on remote machine

Simply run command2 if command1 successful on a remote host called foo
$ ssh bar@foo "command1 && command2"
Run date and hostname commands:
$ ssh user@host "date && hostname"
You can run sudo command as follows on a remote box called server1.cyberciti.biz:
$ ssh -t [email protected] "sudo /sbin/shutdown -h now"
And, finally:
$ ssh [email protected] "sync && sync && /sbin/shutdown -h now"

Lire la suite…

Categories: Système Tags: , ,

How to Set Locales (i18n) On a Linux or Unix

23/04/2024 Comments off

Source: nixCraft

What is a « locale » on a Linux operating system? How do I set or get locals (i18n) values on a Linux operating system?

Locales defines language and country specific setting for your programs and shell session. You can use locales to see date, time, number, currency and other values formatted as per your country or language on a Linux or Unix-like system.

To set system’s locale you need use shell variable. For example, LANG variable can be used to set en_US (English US) language.

How do I show current locale settings on a Linux or Unix?

The syntax is:

locale
locale name
locale [options] name

Examples

Simply type the following command:

 $ locale 

show-current-locale-command

Lire la suite…

Categories: Système Tags: ,

Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems

22/04/2024 Comments off

Source: nixCraft

How do I to disable the mail alert send by crontab? When my job is executed and the jobs cannot run normally it will sent an email to root. Why do I receive e-mails to my root account from cron? How can I prevent this? How can I disable email alert sent by cron jobs on a Linux or Unix-like systems?

The crontab command is used to maintain crontab files for individual users. By default the output of a command or a script (if any produced), will be email to your local email account. To stop receiving email output from crontab you need to append following strings at the end of crontab entry.

Cron job prevent the sending of errors and output

To prevent the sending of errors and output, add any one of the following at the end of the line for each cron job to redirect output to a.

/dev/null 2>&1.

OR

&> /dev/null

Cron job example

Edit/Open your cron jobs, enter:

$ crontab -e

Append string >/dev/null 2>&1 to stop mail alert:

0 1 5 10 * /path/to/script.sh >/dev/null 2>&1

OR

0 1 5 10 * /path/to/script.sh &> /dev/null

Save and close the file.

Set MAILTO variable

You can set MAILTO="" variable at the start of your crontab file. This will also disable email alert. Edit/Open your cron jobs:

$ crontab -e

At the top of the file, enter:

MAILTO=""

Save and close the file.

Categories: Système Tags: