Archive

Articles taggués ‘shell’

Linux Command: Show Linux Version

31/05/2023 Aucun commentaire

Source: nixCraft

What command I need to type to display Linux kernel version and other information such as Linux distribution name? How do I check Linux kernel version number?

You need to use the following two commands:

[a] uname - Print kernel and system information.
[b] lsb_release - Print distribution-specific information.
[c] /proc/version file - Print running kernel information.

How to check linux kernel version number?

Open a shell prompt (or a terminal) and type the following command to see your current Linux kernel version:

$ uname -r

Sample outputs:

2.6.32-23-generic-pae

Or type the following command:

$ uname -mrs

Sample outputs:

Linux 2.6.32-23-generic-pae i686

To print all information, enter:

$ uname -a

Sample outputs:

Linux vivek-laptop 2.6.32-23-generic-pae #37-Ubuntu SMP Fri Jun 11 09:26:55 UTC 2010 i686 GNU/Linux

Where,

  • 2.6.32-23 – Linux kernel version number
  • pae – pae kernel type indicate that I’m accssing more than 4GB ram using 32 bit kernel.
  • SMP – Kernel that supports multi core and multiple cpus.

Lire la suite…

Categories: Système Tags: , , ,

Using Rsync and SSH

27/05/2023 Aucun commentaire

Source: troy.jdmz.net

Keys, Validating, and Automation

This document covers using cron, ssh, and rsync to backup files over a local network or the Internet. Part of my goal is to ensure no user intervention is required when the computer is restarted (for passwords, keys, or key managers).
I like to backup some logging, mail, and configuration information sometimes on hosts across the network and Internet, and here is a way I have found to do it. You’ll need these packages installed:
  • rsync
  • openssh
  • cron (or vixie-cron)

Please note these instructions may be specific to Red Hat Linux versions 7.3, 9, and Fedora Core 3, but I hope they won’t be too hard to adapt to almost any *NIX type OS. The man pages for ‘ssh’ and ‘rsync’ should be helpful to you if you need to change some things (use the “man ssh” and “man rsync” commands). Lire la suite…

Categories: Système Tags: , , ,

Afficher une image dans un terminal

26/05/2023 Aucun commentaire

Source: korben.info

Si vous cherchez un utilitaire et une bibliothèque pour vos projets qui permette d’afficher dans un terminal une image en utilisant du code ANSI, j’ai ce qu’il vous faut. Ça s’appelle Picture- et pour l’ c’est très simple. Il vous faudra npm, donc sous pour un petit npm, il faut taper :

sudo apt-get install npm

Ensuite pour installer la bibliothèque Picture-tube, il faut faire :

sudo npm install picture-tube

Si seul l’outil en vous intéresse, ajoutez le paramètre -g

sudo npm install -g picture-tube

Ensuite, pour convertir une image, un petit

picture-tube monimage.jpg

dans le terminal et taaadaaa

 

zelda

Après, pour utiliser la bibliothèque, voici un exemple de code :

var pictureTube = require('picture-tube')
var tube = pictureTube();
tube.pipe(process.stdout);
var fs = require('fs');
fs.createReadStream('robot.png').pipe(tube);

Pour tout le reste, c’est par ici.

Categories: Logiciel Tags: , ,

Sauvegarder ses données avec Rsync

24/05/2023 Aucun commentaire

Source: journaldunadminlinux.fr

En parcourant pas mal de forums, j’ai pu remarquer que pas mal de jeunes admins ne connaissaient pas Rync.

Rsync est un petit outil de sauvegarde extrêmement puissant. Grâce à cette outil j’ai pu sauvegarder des centaines de  giga-octet de données sans problèmes.

Rsync se charge en plus de garder tous les droits et attributs de vos fichiers et gère en natif SSH pour faire une sauvegarde d’une machine vers une autre. Lire la suite…

Connection par ssh derrière un proxy html

21/05/2023 Aucun commentaire

Par défaut, ssh ne sait pas se connecter à un serveur si le client est placé derrière un proxy. Pour ajouter cette fonctionnalité, il faut :

– installer le paquet connect-proxy

apt-get install connect-proxy

– ajouter un fichier  ~/.ssh/config (juste pour un compte) ou /etc/ssh/ssh_config (configuration globale) contenant les lignes suivantes :

# on n'a pas besoin de connect pour le réseau local
# il faut modifier ou ajouter des lignes Host pour décrire votre réseau local Host 192.168.0.* ProxyCommand /usr/bin/connect %h %p # toutes les autres adresses utilisent la commande connect
# il faut remplacer l'adresse IP et le port par les valeurs de votre proxy
Host *
ProxyCommand /usr/bin/connect -H 192.168.0.1:8080 %h %p

On peut alors se connecter sans problème à un hôte par la commande classique : ssh identifiant@serveur

Categories: Réseau, Système Tags: , , ,