linux

help with installing ubuntu on an external drive

Hello I am trying to install ububtu on an external drive. I am a programmer that wants to start using linux. I installed the usb installer from the ubuntu website and followed all the steps . when I get to the part where I have to choose the disk space it says an error when moving forward "No root file system is defined". Ive been do...

How can I automatically load alias on startup?

I am trying to add the alias ll = "ls -l", and I am wondering how can I load it every time I login to linux. ...

How to handle OpenSSL SSL_ERROR_WANT_READ / WANT_WRITE on non-blocking sockets

The OpenSSL library allows to read from an underlying socket with SSL_read and write to it with SSL_write. These functions maybe return with SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE depending on their ssl protocol needs (for example when renegotiating a connection). I don't really understand what the API wants me to do with these res...

Change of mysql db password brings down website

Hello, Each time I change the MySQL db password, and update the dbconfig file, the website is down. I also flush privileges Any idea why? ...

Problems upgrading APC 3.0.19 -> 3.1.4

On the gentoo Linux server I use, I've just upgraded APC from 3.0.19 to 3.1.4 and it appears as if something is not working properly there. It appears as if cache entries which should have been deleted (either explicitly or via TTL expiry) stay in place and so cache use keeps growing until it reaches the max usage memory and then the ser...

Linux: Run a binary in a script

Hi all, i want to run a program via script. normally i type ./program in the shell and the program starts. my script looks like this: #!/bin/sh cd /home/user/path_to_the_program/ sh program it fails, i think the last line went wrong... i know this is childish question but thx a lot! ...

Why does man 2 open say this?

I ran into this question while typing man 2 open. It says that there are two kinds of open, one with two args, and one with three! last time i checked we could not overload functions in C. How did they do this? did they write in C++? int open(const char * pathname, int flags); int open(const char * pathname, int flags, mode_t mode); ...

how to make installable for java in linux

hello, i have developed an application in java for linux i need to install it in linux in my system(ubuntu 10.04) and how to make executable for linux .i have the application as jar file ...

ubuntu/linux bash: traverse directory and subdirectories to work with files

let me start off with what I need; the program is given a directory, it will then examine all the files in the directory (works) and do stuff to the files (waiting till it can find all the files for this part). then it will look for subdirectories and re-run its self for each subdirectory. the directory I'm testing with looks like this:...

Running apt-get for another partition/directory?

I have booted my system from a live Ubuntu CD, and I need to fix some package problems. I have mounted my hard drive, and now I want to run apt-get as if I booted normally. ie change the working directory for apt-get so it will work on my hard drive. I have done this before, but I can't remember the syntax. I think it was only some flag,...

pthread_create from a child process

I'm sure I'm missing something basic, but I'm writing a program that fork()s several child processes, each of which create several pthreads. It seems that the pthread_create call never works from a child process. Here is sample code to explain what I mean: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> ...

versatile pthread based multithread utility library

Hi folks. I don't want to reinvent the wheel, and what I'm looking for most likely already exist in the FOSS world. I'm looking for a pthread bases utility library that implements often used primitives to do communication between threads. My main need is some kind of blocking queue for fixed size messages and the ability to wait for ...

help with bash script

i have a homework: The student should write a bash program named fix-permissions.sh that accepts a list of users as argument If a user or more are given as arguments, the script should reset files permissions as follows.... "accepts a list of users as argument" can someone explain it to me please? ...

Terminal - Delete All Folders Not Conatining .mp3 Files

Hi, I'm using Banshee on Linux and I have it auto-organize my music collection in folder hierarchies. When I add a new album to my Music folder, Banshee automatically moves (and renames) the mp3s and puts them into the correct Artist folder. If there is no other file in the folder, then the folder is also deleted, but if other files are ...

C++ on Linux not recognizing commands like exit() and printf()

I get these errors after issuing a g++ command on a .cpp file: error: ‘exit’ was not declared in this scope error: ‘printf’ was not declared in this scope The problem is that when I compiled this program on another linux machine, everything went fine. I tried searching around, but all I found was that I need to include files like 'stdli...

Storing pid file for a daemon run as user

Is there a preffered place to store a pid file for a daemon that's run as a user? /var/run is the standard place, but this is for a user daemon so it doesnt have write privelages there. Presumably my daemon will be started from .profile or .bashrc or something. Is just saving it to /tmp a bad idea? ...

export env at archlinux shell

when I at company , I have to export 3 enviroment variables, http_proxy,https_proxy,all_proxy, I wrote a file ~/bin/setproxy like this #! /bin/sh export http_proxy=http://......:8888 export https_proxy=http://......:8888 export all_proxy=http://......:8888 but when I execute this file at bash, then use env | grep http_proxy , I got n...

How trasform a python program .py in an executable program in Ubuntu ?

I have a simple python program .py and I want an executable version ( for UBUNTU LINUX ) of this program and avoid to run it by terminal with "python myprogram.py". How can I do that ? ...

started from command line?

Hi, I have a simple C/CPP process running on a linux system. This is a.out. Another process is capable to start a.out inside its code. This is b.out. What code do I need inside a.out to understand that it is executed from the command line? Eg ./a.out Is there a way a process to know if it started from the cmd or started from another ...

How create an Executable file + Launcher in Ubuntu from a python script ?

I have created a simple program in python. Now I want trasform this script in an executable program ( with hidden source code if possible ) and when I click 2 times on it, the program install itself on the ubuntu ( in the /usr/lib or /usr/bin I think ) and it will create a new launcher in the Application -> Game menu. How can I do that ...