Search Results

Search: Posts Made By: neked
7,971
Posted By neked
vmstat's cpu stats on first line of output are always the same
Hello,

I'm seeing this problem with vmstat, where the first line of output always has the same CPU statistics. For example:

neked@nekedmachine:~$ date && vmstat
Fri Jul 24 06:57:08 EDT 2009...
2,149
Posted By neked
Finding out if you are in an ssh session
Hey,

I'm trying to build customized behavior in a bash script for when it is run within an ssh session. This is how I'm finding out if the current session is ssh:


USER=`whoami` ...
1,785
Posted By neked
Nice, that worked pretty well: ...
Nice, that worked pretty well:

neked@neked-ubuntu-wks:~/misc$ less --no-init -RF 4_lines_file
first line
second line
third line
fourth line

From the less man page:

-X or --no-init...
1,785
Posted By neked
less -RF problem
Hello,

I see some annoying behavior for GNU "less" on my machine:

If I type less -F 4_lines_file in the shell the expected behavior would be similar to "cat" behavior i.e. if the file has less...
7,536
Posted By neked
Are you talking about using the mouse from inside...
Are you talking about using the mouse from inside the Graphical Desktop Environment (i.e. GNOME/KDE?) or you talking about using the mouse from within the console with gpm?
18,172
Posted By neked
Naming conventions for shared libraries in Linux
Hello,

I'm wondering what is the naming conventions for *.so shared libraries in linux. For example, a library in /lib, say libcrypt-2.7.so has a symbolic link called libcrypt.so.1 pointing to it,...
11,329
Posted By neked
Ironically, this post sounds more interesting...
Ironically, this post sounds more interesting after the censorship. :D
6,934
Posted By neked
The problem is that Windows linefeeds look like:...
The problem is that Windows linefeeds look like: \r\n while unix ones are like \n. Try substituting every \n with \r\n in your code or you can use gVim on windows to view unix files properly.
11,329
Posted By neked
I've just substituted all occurrences of...
I've just substituted all occurrences of parameter substitutions with equivalent sed and basename commands in the script I refer to above, the execution time went up from an average of 0.030 seconds...
11,329
Posted By neked
My personal perspective: 1) I am not very...
My personal perspective:

1) I am not very good at memorizing stuff, nor do I think the human brain is optimized for that task. I'm much better at making inferences and deductions instead.
2) I...
4,207
Posted By neked
Interesting, I stand corrected. I revise my...
Interesting, I stand corrected. I revise my earlier statement to say: those POSIX parameter substitution tricks are nice in the absence of any other tool (read sed, awk, basename) or the presence of...
4,207
Posted By neked
I would not use that trick in good conscience,...
I would not use that trick in good conscience, those bash parameter substitution tricks are nice in the absence of any other tool (read sed, awk, basename), but they are cryptic, hard to read and to...
24,160
Posted By neked
Unfortunately none of the approaches above work...
Unfortunately none of the approaches above work unless a terminal or a pipe is present, so if you have the aformentioned test.sh on a remote machine, then:


bash$ echo "test" | ssh...
24,160
Posted By neked
This inspired me to do a much simpler version of...
This inspired me to do a much simpler version of the code above, without the use of stty:


#!/bin/bash
if [ ! -t 0 ]; then
read line
echo $line
fi
24,160
Posted By neked
Pretty damn cool cfajohnson. Here is my...
Pretty damn cool cfajohnson.

Here is my implementation based on your stty idea and some modifications:


#!/bin/bash

if [ -t 0 ]; then
stty -echo -icanon time 0 min 0
fi;

read line...
Forum: IP Networking 10-10-2008
30,156
Posted By neked
I don't want to set all requests to 10.0.0.1...
I don't want to set all requests to 10.0.0.1 because that means all my DNS queries will go to my workplace first, and that makes me kind of uncomfortable, since my workplace can and do monitor my...
24,160
Posted By neked
Is this the appropriate forum for this topic, or...
Is this the appropriate forum for this topic, or should I move it elsewhere?
Forum: IP Networking 10-10-2008
30,156
Posted By neked
Hmmm, not sure I understand your question, by...
Hmmm, not sure I understand your question, by local nameserver, do you mean the router's nameserver (192.168.0.1) or do you mean the BIND9 instance I would be setting up on my machine. If it is the...
24,160
Posted By neked
Nonblocking I/O in bash scripts
Hello,

Is there a way to perform nonblocking I/O reads from standard input in a bash script?

For example, in C, you can say:


int flags = fcntl(STDIN_FILENO, F_GETFL);
fcntl(STDIN_FILENO,...
3,903
Posted By neked
Thanks Perderabo and gnsxhj... I'm still,...
Thanks Perderabo and gnsxhj... I'm still, however, interested in a pure (or purer?) regex solution.
3,903
Posted By neked
Sweet thinking!
Sweet thinking!
3,903
Posted By neked
sed -e :a -e's/\([^{]\+{[^.]\+\)\./\1_/;ta' <...
sed -e :a -e's/\([^{]\+{[^.]\+\)\./\1_/;ta' < data


This simplification worked for me.... interesting, I did not know about the "t" operator.
3,903
Posted By neked
regex challenge
Here's a regex substitution operation that has stumped me with sed:

How do you convert lines like this:


first.key ?{x.y.z}
second.key ?{xa.ys.zz.s}
third.key ?{xa.k}


to:


first.key...
Forum: IP Networking 09-30-2008
8,890
Posted By neked
I'd say try following this HOWTO: Linux...
I'd say try following this HOWTO:

Linux gateway/router - (another) HOWTO (http://www.stanford.edu/~fenn/linux/)

then connect your laptop directly to re1 to test for internet connection. Once...
Forum: IP Networking 09-30-2008
30,156
Posted By neked
Conditional Forwarding using BIND9
Hello,

I'm a noob when it comes to DNS and BIND9, so forgive me if my description seems pedantic:

I connect to my workplace's network using VPN, which sets me up with the workplace DNS servers....
Showing results 1 to 25 of 56

 
All times are GMT -4. The time now is 04:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy