Thursday, January 24, 2019

Post-install Ubuntu 16.04

POST INSTALL UBUNTU 16.04.5




!!! in case you use ssd drive !!! (!!! undo if non-ssd !!!) :
echo -e "vm.swappiness=0" | sudo tee -a /etc/sysctl.conf
sudo nano /etc/fstab
add noatime :
noatime,errors=remount-ro 0 1

echo -e "#\x21/bin/sh\\nfstrim -v /" | sudo tee /etc/cron.daily/trim
sudo chmod +x /etc/cron.daily/trim



Check that your SSD supports TRIM (almost all recent models do) by
sudo hdparm -I /dev/sda | grep "TRIM supported"



if your SSD is /dev/sda. If it does, add

 --no-model-check./sbin/fstrim --all --no-model-check || true


install System :

First things to do before updating the system :
===========================================

sudo add-apt-repository universe
sudo apt-add-repository -y ppa:hamishmb/myppa
sudo apt-add-repository -y ppa:yannubuntu/boot-repair
sudo apt-add-repository -y ppa:nemh/systemback
sudo apt-add-repository -y ppa:cubic-wizard/release
sudo apt-add-repository -y ppa:webupd8team/tor-browser
sudo apt-add-repository -y ppa:diesch/testing
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-add-repository -y ppa:graphics-drivers/ppa
sudo apt-add-repository -y ppa:gezakovacs/ppa
sudo add-apt-repository -y ppa:hsoft/ppa
sudo add-apt-repository -y ppa:jonathonf/ffmpeg-4
sudo add-apt-repository -y ppa:jonathonf/vlc-3

apt-get update

apt install unity-tweak-tool git compiz compizconfig-settings-manager compiz-plugins-extra conky conky-all conky-manager hddtemp

==============================================================
meanwhile it is possible to do things in parallel, like installing the theme, as soon as git is installed :

perso theme Windows 10

Windows Theme



Icons :
cd /usr/share/icons
sudo wget -c https://github.com/B00merang-Project/Windows-10-icons/archive/master.zip
unzip master.zip

rm master.zip



Theme :
cd /usr/share/themes/
git clone https://github.com/B00merang-Project/Windows-10.git

then use Unity-Tweak to change Theme & Icons sets.

==========================================================================================
youtube-dl :
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/bin/youtube-dl
sudo chmod a+rx /usr/bin/youtube-dl


=======================
THEN IT IS TIME TO DO AN UPGRADE AND REBOOT


apt upgrade

reboot



Then, we install the most important softwares :

apt install apt aptitude rsync screen gcc gpart gparted mbr htop hwinfo iotop arj zip unzip rar unrar p7zip-full p7zip-rar atop boot-repair cifs-utils cups-pdf curl dconf-editor emacs exfat-fuse exfat-utils ffmpeg file-roller gstreamer1.0-libav gxine hardinfo libavcodec-extra libdvd-pkg libdvdread4 libmad0 libqt5concurrent5 libxine2-ffmpeg links lynx lm-sensors mc mesa-utils mp3fs mpack mpg321 mtpfs ncdu nfs-common nmon npm pavucontrol policycoreutils puddletag pv shntool synaptic sysstat systemback tagtool testdisk tree unetbootin uudeview whois wodim xfsprogs proxychains tor obfsproxy nvidia-387 curl cabextract mbr dconf-editor filezilla gthumb pavucontrol ace gnome-subtitles systemback testdisk vim vlc filezilla

Second wave (see what you can do while the following softwares are installed, in the following steps) :

apt install abcde audacity cabextract classicmenu-indicator clementine cuetools darktable devede discus dvd+rw-tools flac fontforge geany gimp gnome-panel gnome-subtitles gthumb guake handbrake icedax id3tool inkscape mailutils mkvtoolnix musescore nautilus-script-audio-convert nodejs poedit scite smartmontools smplayer stellarium tidy unison-all-gtk inkscape stellarium tor-browser shutter openshot transmission readpst fdupes ubuntu-restricted-extras dupeguru-se dupeguru-me dupeguru-pe



(shareutils ntfsutils)


Useful for getting the temperature to show in Conky :
chmod +s `which hddtemp`



/etc/fstab pour que les fichiers aillent bien dans la corbeille même s'ils proviennent de partitions ntfs
>> nota bene : change user-name by your user name, DATA and OS in this example with your eventual extra drives (you may not need these lignes so delete them in that case)

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda2 during installation
UUID=7b849ab1-f9ab-459b-9c31-ae5e968aa845 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=1d5994bb-a8e6-4103-b9e7-1dba495f16ec /home ext4 defaults 0 2
# swap was on /dev/sda1 during installation
UUID=b505ba7e-7490-4f0e-9239-c59821bd8516 none swap sw 0 0
# DATA
UUID=F68025CC80259461 /media/user-name/DATA ntfs defaults,locale=fr_FR.UTF-8,uid=10000 0 1
# OS
UUID=BC008F1B008EDBB0 /media/
user-name/OS ntfs defaults,locale=fr_FR.UTF-8,uid=1000 0 1

Sound issues :


https://askubuntu.com/questions/775523/after-updating-to-16-04-bluetooth-audio-a2dp-mode-stopped-working



vim /etc/bluetooth/audio.conf
and insert this :

# Configuration file for the audio service # This section contains options which are not specific to any # particular interface [General] Enable=Gateway,Source # Switch to master role for incoming connections (defaults to true) Master=true # If we want to disable support for specific services # Defaults to supporting all implemented services #Disable=Gateway,Source,Socket Disable=Socket # SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA) # Defaults to HCI #SCORouting=HCI # Automatically connect both A2DP and HFP/HSP profiles for incoming # connections. Some headsets that support both profiles will only connect the # other one automatically so the default setting of true is usually a good # idea. AutoConnect=true # Headset interface specific options (i.e. options which affect how the audio # service interacts with remote headset devices) [Headset] # Set to true to support HFP, false means only HSP is supported # Defaults to true HFP=true # Maximum number of connected HSP/HFP devices per adapter. Defaults to 1 MaxConnected=2 # Set to true to enable use of fast connectable mode (faster page scanning) # for HFP when incoming call starts. Default settings are restored after # call is answered or rejected. Page scan interval is much shorter and page # scan type changed to interlaced. Such allows faster connection initiated # by a headset. FastConnectable=true # Just an example of potential config options for the other interfaces #[A2DP] #SBCSources=1 #MPEG12Sources=0



Edit /etc/pulse/default.pa and comment out the line #load-module module-bluetooth-discover


Virtualbox :



https://www.virtualbox.org/wiki/Linux_Downloads


Step 1: Add VirtualBox Repository Key

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

Step 2: Add VirtualBox Repository

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -cs` contrib" 

Step 3: Installing VirtualBox

sudo apt remove virtualbox virtualbox-5.1

sudo -s -H

apt-get clean
rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get clean
apt-get update
sudo apt update sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms
sudo apt-get update

sudo apt-get install virtualbox-5.2

-- OR --

sudo apt-get install virtualbox-6.0


don't forget to add the extensions ! (allows to capture and integrates more properly the keyboard and mouse, etc. from linux drivers into windows generic drivers)
Beware with the following line (dangerous as it might mix the version numbers, better to use manual download of the extension, and upload in VirtualBox via its main parameters menu) :

sudo apt install virtualbox-ext-pack


______________
In case of problems :

sudo apt -o Acquire::https::No-Cache=True -o Acquire::http::No-Cache=True update
sudo dpkg-reconfigure libdvd-pkg

=====================================








pointage des dossiers de base :



nano $HOME/.config/user-dirs.dirs


Pour revenir aux réglages internets habituels (noms de cartes réseau) : http://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html
éditer /etc/default/grub
et ajouter la partie en vert :

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

puis reconfigurer grub :

sudo grub-mkconfig -o /boot/grub/grub.cfg



Suppression evolution :

cd /usr/share/dbus-1/services sudo ln -snf /dev/null org.gnome.evolution.dataserver.AddressBook.service sudo ln -snf /dev/null org.gnome.evolution.dataserver.Calendar.service sudo ln -snf /dev/null org.gnome.evolution.dataserver.Sources.service sudo ln -snf /dev/null org.gnome.evolution.dataserver.UserPrompter.service




Monitorix

Add the following line to your ‘/etc/apt/sources.list’ file.

deb http://apt.izzysoft.de/ubuntu generic universe
wget http://apt.izzysoft.de/izzysoft.asc
apt-key add izzysoft.asc
apt update
apt install monitorix






freefilesync
https://www.freefilesync.org/download.php

how to : https://www.linuxbabe.com/ubuntu/install-freefilesync-ubuntu-16-04



PPA's :

apt install ppa-purge


apt-add-repository ppa:relan/exfat

apt update

apt install exfat-fusesudo
apt install exfat-utils


add-apt-repository ppa:hamishmb/myppa
sudo apt-get update
sudo apt-get install ddrescue


sudo apt-add-repository ppa:hsoft/ppa
sudo apt-get update
sudo apt-get install dupeguru-se

me
pe

add-apt-repository ppa:videolan/master-daily
apt update
apt install vlc

add-apt-repository ppa:otto-kesselgulasch/gimp
apt update

apt install gimp


Gimp version 2.9 :

add-apt-repository ppa:otto-kesselgulasch/gimp-edge

apt update

apt install gimp gimp-gmic


pour revenir à la version 2.8 :
ppa-purge ppa:otto-kesselgulasch/gimp-edge

sudo add-apt-repository ppa:obsproject/obs-studio


Cinelerra (montage vidéo) :

sudo add-apt-repository ppa:cinelerra-ppa/ppa
sudo apt update
sudo apt install cinelerra-cv

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

apt install exfat-fusesudo exfat-utils boot-repair ddrescue cinelerra-cv gimp gimp-gmic classicmenu-indicator vlc unetbootin systemback tor-browser grub-customizer chromium-browser

sudo add-apt-repository ppa:saiarcot895/chromium-beta



Opera :
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera-stable/ stable non-free" >> /etc/apt/sources.list.d/opera.list'
sudo apt update sudo apt install opera

(mieux : télécharger la dernière version et l'installer avec dpkg -i : http://www.opera.com/computer/linux)

wget -c http://download3.operacdn.com/pub/opera/desktop/45.0.2552.812/linux/opera-stable_45.0.2552.812_amd64.deb

apt install libpango1.0-0

dpkg -i opera-stable_45.0.2552.812_amd64.deb


Gephi


polices ms (en cas de pb avec d'incessants rappels) :
apt remove -f ttf-mscorefonts-installer
wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb
dpkg -i ttf-mscorefonts-installer_3.6_all.deb


apt autoremove


Install Oracle : https://www.dizwell.com/wordpress/technical-articles/oracle/install-oracle-12c-on-ubuntu-16-04/
SQL Developer : https://www.dizwell.com/wordpress/technical-articles/oracle/install-sql-developer-on-ubuntu/

ms-Office 2010 avec Wine : https://www.dizwell.com/wordpress/technical-articles/linux/install-office-2010-on-ubuntu-16-04/

RÉGLAGES :

pointage des dossiers de base :

/home/{nom de l’utilisateur}/.config/user-dirs.dirs


activer la recherche récursive :

gsettings set org.gnome.nautilus.preferences enable-interactive-search false


vim /etc/updatedb.conf
chercher la ligne :
PRUNE_BIND_MOUNTS="yes"
et changer le "no" en "yes"

Barre horizontale :
gsettings set com.canonical.Unity.Launcher launcher-position Bottom

Aller activer la prise en charge linguistique dans le système puis appliquer à tout le système

Modifier la version de python utilisée de V2 à V3 (pour django par exemple)
update-alternatives --remove python /usr/bin/python2
update-alternatives --install /usr/bin/python python /usr/bin/python3 100


Google Earth
apt install lsb-invalid-mta
apt install lsb-security
apt install lsb-core
télécharger le *.deb de google earch ici : https://www.google.com/earth/download/thanks.html#os=linux#linux_dl=deb_64
puis l'installer :
dpkg -i google-earth-stable_current_amd64.deb


skype :
après avoir activé les partenaires dans canonical :

apt install skype
apt install gtk2-engines-murrine:i386 gtk2-engines-pixbuf:i386

béta :
https://go.skype.com/linux.deb


curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -




sudo add-apt-repository ppa:kamilion/ubuntu-builder sudo apt-get update sudo apt-get install ubuntu-builder
https://askubuntu.com/questions/48535/how-to-customize-the-ubuntu-live-cd

Virtualbox :
edit :

vim /etc/apt/sources.list

et ajouter :

#ajouté pour virtualbox
deb http://download.virtualbox.org/virtualbox/debian xenial contrib


Extension VM : http://download.virtualbox.org/virtualbox/5.0.24/Oracle_VM_VirtualBox_Extension_Pack-5.0.24-108355.vbox-extpack
Guest additions : (vient normalement automatiquement)

en cas d'erreur de clé :

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
____________________________________________


en cas de non accès aux fichiers apt :
sudo rm -rf /var/lib/apt/lists/* sudo apt clean sudo apt update

puis reprendre au début...

=========
wget https://www.virtualbox.org/download/oracle_vbox.asc
sudo apt-key add oracle_vbox.asc

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2F683C52980AECF

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -cs` contrib"
sudo apt update
sudo apt install virtualbox-5.2



===========





sublimetext :

apt-add-repository ppa:webupd8team/sublime-text-3
sudo apt update
sudo apt install sublime-text-installer

(on lance avec la commande "subl")

pour les packages, voir par ici : https://packagecontrol.io/installation

et ici : https://youtu.be/zVLJfrIwEP8

puis aller dans view > show console

et copier coller la suite :

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

- attendre...

- redémarrer sublimetext

puis pour installer des packages :

- shift + ctrl + P

- package control :
install package
(+ attendre)
puis taper le nom du package à installer (+ attendre que ça s'installe)
par exemple :

sublimetextintel

sidebar enhancement

emmet
livereload
sublimelinter 3
+ install pour chaque langage (retour au shell/bash de linux) :

python : pip install pylint
eslint : npm install -g eslint && eslint --init
npm install -g jsxhint
css : npm install -g csslint
...

+ install sublimelinter-... (pour chaque langage) :

sublimelinter-jshint

sublimelinter-pylint
sublimelinter-csslint


Son :
MIXXX
sudo add-apt-repository ppa:mixxx/mixxx
sudo apt update
sudo apt install mixxx


Compiz :

sudo apt install compizconfig-settings-manager compiz-plugins-extra


En cas de problème (reset Unity)

apt install dconf-tools
dconf reset -f /org/compiz/
setsid unity
unity --reset-icons


LEMP : (ne fonctionne pas en local !!!)
apt install nginx
apt install mysql-server
apt install php-fpm php-mysql
apt install phpmyadmin
ln -s /usr/share/phpmyadmin /usr/share/nginx/html
phpenmod mcrypt
systemctl php7.0-fpm start
systemctl reload nginx


LAMP :

apt install apache2
apt install php
apt install libapache2-mod-php7.0
apt install mysql-server



version rapide :

apt install lamp-server^

apt install php7.0-curl
apt install php7.0-soap


nb : pour chercher les modules dispo, faire une recherche avec :
apt-cache search php7.0

puis installer ce que l'on veut parmi la réponse :

apt -y install php7.0-mysql php7.0-curl php7.0-soap php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext


sudo a2enmod userdir
sudo a2enmod rewrite
éditer :
ajouter

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

avant le dernier

pour activer le fonctionnement des .htaccess (mod rewrite)

Redémarrer apache2
service apache2 restart
apt install phpmyadmin


Firewall :
UFW

Wordpress : (voir les explications ici : http://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress)

usermod -a -G www-data aly

et pour vérifier :

id aly

chown -R aly:www-data public_html

find . -type d -exec chmod -R 775 {} \;

vim wp-config.php

et ajouter la ligne suivante :

define('FS_METHOD','direct');

chmod -R u=rwX,go=rX

ou alors :
find . -type d -exec chmod 755 {} \; (pour tous les répertoires)
find . -type d -exec chmod 775 {} \; (si l'on a besoin d'écrire, par exemple dans wp-content/uploads)
find . -type f -name '*.php' -exec chmod 644 {} \; (pour tous les fichiers php)


Django
update-alternatives --remove python /usr/bin/python2
update-alternatives --install /usr/bin/python python /usr/bin/python3 1

apt install virtualenv python3-pip python3-dev
ln -s /usr/bin/pip3 /usr/bin/pip
virtualenv --python=/usr/bin/python3 ./mon-projet
source ~/mon-projet/bin/activate
pip install django gunicorn

Pre-requisite pour Wagtail :

sudo apt-get install python-dev python-pip g++ libjpeg62-dev zlib1g-dev
sudo apt-get install postgresql postgresql-server-dev-all

Installer ms-Office 2010 avec Wine :
https://www.dizwell.com/wordpress/technical-articles/linux/install-office-2010-on-ubuntu-16-04/


Maya
https://gist.github.com/stenstorp/96960fbe203caf74d4ca
http://lost-triangle.com/2016/09/05/install-maya-2017-on-ubuntu-16-04/

Serial number (2016) :
900-87009652
Product key:
657H1

Serial number (2017) :
900-87009652
Product key:
657I1
http://edutrial.autodesk.com/NET17SWDLD/2017/MAYA/ESD/Autodesk_Maya_2017_EN_JP_ZH_Linux_64bit.tgz


nagios (CentOS 6 or 7) :
curl https://assets.nagios.com/downloads/nagiosfusion/install.sh | sh
curl https://assets.nagios.com/downloads/nagios-network-analyzer/install.sh | sh




MONITORING


netdata :
apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl
# download it - the directory 'netdata' will be created git clone https://github.com/firehol/netdata.git --depth=1 cd netdata # run script with root privileges to build, install, start netdata ./netdata-installer.sh

# stop netdata killall netdata # copy netdata.service to systemd cp system/netdata.service /etc/systemd/system/ # let systemd know there is a new service systemctl daemon-reload # enable netdata at boot systemctl enable netdata # start netdata service netdata start

# copy the netdata startup file to /etc/init.d cp system/netdata-lsb /etc/init.d/netdata # make sure it is executable chmod +x /etc/init.d/netdata # enable it update-rc.d netdata defaults

http://localhost:19999/

ICINGA
https://www.icinga.com/products/icinga-web-2-modules/
http://www.admin-magazine.com/Articles/Understanding-Autodiscovery
install de base : https://www.vultr.com/docs/how-to-install-icinga-2-and-icinga-web-2-on-ubuntu-16-04

sudo apt-get install icinga2 nagios-plugins icinga2-ido-mysql



mettre à jour le mot de passe :
vim /etc/icinga2/features-available/ido-mysql.conf


activer ido-mysql
sudo icinga2 feature enable ido-mysql sudo systemctl restart icinga2.service


openssl passwd -1 icingaweb2
apt install snmp snmpd nmap


GRAFANA https://grafana.com/grafana/download
ajouter à /etc/apt/sources.list
deb https://packagecloud.io/grafana/stable/debian/ jessie main
puis
curl https://packagecloud.io/gpg.key | sudo apt-key add -

apt install grafana
service grafana-server restart
grafana-cli plugins install opennms-datasource


InfluxDB# On fait confiance à la clé de InfluxData curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - # On ajoute le dépôt echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
apt update && sudo apt-get install influxdb
systemctl start influxdb



Vient ensuite la configuration. J’ai gardé le fichier par défaut, j’ai simplement désactivé les sections [monitor] et [admin] parce que je n’en ai pas besoin. Après, les goûts et les couleurs…

Ensuite il va falloir préparer une base de données, dans laquelle Telegraf enverra les données qu’il collectera. Assurez-vous que le service est lancé, et connectez-vous au shell Influx avec la commande influx. Puis ensuite :

> CREATE DATABASE telegraf > SHOW DATABASES; name: DATABASES --------------- name _internal telegraf > CREATE USER telegraf WITH PASSWORD 'un_joli_password' > GRANT ALL ON telegraf TO telegraf



Voilà, normalement tout est prêt. Personnellement j’ajoute une dernière chose : une politique de rétention de données limitée à 30 jours, parce que je n’ai pas besoin de plus. > CREATE RETENTION POLICY thirty_days ON telegraf DURATION 30d REPLICATION 1 DEFAULT > SHOW RETENTION POLICIES ON telegraf name duration replicaN DEFAULT DEFAULT 0 1 FALSE thirty_days 720h0m0s 1 TRUE


Telegraf
sudo apt install telegraf
sudo mv /etc/telegraf/telegraf.conf /etc/telegraf/telegraf.conf.orig sudoedit /etc/telegraf/telegraf.conf


pour voir une config example :
telegraf -sample-config > telegraf.conf
configuration automatique :
telegraf -sample-config -input-filter cpu:mem:swap -output-filter influxdb > telegraf.conf



puis démarrage de telegraf avec la config :
telegraf -config telegraf.conf

sudo apt-get install collectd collectd-utils

apt install python-pip
apt-get install python-dev libmysqlclient-dev
pip install MySQL-python
apt install ipmitool




Truecrypt



GNS3
sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
sudo apt-get install gns3-gui
Aircrack-ng (avec airerplay de fonctionnel pour de l'injection de paquet);
Wireshark;

Ajout de polices de caractères

Pour ajouter des polices TTF à Linux ubuntu, il suffit de créer un dossier ~/.fonts/ et d'y mettre les fichiers .TTF
Accès au partage réseaux Windows

En suivant les conseils de la section "network" du UbuntuGuide.
je n'arrivai pas obtenir les accents des fichiers et dossiers par le montage fstab des dossiers du serveurs Windows.
J'ai heuresement trouvé la solution sur le forum ubuntu.
Voici ce qu'il faut ajouter au fichier /etc/samba/smb.conf:

dos charset=CP850
unix charset=UTF-8
display charset=UTF-8

Puis il faut monter les volumes windows en CIFS avec l'option "iocharset=utf8".
voici un extrait de mon /etc/fstab:
//SRV-WIN2K/Partage /mnt/share/partage cifs user,rw,credentials=/root/.smbcred,noauto,uid=LINUX-USERNAME,iocharset=utf8 0 0




Récupération d'informations
Quel process empêche le démontage d'un volume?

Pour connaitre quel process utilise un montage:

lsof +d /chemin du montage

Ce qui concerne le PCMCIA

Voici les commandes pour connaitre les informations concernant le PCMCIA:

sudo cardctl info
sudo cardctl status
sudo cardctl ident

Logiciels
Client VPN Cisco

Pour le client VPN, je n'utilise pas celui de Cisco, mais VPNC. Pour résoudre le problème de prise en compte du serveur DNS récupéré lors de l'activation du tunnel, j'ai dû modifier le scripts de connexion et celui de déconnexion. Voici les lignes que j'ai ajouté à la fin du fichier "vpn-connect":

if [ -x /sbin/resolvconf ] ; then
for i in $INTERNAL_IP4_DNS; do
echo $i >> /etc/resolv.conf.vpnc
done
if [ "$DIRECTION" = "up" ] ; then
cat /etc/resolv.conf.vpnc | /sbin/resolvconf -a "$IFACE"
else
/sbin/resolvconf -d "$IFACE"
fi
else
# in case we have no /sbin/resolvconf handle /etc/resolv.conf manually
mv /etc/resolv.conf /var/run/vpnc/resolv.conf
for i in $INTERNAL_IP4_DNS; do
echo nameserver $i >> /etc/resolv.conf
done
fi

Et voici les lignes à ajouter à la fin du fichier "vpn-disconnect":
if [ -x /sbin/resolvconf ] ; then
/sbin/resolvconf -d "$IFACE"
else
mv /var/run/vpnc/resolv.conf /etc/resolv.conf
fi




=================== problèmes de reboot (UEFI) =========================
In most cases this has to do with BIOS and (U)EFI. You can remedy it as follows:

a. First make sure that you have installed the applications gksu and leafpad:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type (or copy/paste):

sudo apt-get install gksu leafpad

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.

b. Then type in the terminal (use copy/paste):

gksudo leafpad /etc/default/grub

Find the line:
GRUB_CMDLINE_LINUX=""

...and replace it by this line:
GRUB_CMDLINE_LINUX="reboot=efi"

Save the changes and close the file.

c. Now issue this command in the terminal (use copy/paste):

sudo update-grub

Press Enter. Type your password when prompted; your password will remain entirely invisible, not even dots will show, this is normal.

Now shut your computer down (no reboot!). Turn it on again, and after logging into your user account, try to reboot it. This should work now.


===============================================================

perso thème 2/2



Windows Theme


Pour aller plus loin :
https://github.com/B00merang-Project/Windows-10/releases/download/Rolling/transpack.sh
==========

older method :

Windows 10 :
add-apt-repository ppa:noobslab/themes
apt update
apt install windos-10-themes





+ pack icones

cd /usr/share/icons/
wget -c http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/windows_10_icon_pack_v0.2.zip
unzip windows_10_icon_pack_v0.2.zip
rm windows_10_icon_pack_v0.2.zip
chmod -R go-w Windows\ 10

utiliser unity-tweak-tool pour activer le thème et les icônes


http://www.linuxandubuntu.com/home/20-best-themes-for-ubuntu-in-2017


==========================================================================================
USELESS


sudo add-apt-repository ppa:webupd8team/nemo sudo apt update
sudo apt install nemo nemo-fileroller
sudo apt install nemo-compare nemo-media-columns nemo-pastebin nemo-seahorse nemo-share nemo-emblems nemo-image-converter nemo-audio-tab
killall nemo
nemo



fix python problems :
sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/libpython2.7.so.1 sudo ln -s /usr/lib/libpython2.7.so.1 /usr/lib/libpython2.7.so.1.0



intégration dans unity :
1. gestion des icônes du bureau :
gsettings set org.gnome.desktop.background show-desktop-icons false

2. remplacement de nautilus :


xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search


REVENIR EN ARRIÈRE :
gsettings set org.gnome.desktop.background show-desktop-icons true
xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search
sudo apt-get remove nemo nemo-* sudo rm /etc/apt/sources.list.d/webupd8team-nemo-*.list





===============================================================
HOW TO


voir les lignes active d'un fichier de conf (cacher les commentaires) :
grep -v ^# /etc/apache2/apache2.conf



remove restrictions to pdf :

gs -sPDFPassword=$PASS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%stdout% -c .setpdfwrite -f locked.pdf > unlocked.pdf



pdf-repair :
mkdir --parents $HOME/.local/share/file-manager/actions
wget -O $HOME/.local/share/file-manager/actions/pdf-repair-action.desktop https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/pdf/pdf-repair-action.desktop


http://www.metashock.de/2012/11/booting-your-usb-stick-using-virtual-box-on-a-linux-host/


problèmes carte 3290 ralink :


https://askubuntu.com/questions/253632/how-do-i-get-a-ralink-rt3290-wireless-card-working?noredirect=1&lq=1


https://drive.google.com/file/d/0Bw6He1mvtZ9GSHRMYjhSeVhUMWc/view
sudo tar -xvf rt3290sta-2.6.0.0.dkms.tar -C /usr/src sudo dkms install -m rt3290sta -v 2.6.0.0 --force sudo reboot
puis :
lshw -C network
ifconfig CARTE up
service network-manager restart

à mettre dans /etc/rc.local




Graver un CD :
wodim -eject -taov speed=2 dev=/dev/sr1 -v -data myiso.iso







Problème de non-arrêt :
https://askubuntu.com/questions/508029/ubuntu-14-04-stuck-on-shutdown
sudo gedit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force apm=power_off"
sudo gedit /etc/modules
apm power_off=1


sudo update-grub

+ reboot




==============================
INFORMATIONS
==============================

lspci -vmmnn



ISO sur USB :


isoinfo -d -i /dev/sdd

lire la taille des blocks logiques et la taille du volume, puis :

dd if=/dev/sdd bs=2048 count=294454 | md5sum



https://sites.google.com/site/easylinuxtipsproject/bugs#TOC-Reboot-fails




ms - word


[0-9]@.[0-9]@.^9


fichiers par taille


$ du -ah ..DIR.. | grep -v "/$" | sort -rh


supprimer les petits virus :

find ./ -type f -size 233254c -exec ls -la {} \;find ./ -type f -size 103140c -exec ls -la {} \;



tester une clé usb :
http://oss.digirati.com.br/f3/

Réparer un disque (la structure a besoin d'un nettoyage) avec les superblocs :
https://www.cyberciti.biz/tips/surviving-a-linux-filesystem-failures.html
dumpe2fs /dev/sda2 | grep -i superblock
OU
mke2fs -n /dev/sda2

sudo e2fsck -f -b 32768 -y /dev/sda2

ou si c'est simple :
fsck -AR -t ext4 -y








copier avec progression
sudo dd if=/dev/sdb | pv -s 2G | dd of=DriveCopy1.dd bs=4096

Créer un liveusb linux :

fdisk -l
sudo umount /dev/sd??
mkdosfs -F 32 -I /dev/sd??
"sudo dd if=(your_iso) of=(USB_location)" (in my example, it's "sudo dd if=ubuntu-16_04.iso of=/dev/sdc")

Trouver les dupes dupliqués par hash :
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate


Récupérer tous les liens d'une page
lynx -dump https://techtalk.gfi.com/the-best-35-information-security-blogs-to-follow/ | awk '/http/{print $2}' > links.txt



problème apt

dpkg -i --force-overwrite /var/cache/apt/archives/ nom du paquet qui pose problème.deb


sysbench --test=cpu --cpu-max-prime=20000 --num-threads=8 run
sudo echo "blacklist mei mei_me" > /etc/modprobe.d/mei.conf




BAD SUPERBLOCK

mke2fs -n /dev/sdc1
** This command with give you a list of backups for your Superblock.

Copy one of the printed numbers and execute a command like this:


Code: e2fsck -b (your block number} /dev/sdc1


MULTI BOOT
http://multibootusb.org/page_download/


INSTALL HP PRINTER
sudo hp-setup -i










Sunday, December 9, 2012

Aerogel, what's this ?

Aerogel has been invented in the 30's but was actually improved and used by Nasa in last 3 decades. It is the thermal isolator invented. It is now open and you can SIT now.

Sunday, January 2, 2011

Who killed the electric car ?

"Who killed the electric car" is a 2006 (documentary) movie starring Mel Gibson, Tom Hanks and many others



Saturday, October 16, 2010

MIND READER





Mind reader




Do you think a computer can read your mind ?

Try, you will see it's possible !


Instructions :

Choose an integer number between 1 and 99 (let's take for example 67).
Subtract from this number each of the two digits that make it.

(in our example, the result is : 67 - 6 - 7 = 54)


Look at the table bellow : each symbol correspond to a number. Find the symbol corresponding to yours and repeat it in your mind for 5 seconds.

Finally, click on the magic square !