Fermer

Login

You've been logged-out from spontex.

Authenticate

Your spontex.org account




Or




New here?
Create your account in a single clic


   
  
  
  
You are done! (oui, on vous demande SEULEMENT ça : login / MDP. Le reste, on s'en fout !)
Validate:


Données personnelles ?

Information on this website is public but you have to be logged-in to share. Login, means "give a username and a password". Then, you'll be able to fill some more but nothing is mandatory. If you can read this, it means you clicked on something restricted to logged-in. NOBODY DIED registring here. If you wish not to register, feel free, but don't click on that link again :-)

Titre
Please share those informations... but do not forget to add a link to spontex!
you should never read that.

[Linux] Publiez vos scripts


Avatar of Ghost
Ghost - Aug. 27, 2011 - 11:56:17

Après une discussion endiablée avec Alcoofolies, j'ai eu l'idée de publier ici nos scripts maison ou d'ailleurs.

Vous pouvez proposer du pastebin, du bc, des liens d/l… peu importe, le but est de partager ;)


Avatar of Ghost
Ghost - Aug. 27, 2011 - 11:39:14

En voilà un fort utile pour ajouter un certificat CACert pour Chrome que j'avais fait suite au topic de Beri.


#!/bin/bash
############################################################
# Author : Ahmet
# Date : Juillet 2011
#
# Permet d'ajouter automatiquement le certificat CACert
#
############################################################
#
CURL=`which certutil`
CERTUTILS=`which certutil`
#
if [ "$CURL" == "" ]
then
	echo "Commande 'curl' requise, merci d'installer 'curl'"
	exit
fi
#
if [ "$CERTUTILS" == "" ]
then
	echo "Commande 'certutil' requise, merci d'installer 'libnss3-tools'"
	exit
fi
#
echo "------------------------------------------------"
echo "Récupération du certificat root.crt"
echo "------------------------------------------------"
curl -k -o "cacert-root.crt"   "http://www.cacert.org/certs/root.crt"
#
echo "------------------------------------------------"
echo "Récupération du certificat class3.crt"
echo "------------------------------------------------"
curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
#
echo "------------------------------------------------"
echo "Installation du certificat root.crt dans $HOME/.pki/nssdb"
echo "------------------------------------------------"
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt 
#
echo "------------------------------------------------"
echo "Installation du certificat class3.crt dans $HOME/.pki/nssdb"
echo "------------------------------------------------"
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt


Avatar of Ghost
Ghost - Aug. 27, 2011 - 11:41:33

Un autre pour ajouter les clefs pour debian et ses dérivées (ubuntu…)


#!/bin/bash
##############################################
# Author : Ahmet
# Date : Octobre 2010
# Ajouter une clef d'un dépôt pour apt
##############################################
#
if [ $# -lt 1 ]
	then 
          echo "Usage: $0 clef_a_installer"
		exit
fi
#
gpg --keyserver keyserver.ubuntu.com --recv-keys $1
gpg --armor --export $1 | sudo apt-key add -

(c'est le serveur ubuntu, je n'avais pas trouver celui de debian à l'époque).


Avatar of Ghost
Ghost - Aug. 27, 2011 - 11:47:52

Lancer Wireshark sans droits admin, fonctionne sous Debian, à adapter selon la distrib.


#!/usr/bin/sudo /bin/sh
##############################################
# Author : Ahmet
# Date : Octobre 2010
#
# Lancer Wireshark sans droits admin
# 
##############################################
if [ $# -lt 2 ]
  then 
    echo "Usage: $0 GROUPE(nom du groupe système pour Wireshark) USER(quel utilisateur ?)"
    echo "Usage: $0 exemple: sh ./wireshark.sh pcap ahmet"
    exit
fi
#
GROUPE=$1
USER=$2
#
# Groupe système pour Wireshark
addgroup --system $GROUPE
#
# On ajoute un utilisateur au groupe système.
adduser $USER $GROUPE
#
# On change le groupe propriétaire et on applique un nouveau masque de permissions. 
chgrp $GROUPE /usr/bin/dumpcap
chmod 750 /usr/bin/dumpcap
#
# On indique au gestionnaire de paquets Debian que ces nouvelles propriétés doivent être conservées lors des mises à jour à venir.
dpkg-statoverride --add root $GROUPE 750 /usr/bin/dumpcap
dpkg-statoverride --list /usr/bin/dumpcap
#
# On modifie le contexte de travail du programme dumpcap.
setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
getcap /usr/bin/dumpcap
#
echo "Si ça ne marche pas tentez un reboot, au pire des cas essayez :"
echo "EDITOR=vim"
echo "export EDITOR"
echo "visudo"
echo "et ajoutez cette ligne"
echo "ahmet	ALL = NOPASSWD: /usr/bin/wireshark, /usr/bin/tshark"
echo "!wq pour enregistrer et quitter"



New post

You'll be able to post an answer when you are logged-in
Login/create an account