Section shell

Replace a string in a large file with VI

Written by on 29/03/2021
Category:   Shell
Tags:   bash, shell, command line, linux, VI, VIM
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" ...

Microsoft Teams: Join a chat room automatically from a link on Linux

Written by on 28/03/2021
Tags:   Microsoft, shell, linux
Today, using Teams on Linux is essential given its prevalence in the corporate world.You will always have a contact, a client, or a work group that uses this tool.And it works very well on Linux. EXCEPT since the latest update, where the direct access links to meetings no longer work.You click the link, a web page opens, then you click on "Open your Teams application". Then, the application opens, but not the conference. And since we're not on Zoom, it's impossible to open the c...

SVN: Resolve a conflict on a folder

Written by on 15/04/2015
Category:   Shell, SVN
Tags:   svn, shell
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: Install RabbitVcs

Written by on 29/10/2014
Category:   Linux, Ubuntu 14.04 LTS, Shell, SVN
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...

ZEND: Create a CLI file and activate it in the shell

Written by on 15/05/2014
Category:   PHP, Shell, Zend
To add a cron job and make it accessible in the shell, you first need to configure your environment to point to the libraries.Step 1: Add the zf script to the /usr/bin/ directory (zf.sh and zf.php) These files are available in the bin directory of the ZendFramework 1.x library. You can either copy them or create a symbolic link.Step 2: Configure your bash to recognize the zf alias. Edit the ~/.bashrc file and insert the following line alias zf="/usr/bin/zf.sh" Step 3: Add the global variable ...

Shell: Delete all .svn recursively

Written by on 15/05/2014
Category:   Shell, SVN
Tags:   svn, bash, shell, command line
To recursively remove all svn management files (.svn) from a working copy, simply navigate to the root directory of your working copy and execute the following command: find . -name ".svn" -exec rm -rf {} \; Another solution is to create an alias in your ~/.bashrc and then execute the command when needed: alias rmsvn='find . -name ".svn" -exec rm -rf {} \;'

SVN: Perform a recursive add in shell

Written by on 15/05/2014
Category:   Shell, SVN
Tags:   svn, bash, shell, command line
To add files recursively from the command line with svn, we have several possibilities.The first one, probably the cleanest: svn add --force * --auto-props --parents --depth infinity -q Although only the following options seem really necessary: svn add --force * Then there are alternative solutions a bit more complicated to understand: svn status | grep '?' | sed 's/^.* /svn add /' | bash svn add `svn status .|grep "^?"|awk '{print $2}'` svn st | grep "^\?" | awk "{print \$2}" | xargs svn...