There is a CSV file with some columns, the first column is a 5 digit customer number, the other columns are separated with “;” Here is a example: If the first column is empty than I need to set the last given customer ID. The result should look like: Now I read the file linewise with bash script, …
How to rename all files in a folder removing everything after space character in linux?
Hello I can’t use well the regular expressions it’s all day I’m searching on Internet. I have a folder with many pictures: 50912000 Bicchiere.jpg 50913714 Sottobottiglia Bernini.jpg I’m using Mac OS X, but I can also try on a Ubuntu, I would like to make a script for bash to remove all…
python 3.x no module named sqlalchemy after installation
I’m trying to install sqlalchemy to interact with mysql database for my python 3.x with ubuntu 12.04, but then when I import the sqlalchemy it says no module named sqlalchemy. This is what i did with installation: Did I do something wrong? Answer By using apt-get you have installed sqlalchemy in the def…
Number of processors/cores in command line
I am running the following command to get the number of processors/cores in Linux: It works but it does not look elegant. How would you suggest improve it ? Answer nproc is what you are looking for. More here : http://www.cyberciti.biz/faq/linux-get-number-of-cpus-core-command/
netstat commands to run on unix server, what commands should I use for my use-case and why?
Sorry in advance for such a noob question, but I’m certainly a noob. My question is what does it mean to LISTEN or ACCEPT on a port as it relates to my example? EXAMPLE: I have a tomcat server, and It will use port 8080. I want to make sure that port is available for me to use. What commands
Detecting number of CPU cores on Android from native code
I’m using sysconf( _SC_NPROCESSORS_ONLN ) (which, I believe, is the recommended way) to get the number of CPU cores. It works fine or Mac and Linux, but on my 4-core Android tablet it returns 2. How can I get the actual number of cores on Android from native code (without using JNI to call Java Android …
nasm assembly linux timer or sleep
I’m trying to find a way to make my code wait for two seconds before proceeding. I’m using nasm for Linux in protected mode, so I can only use int 80h. I found a syscall called “alarm” (27) and another called “pause” (29). However, when I try to use those, the program waits…
How to clear screen on protected mode
I’m using NASM for Linux and I’d like know how, in the protected mode, you can clear the screen. I found a solution using the int10h, but on the protected mode I can only use int80h. Thanks in advance. Answer You can write x1b[2J to the standard output so the terminal get cleared and fix the curso…
PHP: how to start a detached process?
Currently my solution is: and in file.php is there any way I can do this just with exec? Answer No, detaching can’t be done with exec() directly (nor shell_exec() or system(), at least not without changing the command, and using third-party tool which does detach). If you have the pcntl extension instal…
Bash script processing limited number of commands in parallel
I have a bash script that looks like this: But processing each line until the command is finished then moving to the next one is very time consuming, I want to process for instance 20 lines at once then when they’re finished another 20 lines are processed. I thought of wget LINK1 >/dev/null 2>&…