dimanche 16 juin 2013

#Ubuntu #scripts #Terminal #bash

Effet Arc-en-ciel :
yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
Des sons aléatoires :
perl -e 'use bytes; for($t=0;;$t++){ print chr($t*(($t>>11|$t>>23)&83&$t>>3)); }' |play -t raw -b8 -r8k -e un -

IT-Edit présentation


Advanced Bash Scripting Guide
Bash History Suggest Box

BashrcGenerator.com
Debian-facile.org/doc:systeme:commandes:alphabetique
La-commande-sed 
Les-45-commandes-linux les +utiles
Les commandes fondamentales de Linux
Les-meilleurs-alias-bash-pour-linux-unix-et-mac-os-x
MemoLinuxBash 
***TheLinuxCommandLine***

Lister le matériel de sa machine sous forme de page web :

sudo lshw -html > maconfig.html

Ubuntu / Mint: Comment connaitre le nombre de slots de mémoire disponible

Effacer les lignes vides d'un fichier :

sed '/^$/d' sources.list

Afficher les processus en cours :
ps afx 

Nautilus scripts :


cd ~/.local/share/nautilus 
wget http://distributions.free.fr/compil/4ubuntu/scripts/scripts.tar.gz
tar zxvf nautilus-scripts.tar.gz
 

Pour trouver rapidement le chemin vers une application ouvrez un terminal et tapez:

which nom-de-l-application

Pour savoir si un paquet à été installé, exemple :

dpkg --list terminat*
                       ^--début du nom de paquet recherché avec joker

Lancer la dernière commande en tant qu'administrateur :

sudo !!
 

Comparer 2 dossiers :

diff <(ls /un/dossier/au/pif) <(ls /un/autre/dossier/au/pif)
 

Guide avancé d'écriture des scripts Bash

Bash / commande

Supprimer les programmes non libres :

#!/bin/bash
#
#    Copyright (C) 2010  Rubén Rodríguez <ruben@trisquel.info>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#

if ! touch /etc/apt/sources.list 2>/dev/null
then
echo You need to run this script with sudo!
echo Try: sudo sh $0
fi

# Edit this lines if you want to use a different mirror, release or edition.
# Available editions are trisquel and trisquel-mini
MIRROR="http://es.archive.trisquel.info/trisquel/"
RELEASE="toutatis"
EDITION="trisquel"

cp /etc/apt/sources.list /etc/apt/sources.list.ubuntu-orig
cat << EOF > /etc/apt/sources.list
deb $MIRROR $RELEASE main
deb $MIRROR $RELEASE-security main
deb $MIRROR $RELEASE-updates main
#deb $MIRROR $RELEASE-backports main
deb-src $MIRROR $RELEASE main
deb-src $MIRROR $RELEASE-security main
deb-src $MIRROR $RELEASE-updates main
#deb $MIRROR $RELEASE-backports main
EOF

sed -i 's/\(.*\)/#\1/' /etc/apt/sources.list.d/*

cat << EOF > /etc/apt/preferences.d/pinning
Package: *
Pin: release o=Trisquel
Pin-Priority: 1001
EOF

export DEBIAN_FRONTEND=noninteractive
apt-get update 2>&1 | COLUMNS=500 tee /var/log/trisquelize.log
apt-get -y --force-yes install trisquel-keyring 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-key add /var/lib/apt/keyrings/trisquel-archive-keyring.gpg 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-get remove --purge plymouth-theme-ubuntu 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-get remove --purge plymouth-theme-ubuntu-text 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-get -y --force-yes dist-upgrade 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-get install -y --force-yes --no-install-recommends $EDITION $EDITION-recommended 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
apt-get install -y --force-yes --no-install-recommends linux-image-generic 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize.log
rm /etc/apt/preferences.d/pinning

echo -------------------------------------------
echo All Trisquel packages succesfully installed.
echo Your system may still have some non-free packages installed,
echo I\'ll now ask you for removal, one by one.
for i in aee afio app-install-data-commercial app-install-data-partner app-install-data-ubuntu b43-fwcutter capiutils chromium-browser chromium-browser-dbg chromium-browser-inspector chromium-browser-l10n chromium-codecs-ffmpeg chromium-codecs-ffmpeg-dbg chromium-codecs-ffmpeg-extra chromium-codecs-ffmpeg-extra-dbg chromium-codecs-ffmpeg-nonfree chromium-codecs-ffmpeg-nonfree-dbg d4x-common envyng-core envyng-gtk envyng-qt fglrx-modaliases firefox-3.5-branding firefox-branding freesci freesci-doc gstreamer0.10-pitfdll helix-player ipppd isdnactivecards isdneurofile isdnlog isdnlog-data isdnutils isdnutils-base isdnutils-doc isdnutils-xtools isdnvbox isdnvboxclient isdnvboxserver ivman jockey jockey-common jockey-gtk jockey-kde libmoon libmoonlight-desktop2.0-cil-dev libmoonlight-gtk3.0-cil libmoonlight-system-windows-controls2.0-cil libmoonlight-system-windows3.0-cil libmoonlight-windows-desktop3.0-cil libubuntuone libubuntuone-1.0-1 libubuntuone-dev libubuntuone1.0-cil libubuntuone1.0-cil-dev monodoc-moonlight-manual moon moonlight-plugin-core moonlight-plugin-mozilla moonlight-tools moonlight-web-devel mozilla-helix-player ndisgtk ndiswrapper ndiswrapper-common ndiswrapper-utils-1.9 nvidia-173-modaliases nvidia-180-modaliases nvidia-185-modaliases nvidia-96-modaliases nvidia-common nvidia-current-modaliases nvidia-settings ophcrack ophcrack-cli pdftk pppdcapiplugin rman scribus-ng-doc scsi-firmware linux-firmware software-center tatan ubufox ubuntuone-client ubuntuone-client-gnome ubuntuone-client-tools ubuntuone-storage-protocol user-mode-linux vrms
do
echo WARNING: non-free package found: $i
echo Do you want to remove it?
apt-get remove --purge $i
done

echo -------------------------------------------
echo System successfully Trisquelized!
echo If you want to use the Trisquel default desktop layout and
echo other gconf settings, run this as user:
echo gconftool --recursive-unset /apps


 
 
Personnalisez-votre-shell
Personnalisez-votre-shell-1

Introduction-au-scripting-avec-python 
 
Une montre et la date dans le terminal avec la commande :
tty-clock -s
 

Placer tous les fichiers des dépots /concaténer dans un fichier récapitulatif :

Aller dans le répertoire /apt/sources.list 
for i in `ls | grep list$`; do grep . $i >> sourceslist_regroupes.txt; done


Alias.sh

BashScripts .org

Command Line Fu

Explain Shell

ShellSpells

Man.cx

Man-Linux-Magique

Shell Unix

JEUX

luffah.xyz/bidules/Terminus/

Divers :

BlaireauLinux-bash

Bleepingcomputer/making-your-own-linux-bash-commands

Cool Retro Term


 

Cut-down-on-linux-command-line-typing-with-these-10-handy-bash-aliases

Les 45 commandes Linux les plus utiles

Pixelbeat/Linux_Commands

Scripts_bash_pour_Debian/Ubuntu












Aucun commentaire:

Enregistrer un commentaire

Archives du blog