Reputation
291
Top tag
Next privilege 300 Rep.
Create tags
Badges
1 3 11
Newest
 Necromancer
Impact
~67k people reached

  • 0 posts edited
  • 0 helpful flags
  • 7 votes cast
Mar
8
comment Unix shell: easy way to get IP from hostname
Nice, and works for IPv6, too.
Mar
8
comment Unix shell: easy way to get IP from hostname
@Ether sed -e '/some people consider Perl a better form/s/better/worse/' SCNR
Jan
23
comment why is kswapd using high CPU on an idle system?
All I have is from the link which is in my post: 2.6.18-194.el5 (RHEL) is affected, 2.6.18-194.32.1.el5 and above is fixed. No idea for other kernel series, sorry.
Nov
5
comment reverse ssh tunnel listens on wrong interface
Also try GatewayPorts clientspecified to make ssh obey your orders. See serverfault.com/questions/379344/…
Jul
12
comment Switch on PAM debugging to Syslog
Please note that all lines like pam_* actually are PAM realated. The other lines are output by the tools anyway, regardless if they use PAM or not. This means: If PAM denies, for any reason, it is really hard to find the real cause, if it is in PAM. The non-PAM lines are not helpful (as the problem sits in PAM) and the PAM lines are often not helpful, too, as they are often too silent. With the presence of many PAM modules you really have a hard time guessing which module might be the culprit, let alone to find out how to enable debugging, as this is different for each single one.
Jul
12
comment Switch on PAM debugging to Syslog
/var/log/auth.log is syslog. The problem is not logging but debugging. If for example the PAM stack fails early, you will not see anything, because the modules which output to syslog are not invoked at all. Or something fails and something not, but both log exactly the same lines. It is correct that, I guess, 95% of all cases can be solved by looking into the usual logs, but 5% cannot, as there simply is no trace of what really happens behind the scenes.
Feb
22
comment Command to prepend string to each line?
awk -v T="[TEST %Y%m%d-%H%M%S] " '{ print strftime(T) $0 }' to output a timestamp
Feb
21
comment Command to prepend string to each line?
sed X cmd does read cmd and does not execute it. Either cmd | sed 's/^/[ERROR] /' or sed 's/^/[ERROR] /' <(cmd) or cmd > >(sed 's/^/[ERROR] /'). But beware the latter. Even that this allows you to access the return value of cmd the sed runs in background, so it is likely you see the output after cmd finished. Good for logging into a file, though. And note that awk probably is faster than sed.
Feb
21
comment Command to prepend string to each line?
T="[ERROR] " awk '{ print ENVIRON["T"] $0 }' or T="[ERROR]" awk '{ print ENVIRON["T"] " " $0 }'
Feb
21
comment Command to prepend string to each line?
awk -vT="[ERROR] " '{ print T $0 }' or awk -vT="[ERROR]" '{ print T " " $0 }'
Feb
20
comment Switch on PAM debugging to Syslog
Thanks. Good hint. I'll try if I ever have problems again. So hopefully never .. ;)
Jan
3
comment why is kswapd using high CPU on an idle system?
Please note that the kswap hanging at 100% was confirmed being a Linux bug. It was fixed in mid/end 2012 kernels.
May
26
comment LVM thin provisioning
But it is currently disabled in Wheezy (LVM 2.02.95-7) as thin_check binaries are missing.
May
24
comment How to find the gateway IP address in Linux
I would suggest something like route -n|awk '$4~/G/{print $2; exit(0)}' for the first gateway, but ip route get IP is better, because it lists the route which would be really taken to the given IP, which is difficult to find with route alone
May
24
comment How to find the gateway IP address in Linux
read x x i x< <(ip r g 1), result is in variable $i for further use
Mar
28
comment Unix shell: easy way to get IP from hostname
Because shell traditionally is seen as scripting, not programming ;)
Aug
30
comment Remote IP's with HAProxy
Better use option forwardfor header X-Real-IP and reqidel ^X-Real-IP:, this stops faking IPs in your logs. FYI: X-Real-IP is the default header for NginX' option set_real_ip_from.
Aug
9
comment nginx url rewriting: difference between break and last
pubbs.net link is broken as the domain was taken over. Sorry, was not able to find where it should point. ;(
Jul
4
comment How to tell which local branch is tracking which remote branch in Git?
+1 Your answer gave me exactly what I needed: git rev-parse --symbolic-full-name HEAD vs. git rev-parse --symbolic-full-name HEAD@{u}, thanks!
Nov
1
comment Unix shell: easy way to get IP from hostname
Thanks. And updated for IPv6.