690 shaares
3 liens privés
3 liens privés
4 résultats
taggé
linuxcommand
Pense-bête
SEARCHED=<file>
for f in $(find . -type f -name "*jar"); do echo "Searching in $f: "; jar tvf $f | grep $SEARCHED; done
Autre solution (moins bien)
#!/bin/bash
find . -type f -name "*jar" -exec sh -c '
export FILE
for FILE
do
jar tf $FILE | grep -H --label=$FILE $1
done' sh {} +
Useful RAID commands :
# Conf mdadm
cat /etc/mdadm.conf
# Current md stats
cat /proc/mdstat
# detail on a MD device :
mdadm --query --detail /dev/md3
# detail on partition
mdadm --examine /dev/sda3
Complete with OVH RAID help
# Copy partition table from safe disk to new disk (for GPT partition - see fdisk -l)
sgdisk -R /dev/newdisk /dev/safedisk
# afterwards, you have to randomize the GUID on the new hard disk to ensure that they are unique (from [howto forge](https://www.howtoforge.com/tutorial/linux-raid-replace-failed-harddisk/))
sgdisk -G /dev/sdb
# check partitions are copied
sgdisk -p /dev/safedisk
sgdisk -p /dev/newdisk
# Add each partition to RAID cluster :
mdadm --manage /dev/mdX2 --add /dev/newdiskX2
mdadm --manage /dev/mdX1 --add /dev/newdiskX1
# follow reconstruction with
mdam --detail /dev/mdX
or
cat /proc/mdstat
# Rebuild Status : 21% complete
Pour ajouter des fichiers git-lfs
- Ajouter des fichiers Examples
git lfs track <mybigfile.jar>
git lfs track "**/*jar"
git lfs track "**/*jar"
git config lfs.fetchinclude "textures,images/foo*"
git config lfs.fetchexclude "media/reallybigfiles"
- Commiter le nouveau tracking
git add --renormalize
git lfs migrate info
git lfs migrate import --include="mybigfile.jar"
git lfs migrate info
- Lister les fichiers LFS
git lfs ls-files -a -s
Pour nettoyer entre autre les historiques des fichiers LFS :
- download jar
- create a clean copy the repo (git clone)
- execute :
java -jar bfg-1.14.0.jar --delete-files database-hpa.tar.gz hpa-portal
git reflog expire --expire=now --all && git gc --prune=now --aggressive
Installation package
dpkg -i <package.deb>
Info package
apt-cache show <package>
dpkg --print-avail PACKAGE_NAME
Fix broken package
apt-get -f install <package>
Quel repository a installé le package : spécifique, priorité, ...
apt-cache policy <package
Quel package a installé un fichier :
dpkg -S <filename>
dlocate <filename>
Quel package installé utilise <packagename>
apt-cache rdepends --installed <packagename>
Lister les packages qui prennent le plus d'espace
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
Nettoyer /var/apt/cache
sudo apt-get clean
Marquer un paquet en auto
apt-mark auto python-matplotlib-data