Skip to content

Tag: linux

replace in text with a var with some new lines

I have a var $MY_VAR which contains some new lines: And a file my_file.txt with a value that has to be replaced: I try to replace it using: That results into the following error: Answer I finally found a totally different solution by removing the value to replace and split my file into two parts: my_file_part…

FTDI FT232R force flushing FIFO

Is there a way to readout continuously or force-flush the RX fifo of FTDI FT232R. I want to timestamp the received bytes and therefore want to avoid that the received bytes are being sent in chunks. I want to force the chip to sent them via USB as they arrive. Answer FT232R AFAIK, it is impossible for FT232R.…

Cannot access to mysql 8.0 after change root password

I have mysql 8.0 work under centos 7 minimal. I change the password using this command mysqladmin -u root -p’Pass-123***’ password Myp@$$123 . After this , i try to access to mysql via mysql -p but i cannot access with the new password. How i can do this ? Answer You changed the password commandli…

MySQL Alter Table DB Freezes

I’m using Ubuntu 16.04.3 and mysql Ver 14.14 Distrib 5.7.22. When I try to alter my db table column with the following command the database appears to freeze; mysql> alter table records modify column name varchar(150); Table size is 2.8MiB (6,000 records). I’m simply trying to change the varcha…

Remove part of a string by using bash

I have the path /home/bamboo/bamboo-agent-home/xml-data/build-dir/NG-VOSGQL239-JOB1 and would like to get just /home/bamboo/bamboo-agent-home/xml-data/build-dir/ How can I delete the last part of the path if it can be with different lengths by using Bash? Answer Using bash regex =~:

Python Makefile Libraries

Although it may sound trivial how should I import libraries in Python makefiles? I am creating a basic Python makefile such as: However I am using specific libraries inside my_file.py, not included/imported in the basic package, for instance: xlswriter. So if someone tries to run the code they must type in te…