In my bash script I need to change current dir to user's home directory.
if I want to change to user's foo home dir, from the command line I can do:
cd ~foo
Which works fine, however when I do the same from the script it tells me:
./bar.sh: line 4: cd: ~foo: No such file or directory
Seams like it would be such a trivial thing, b...
Hi folks,
I'm trying to develop a GUI application for an embedded platform, without any windowing whatsoever and I'm doing that with DirectFB, and it suits my needs very fine.
Since the embedded I develop for is not that powerful, I would really like to try to develop on my own Ubuntu desktop. The problem is Framebuffer is conflicting ...
Does anyone know of a utility (for Windows or Linux or MacOSX) that will append the selected contents to the clipboard? Rather than killing what's already there...(maybe using a different keyboard shortcut instead of Ctrl+C to do this?
And I don't mean multiple-clipboard items...
I mean concatenating multiple strings of text to the sam...
According to this website, you can change to command key sequence used by the Unix "screen" utility like this:
escape ^Bb # Instead of Control-a, make the
# escape/command character be
# Control-b
How would you make it Control-Tab, I wonder?
...
Is there any way to inject a command into a bash prompt in Linux? I am working on a command history app - like the Ctrl+R lookup but different. I am using python for this.
I will show a list of commands from history based on the user's search term - if the user presses enter, the app will execute the command and print the results. So fa...
Hello all,
Objective: Make a progress bar where users can check how much of a file has been downloaded by my server.
Scenario:I have a PHP script that executes a python script via popen. I have done this like so:
$handle = popen('python last', 'r');
$read = fread($handle, 4096);
pclose($handle);
This python script outputs to the s...
For an everyday-user with new hardware Linux seems for me the natural choice if somebody is looking for an alternative to Windows. But when does it make sense to give the BSD variants a try?
...
Hi
I'm looking for a GUI Linux IDE.
Specs:
simple and fool proof. normal look & feel
full as-you-type indentation in most languages
a compile+run button, a debugger, auto-refactoring for C++
basic unintrusive support for common buildsystems - straight make, cmake, qmake, autotools
smooth workflow. proper keyboard support, no jarring ...
I have a code that "sounds" like this:
thread 1
now = rdtsc();
for_each_member_in_a_list {
if ( member_in_list.deadline() <= now ) {
do_something;
}
}
thread 2
now = rdtsc();
for_each_member_in_a_list {
member_in_list.updatedealine( foo(now, ...) );
}
now while this was working good in the past now with a SMP system...
I wonder if I could write a program in the C-programming language that is executable, albeit not using a single library call, e.g. not even exit()?
If so, it obviously wouldn't depend on libraries (libc, ld-linux) at all.
...
I'm implementing a thread with a task queue. As soon as as the first task is added to the queue the thread starts running it.
Should I use pthread condition variable to wake up the thread or there is more appropriate mechanism?
If I call pthread_cond_signal() when the other thread is not blocked by pthread_cond_wait() but rather doing...
I'd like to know if it is possible for non-root user on linux (i'm using openSUSE) to run apache without using sudo command. Take into account that the user is in the same group as apache (wwwrun).
Thanks in advance.
...
In Windows when you create a window, you must define a (c++)
LRESULT CALLBACK message_proc(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam);
to handle all the messages sent from the OS to the window, like keypresses and such.
Im looking to do some reading on how the same system works in Linux. Maybe it is because I fall a bit...
I need to implement a daemon that needs to extract data from a database, load the data to memory, and according to this data
perform actions like sending emails or write/update files. These actions need to be performed every 30 minutes.
I really don't know what to decide. Compile a c++ program that will do the task or use scripts and mi...
Currently the way /usr/sbin/alsa in Debian knows the processes using the sound card looks like:
echo $( \
lsof +D /dev -F rt \
| awk '/^p/ {pid=$1} /^t/ {type=$1} /^r0x(74|e)..$/ && type == "tCHR" {print pid}' \
| cut -c 2- \
| uniq \
)
Which is rather ugly and depends on lsof. I am looking for a POSIX solution without lsof, perha...
I'm familiar with and use shutdown in Linux, and typically just do
> shutdown -h now
But is there a way to stop shutdown from happening, say if I aim to shutdown 10 minutes from now and then in 5 minutes time I discover I really don't want to shut down?
...
Simple question, but for some reason I couldn't find the exact answer on Google:
I have a fresh Ubuntu install on Slicehost, and would like to make a public directory in my home dir for a simple website containing a bunch of static HTML files. How do I do this? Is it just a matter of typing mkdir public_html and setting the permissions,...
I'm looking for the best approach to dealing with duplicate code in a legacy PHP project with about 150k lines of code.
Is this something best approached manually or are there standalone duplicate code detectors that will ease the pain?
...
Hi,
I need to create a special linux user account that has a very limited set of permissions on the system. Essentially to have read-only permissions for his home dir (and sub dirs) and nothing else - i.e. this user has no write or execute permissions and should not be able to read/access other user dirs or indeed anything outside of hi...
I've written a C++ program (command line, portable code) and I'm trying to release a Linux version at the same time as the Windows version. I've written a makefile as follows:
ayane: *.cpp *.h
g++ -Wno-write-strings -oayane *.cpp
Straightforward enough so far; but I'm given to understand it's customary to have a second step, make...