linux

C++: How to get a password with a CLI program?

I am writing a Linux CLI program. I need to get a password from the user and, obviously, I don't want the password to be echoed to the console. There are several solutions available here, but they are all for plain C. http://stackoverflow.com/questions/1786532/c-command-line-password-input http://stackoverflow.com/questions/1754004/ho...

How do I get the number of requests per second from Apache log between 2 dates/time?

What command can I use to analyse Apache's log file that tells me between 11am of day x and 13pm of day x the average request per second was..? The os is linux (red hat) Thanks ...

find in between particular dates

find / -newer -10 mtime +30 i want to check only those files which are modified yesterday please correct the abouve command ...

help.....serial port programming

I want to communicate with my serial port in python. I installed pyserial, and uspp for linux. Still, when I run the following code: import serial ser = serial.Serial('/dev/pts/1', 19200, timeout=1) print ser.portstr #check which port was really used ser.write("hello") #write a string ser.close() # it gives the following error: ...

How do you "debug" a regular expression with sed?

I'm trying to use a regexp using sed. I've tested my regex with kiki, a gnome application to test regexpd, and it works in kiki. date: 2010-10-29 14:46:33 -0200; author: 00000000000; state: Exp; lines: +5 -2; commitid: bvEcb00aPyqal6Uu; I want to replace author: 00000000000; with nothing. So, I created the regexp, that works when ...

Why does a partially hidden JFrame not repaint properly on Linux when switching between virtual desktops

Hi, we have problems with Java 6 applications that do not properly refresh when switching virtual desktops. The problem so far has been reproduced on Fedora 11 and 13 with GNOME and Suse SLES 10 with KDE. I use the following test case to reproduce the problem: import java.awt.Color; import java.awt.EventQueue; import java.awt.event.Acti...

How to call Wine dll from python on Linux?

I'm writing a python script in Linux, and need to call some Windows functions available in Wine. Specifically, AllocateAndInitializeSid and LookupAccountSidW, to determine who is logged in to a remote Windows computer. These functions are part of advapi32.dll in Wine (edit: using the answers, I was able to call the function, but Lookup...

connecting to wifi network using username and pass (GNU/Linux)

Hi, I have a problem to connect to wifi network, because I dont know how to set username and password, needed by network. I usually use "iwconfig" command to connect. But I didnt find nothing in man pages how to say which pass and username will be used in authentification process. Thanks for every advice. Bey ...

How to track child process using strace?

I used strace to attach to a process briefly. The process created 90 threads. When I found the offending thread, I had to tediously search for the parent thread, then the grandparent thread, and so on all the way to the root process. Is there a trick or tool to quickly figure out which thread created another? Or better yet, print the tre...

Linux Bluetooth not finding Android Service with UUID

I am trying to write a program on an embedded system running GUMSTIX(Linux) to connect and talk to an Android 2.x device over bluetooth. The GUMSTIX is the client and the Android is the server. I am trying to find the channel number that my Android service uses so that the GUMSTIX can connect to it but for some reason my routine isn't ...

Find cron jobs that run between given times

Is it possible to find all entries in a crontab that run between time X and time Y without having to parse the cron time entries myself? I'm mainly concerned with time hour and minute, not so much the other 3 time fields. ...

c# create or modify file/directory permission: add group read permission using asp.net with mono and apache2

How can I change/set permissions of a file or directory using asp.net under mono and apache2? I have an aspx page that needs to check if a directory exists, if not, it must be created, but with group read permissions set. Tried with DirectorySecurity, but it throws PlatformNotSupportedException. Apache is using www-data user and all ...

Using netcat (nc) as an HTTP proxy server and monitor

Is it possible to use the Unix netcat (nc) program to create a TCP proxy server and monitor? I would like all TCP traffic to be passed across the pipe, as well as sent to stdout for monitoring. Note this will be used for monitoring HTTP traffic between a hardware device and an HTTP server. ...

./configure && make && make install

I am logged in as a regular user. Should I use: ./configure && make && make install or sudo ./configure && sudo make && sudo make install or ./configure && make && sudo make install when installing packages. And could someone explain the differences. I want all users to be able to use it. ...

Why does MAP_GROWSDOWN cause SIGBUS errors after upgrading to Centos 5.5?

I was upgrading the OS on one of our build from Centos 5.3 32bit to Centos 5.5 32bit. After doing the package update I rebooted, checked out a clean copy of the source, built and ran the unit tests. All unit tests which rely on our MemMap base class began to fail. The crash occurs when we attempt to set the value of the guard page aft...

I have no "AllowOverride" directive in my apache2.conf

I have viewed my httpd.conf and apache2.conf and I have no AllowOverride directive in either of the files. The .htaccess works fine. I have a bunch of rewrites in it, so I know it works. Is apache2 by default set to "AllowOverride All"? Anybody know if I should add this? Or if it would hurt to add it? The reason for all this is that ...

How to do like "netstat -p", but faster?

Both "netstat -p" and "lsof -n -i -P" seems to readlinking all processes fd's, like stat /proc/*/fd/*. How to do it more efficiently? My program wants to know what process is connecting to it. Traversing all processes again and again seems too ineffective. Ways suggesting iptables things or kernel patches are welcome too. ...

Question about umask in Linux

So I know umask can deny privileged using this format umask ugo. I understand that the read = 4, write = 2, and exec = 1. However, when I type umask, it returns 4 digits which is 0022 or 0073. I have no understanding of how does this work now because there is an extra digit. What is that extra digit and what does 0022 mean? ...

Confused about this regular expression

Okay, so ^[A-Z] means beginning with a capital letter. So what does ^[A-Z]* mean? Does it not mean zero or more occurrences of a capital letter? Because it is really confusing me since it is including the empty line in the output which is not a capital letter. Also, could you explain ^[A-Z]*$? mugbear:~# clear mugbear:~# cat emptyspace...

How can you check if a window is minimized via the terminal in linux

How can you check if a window is minimized via the terminal in linux? ...