linux

How do I connect to a local Socket in C#?

I'm trying to adapt this python code I found for connecting to the Dropbox daemon: def connect(self, cmd_socket="~/.dropbox/command_socket", iface_socket="~/.dropbox/iface_socket"): "Connects to the Dropbox command_socket, returns True if it was successfull." self.iface_sck = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sck...

Posixy way to launch browser?

Is there a 'Posixy' way to open an URL, preferrably in the default browser? I would like to do something like ShellExecute(0, _T("open"), url, 0, 0, SW_SHOWDEFAULT); that works on GNU/Linux and MAC. I read some answer saying that` if (fork() == 0) system("sensible-browser http://wherever.com"); does the trick on Debian systems ...

using Ubuntu commands in php

Is it possible to use ubuntu terminal commands in php program.for example i need to create a folder and compress (.zip) it using php program. How to code this need? ...

java cpu-intensive app stalls / hangs when increasing nr of workers. Where is the bottleneck, and how to deduce/ moitor it on linux/ubuntu server

I'm running a nightly cpu-intensitive java-application on a Ec2-server (c1.xlarge) which has 8 cores, 7,5 GB RAM (running Linux / Ubuntu 9.10 Karmic 64 bit) The appplication is architected in such a way that a variable number of workers are constructed (each in their own thread) and fetch messages from a queue to process them. Throug...

When including header files, is the path case sensitive?

Given this directory tree: src/MyLibrary/MyHeader.h src/file.cpp file.cpp: #include "mylibrary/myheader.h" ... Compiling file.cpp works with VS, fails in gcc. What does the standard say? If the path is case sensitive, why is this wise? What's the best practice, keep all file/folder names lowercase and thus do the same when includi...

Linux bash: Multiple variable assignment

Does exist in linux bash something similar to the following code in PHP: list($var1, $var2, $var3) = function_that_returns_a_three_element_array() ; i.e. you assign in one sentence a corresponding value to 3 different variables. Let's say I have the bash function myBashFuntion that writes to stdout the string "qwert asdfg zxcvb". Is ...

What is the easiest x86 Embedded Linux?

I want to play around with some embedded linux. I want it to be able to run on an x86 processor (for start, it will be running on my regular PC). I have looked online, but the ones I have found seem hard to setup or lack proper documentation. So what are some good embedded x86 compatible linux distros that are easy to setup or have good ...

Linux command to do wild card matching

Is there any bash command to do something similar to: if [[ $string =~ $pattern ]] but that it works with simple wild cards (?,*) and not complex regular expressions ?? More info: I have a config file (a sort of .ini-like file) where each line is composed of a wild card pattern and some other data. For any given input string that ...

Emulating Linux binaries under Mac OS X

How do I run Linux binaries under Mac OS X? Googling around I found a couple of emulators but none for running Linux binaries on a Mac. There are quite a few posts about running Mac OS X on Linux and that kind of stuff - but that's the opposite of what I want to do. Update: Thanks for all the answers! I am fully aware of MacPorts and ...

How do i create a GNU Autotool Project in Eclipse CDT from existing C++ source code?

Hi, I have an existing C++ source code that is built using autotools and i wish to use in Eclipse CDT. I'm a beginner with Eclipse CDT. I've installed the Autotools plugin for eclipse but don't know how to create a project from existing code. May you please guide me in the right direction so that i can create an eclipse project that us...

Is there a point to trapping "segfault" ?

I know that, given enough context, one could hope to use constructively (i.e. recover) from a segfault condition. But, is the effort worth it? If yes, in what situation(s) ? ...

bash script to rename all files in a directory ?

i have bunch of files that needs to be renamed. file1.txt needs to be renamed to file1_file1.txt file2.avi needs to be renamed to file2_file2.avi as you can see i need the _ folowed by the original file name. there are lot of these files. ...

Is there a system variable that stores the location of a user's Dropbox?

At least in the linux version of Dropbox, the user can choose which folder becomes their Dropbox. Is there a simple way to get this programmatically? ...

Why does not the input of a string work?

#include <stdio.h> int main() { char temp[1024]; if(getchar() != 'y') { printf("no options\n"); return 1; } scanf(temp, "%s"); printf("%s", temp); } I get snippet as below. I just want twice input from user. but the first input works, however the second dir...

Is it possible to configure Linux capabilities per user?

There appears to be support for fine-grained capabilities in Linux kernel, which allows granting privileges to a process to do things like, for example, opening raw sockets or raising thread priority without granting the process root privileges. However what I'd like to know if there is a way to grant per-user capabilities. That is, all...

How can I convert the input of console as nothing like inputed a password

I mean i want the input to be invisible like inputing password when i log in Linux. How can I implement it both in C under linux and windows. thanx ...

Which install system to pick when deploying to Windows and Linux?

My company is thinking of dumping InstallShield and move to something else, mainly because of the poor experience it had with it, mostly on Linux. Our product is a C++ application (binaries, shared libraries) targeted at Windows and Linux (Red Hat). The installer itself isn't required to do anything special, just dump some binaries and...

Developing an operating system

I want to develop a simple operating system. One that asks user to login by entering username and password. Once logged in the user sees their desktop and can create some text files. I don't have any prior experience of OS development. I know C and C++ and Java. I don't know where to start. I want to use the Linux kernel, but I don't k...

char to keycode in python

Hello, I want to be able to translate a string to keycode to write it with Xlib (to simulate user action on linux). The keycode are not the ascii but the code you get when you do use xev on linuxKeyPress event, serial 33, synthetic NO, window 0x6400001, root 0x13c, subw 0x0, time 51212100, (259,9), root:(262,81), state 0x0, ke...

increment the priority of a thread in Linux

I am reading data from a HID device using hiddev , there is a dedicated thread to read off of it, but it seems that thread is dropping some packets. I can see the packets in the kernel buffers(usbmon) but some of them don't reach user space. The reads inside the reading thread mostly finish on time(~4ms). I think the process is not getti...