Discuss your project

PartITech blog

Technology blog

Technical analysis, practical guides and field experience to build, modernize and maintain sustainable applications.

232 articles Page 17

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/ Precautions before executi...

do a hard reset of a working copy in git

To revert to a clean working copy, you can delete all the files in your directory, leaving the hidden git files, and run the following command:git reset --hard origin/dev Precautions before executing the order This tutorial retains the command and the context of its publication. Before using it on a current repository, inspect the branch, the modified files, and the exact target: git status --short git log --oneline --decorate -5 Create a backup branch or tag when the operation rewrites hi...

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 Precautions before executing the order This tutorial retains the command and the context of its pu...

Ubuntu: enable numlock at startup

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 to a Bluetooth output

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 Version context This procedure describes the software and the environment available at the time of its publi...

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 Version context This procedure describes the software and the environme...

shell: mirror a directory with lftp

Migrating a large website (several gigabytes) can be a tedious task to do from your workstation (with filezilla, for example). If you have a machine at a hosting provider with shell access, the lftp solution can quickly prove to be the ultimate alternative.Retrieve the files:lftp -e 'mirror /repertoir/distant /repertoir/local' -u login,password -p 21 www.host.comSend the files:lftp -e 'mirror -R /repertoir/local /repertoir/distant' -u login,password -p 21 www.host.comSend the files with 10 si...

Ubuntu: Install suPhp

This installation has been tested on Ubuntu 14.04LTS but could also be used for a Debian production server.Installation of Basic Packagessudo apt-get install \ build-essential \ fakeroot dh-make \ debconf execstack \ dh-modaliases \ xserver-xorg-dev \ automake \ autoconf \ libaprutil1 \ libaprutil1-dev \ libsvn-dev \ wx2.8-headers \ libwxgtk2.8-dev \ libxml2-dev \ libpcre3-dev \ libbz2-dev \ libcurl4-openssl-dev \ libjpeg-dev \ libpng12-dev \ libxpm-dev \ libfreetype6-dev ...

Ubuntu: Install RabbitVcs

In fact, RabbitVcs is very easy to install... Except when there's a problem, and then... one can search for a long time 😟Here's how to resolve most installation issues on Ubuntu 14.04LTS.1 – Add the sourcesudo add-apt-repository ppa:rabbitvcs/ppa or add the source to your /etc/apt/sources.list filedeb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu trusty main2 – Install the packages sudo apt-get update sudo apt-get install rabbitvcs-cli rabbitvcs-core rabbitvcs-gedit rabbitvcs-nautilus3 3 – M...

WordPress: Reset the admin password

Useful when you receive project delivery, and the idiot who delivers it forgets to tell you that the password is admin1234. Instead of being stuck without being able to run your tests, you just need to apply the following SQL query:UPDATE wp_users SET user_pass = MD5( 'new_password' ) WHERE user_login = 'your-username'; Reproduce this customization today The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the publication. Test the c...

WordPress: Delete all revisions in SQL

Revisions are good, but they consume database space. A little cleanup is necessary from time to time.DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision' Reproduce this customization today The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the publication. Test the code in a staging environment with the exact version of t...

Ubuntu: remove unnecessary searches in Unity

Execute this command to remove all the search packets. sudo apt-get autoremove unity-lens-shopping && sudo apt-get autoremove unity-lens-music && sudo apt-get autoremove unity-lens-photos && sudo apt-get autoremove unity-lens-gwibber && sudo apt-get autoremove unity-lens-video Version context This procedure describes the software and the environment available at the time of its publication. The packages, interfaces, and repositories mentioned may have changed or disappeared; first check th...