Discuss your project

Category

Shell

18 articles

Configure Exim to send emails with Gmail

We will see how to configure Exim4 to send system emails with Gmail. This will ensure that your emails sent with your CRON are correctly routed and do not end up in spam. Let's install Exim4 apt-get install exim4 Configuration dpkg-reconfigure exim4-config Choose: mail sent by smarthost; no local mail Then answer the questions as follows: System mail name: YOUR_HOSTNAME IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 ; ::1 Other destinations fo...

Install Dropbox headless on a Linux server

Dropbox est un service de stockage et de partage de copies de fichiers locaux en ligne proposé par Dropbox Inc. Via un agent installé sur votre ordinateur ou mobile, il est capable de synchroniser une arborescence sur le cloud et permet ainsi une sauvegarde et un versionning de celui-ci.L’usage classique de Dropbox est d’utiliser un outil sur votre Desktop. Un usage moins évid...

Migration and upgrade of a GitLab-ce server

Every 5 years, it's the same song and dance. The Debian LTS version is expiring, and it's time to update the server. It's also an opportune moment to upgrade to a newer machine to benefit from improved performance.If we have a SATA hard drive, it's better to start with new disks regardless, since their lifespan is limited. So we will proceed with a series of backups on the old server, transfer them to the new one, and reinstall everything as it was. In our case, we were on Debian 8, which sup...

Replace a string in a large file with VI

A large file, and no powerful enough editor at hand to perform a search/replace? It's simple with vi. Edit the file with the vi command vi file Then in the editor type: :%s/mystring1/mystring2/ Remplacer une chaine dans un gros fichier avec VI Alternatively, there is another option with sed: sed -i -e "s/mystring1/mystring2/g" file If the string contains special characters, they will need to be escaped with a backslash '\' sed -i -e "s/\#mystring1/\#mystring2/g" ...

[GIT] Export revisions with file structure

To perform an export, similar to how tortoiseSVN does which allows exporting files from one or several revisions, along with their directory structure (which is convenient for a production deployment), simply execute the following command, specifying the previous revision and the latest revision: git diff-tree -r --no-commit-id --name-only 6c16aaab 35168851| xargs tar -rf /var/www/delivery.tar

Delete a branch in git

To completely remove a branch from your git server (including history), simply use the following command:git push origin --delete [branch name]Then you need to run the following command on the instances to remove the information of the deleted branch: git fetch --all --pruneIf for one reason or another, you need to delete one or more files from previous commits, here is an interesting article on the subject:https://help.github.com/articles/remove-sensitive-data/

SVN: Resolve a conflict on a folder

To resolve this kind of conflict on a working copy: svn: E155015: Échec de la propagation (commit), détails : svn: E155015: Arrêt de la propagation : '/var/www/prj/wp-content/cache' demeure en conflit To do this: svn resolve --accept=working /var/www/prj/wp-content/cache For an entire directory (accept all) svn resolve --accept=working --depth infinity

[Ubuntu] enable numlock on boot

To enable the numeric keypad on startup, install numlockx and  create or edit the file sudo apt-get install numlockx puis créez ou éditez le fichier de conf suivant : #Pour 14.04 LTS sudo vi /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf #Pour 16.04 LTS /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf and add the following information: #Pour 14.04 LTS [SeatDefaults] greeter-setup-script=/usr/bin/numlockx on #Pour 16.04 LTS [Seat:*] greeter-...

[ubuntu] Force sound output to a Bluetooth device

On Ubuntu 14.04 LTS, a critical and unpatched bug has been reported. When a Bluetooth device is paired, it is impossible to force the system to play sound through it. The workaround is to force the output in shell: sudo pactl list cards short 0 alsa_card.pci-0000_00_1b.0 module-alsa-card.c 4 bluez_card.FC_58_FA_89_91_2C module-bluetooth-device.c sudo pactl set-card-profile 4 a2dp

[Ubuntu] Install Java 8 (JDK 8) on Ubuntu

Step 1: Install Java 8 (JDK 8) $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer Step 2: Verify the Java version $ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) Step 3: Generate the default variables $ sudo apt-get install oracle-java8-set-default