Skip to content

Run html2text using parallel

I am using html2text from Github in-which I was able to run-it on all the .html files in my folder using for file in *.html; do html2text “$file” > “$file.txt”; done but it’s some-what slow. How can I use html2text with parallel on all my .html files? Answer The original answe…

How to remove/modify syslogd message’s header?

I’m currently use the syslogd of busybox for logging some information. However, I’m unable to modify the message’s header. I log the message like this: And I got this output: I want to replace message’s header with epoch time format like this: Or is there any way to completely remove t…

Use environment vars with head

I need to use some vars in a script where I use tail and head, my script works when I type it in the terminal but when it is in a .sh file I get this error from the head command: The error comes from this pipe of my script: I tried using variables in another script where only declaring

linux command to delete the last column of csv

How can I write a linux command to delete the last column of tab-delimited csv? Example input aaa bbb ccc ddd 111 222 333 444 Expected output aaa bbb ccc 111 222 333 Answer It is easy to remove the fist field instead of the last. So we reverse the content, remove the first field, and then revers it again.

Yii2 call the console command not from the project folder

Hello. I created the console command in Yii2: I want to call this command in cron,and for testing I try to call it from the console, when I’m in the project folder: Everything works fine. But, if I call this command when I’m in a different directory, I get some errors. First, i got Seeing this, I …

How to use cron on a simple script

I want to use cron for execute a script periodically. I want to try a simple script first but it does not work. This is my script (scritp.sh) which permission are 700: And this is the crontab file when I edit it with the command crontab -e: EDIT: I have that script on /home/padro/Documents folder. What I do a…

linux find files with optional character in their name

suppose I have two files: ac and abc. I want to find a regex to match both files. Normally I would expect the following regex to work, but it never does: I have tried escaping or not the questionmark, this never seems to work. Normally in the regex documentations I have found; ? means: previous character repe…

Fail event on mdadm

I received this error: This is an automatically generated mail message from mdadm running on host.xx.xx A Fail event had been detected on md device /dev/md2. It could be related to component device /dev/sda2. Faithfully yours, etc. P.S. The /proc/mdstat file currently contains the following: unused devices: T…