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…
Tag: linux
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>&…
PHP download a file through direct link and save it on my server
I’m trying to run PHP script (from a Linux server) that will download a file through direct download link and save it on my server. here is the script I’m using: for some reason it doesn’t work for me, any suggestions ? Answer You need to verify that the ports are open on your firewall and u…
Maven, error copying a file with antrun
I have some problems copying files with Maven. I use the antrun plugin in this manner: (I want to copy the file jdk1.5.0_22.tgz to a temporary folder) And it works fine. Now I make a small change to be independent from the jdk file version: (I only change jdk1.5.0_22.tgz to jdk*.*) In this case I have the fol…