In Linux (Ubuntu), I want to programmatically check if there is Internet connection (or if eth0 is connected). I’m doing this because I am writing a program that requires network connection on a system that is highly prone to lose connection. So I was thinking maybe a script that I can run periodically …
Tag: linux
How to add a cron job in linux [closed]
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 10 years ago. Improve this question I am using sphinx for searching. I get new data everyday which is added in the database. I have to…
Teamcity build agent in disconnected state
I am running teamcity on Linux server, and it was working completely fine. Once I reboot the server machine and it stopped working. I managed to start the teamcity server using runAll.sh command, but the build agent stays in “disconnected” state. The inactivity reason is being shown as ‘serv…
How to print the address of a function?
I let gcc compile the following example using -Wall -pedantic: I get: Line 5 made my change the code like in line 6. What am I missing to remove the warning when printing a function’s address? Answer This is essentially the only portable way to print a function pointer.
How to debug the network stack in linux
I am trying to inject a packet into the network using raw sockets, but somehow can’t seem to get a receiver to capture this packet. How do i check whether the packet is being dropped by the linux network stack? Could someone point out some tools for doing this? Answer I don’t know about accessing …
Grep inside all files created within date range
I am on the Ubuntu OS. I want to grep a word (say XYZ) inside all log files which are created within date range 28-may-2012 to 30-may-2012. How do I do that? Answer This is a little different from Banthar’s solution, but it will work with versions of find that don’t support -newermt and it shows h…
Trouble on state FIN_WAIT_1
recently i’ve got some port holding on FIN_WAIT_1 state till two days later. The target port is used by one server process ever and client connect to the server process through this port. The situation is we stopped the server process, and obviously some client is still connecting with the server at tha…
Best program for syncing between Windows 7 Client and Linux Server
I work and develop PHP/MySQL on a Windows 7 Client. With xampp its simple to use and test. But since in my actuall project, I need some linux only features, I want to test my code in a virtualbox (Ubuntu Server). Now I am looking for a good way to keep my sourcecode in sync on both – client and
NetBeans GUI builder: “loading…” message
Sample project from the NetBeans tutorials set contains only one Swing form (empty JFrame), compiles and runs fine, but I can’t change layout of the form and add elements in it with the NetBeans GUI buider since it shows only empty placeholder with single “loading…” message. Any clues …
check if argument is a valid date in bash shell
I am writing a bash shell script in Linux, this program will accept a date (mm-dd-yyyy) as a parameter. I am wondering if there is a simply way to check if the date is valid? is there an operator and I can just use test to check? Answer You can check with date -d “datestring” So date -d “12/…