Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: cjcox
582
Posted By cjcox
There are many ways. Perhaps the best way, if...
There are many ways. Perhaps the best way, if not correct way is to use PAM. Most distro provided services are PAM enabled, and you can certainly create your own PAM enabled services as well.
...
1,614
Posted By cjcox
snmp is your friend. A lot of those "tools" are...
snmp is your friend. A lot of those "tools" are not much more than "pretty" snmp based tools. Cacti might be an ok option just because the community often has add-ons for many enterprise things...
Forum: Solaris 04-06-2016
1,773
Posted By cjcox
Not terribly obfuscated: trap "echo...
Not terribly obfuscated:


trap "echo goodbye;sleep 10" 0 1 3 15
1,190
Posted By cjcox
sed solution is fastest, doubt you'll be able to...
sed solution is fastest, doubt you'll be able to beat it by much (virutally immeasurable).

Maybe if we understood what you're wanting to do with the middle data?
1,320
Posted By cjcox
#!/bin/bash maxnum=6 # Initial load ...
#!/bin/bash

maxnum=6

# Initial load
c=1
while [ $c -le $maxnum ]; do
read line || exit
echo "$line" | sh &
p[$c]=$!
echo ${p[$c]}
((c++))
done

# Loop through all,...
952
Posted By cjcox
As long as the data matches, folder names, file...
As long as the data matches, folder names, file names across two dirs and you just want the attributes, you might look at ---attributes-only option of GNU cp.
3,294
Posted By cjcox
Best one is the one I wrote for IBM. But they'll...
Best one is the one I wrote for IBM. But they'll never let you have it.

ZenOSS is a popular choice. If you use ServiceNow, they are touting their new discovery product. Dell's KACE might be...
2,624
Posted By cjcox
Just source in your aliases after the su. ....
Just source in your aliases after the su.

. /path/to/your/aliases.ksh
779
Posted By cjcox
Perhaps I'm not understanding the OP, but I think...
Perhaps I'm not understanding the OP, but I think the AgentDX the OP wants substituted is inside of the final.enc file, which is why you'd either need to force a round of eval on the content or use...
779
Posted By cjcox
You're assumption is that final.enc can be run...
You're assumption is that final.enc can be run through a layer of evaluation.... so I'll stick with that assumption.... (and it's a big assumption!)


finalenc=`cat final.enc`...
6,021
Posted By cjcox
Uh... no... ln /bin/rm...
Uh... no...


ln /bin/rm /bin/rm-kazamaphobia
# Now safer
rm -f /bin/rm
# At this point... things are going to be broken all over the place...
# but at least you can get to the original rm...
6,021
Posted By cjcox
In a sudo context, usually you don't want these...
In a sudo context, usually you don't want these kind of "everything" entries. So the best solution is to just have rules for the things you do want the user to be able to do through sudo.
...
Forum: What is on Your Mind? 12-01-2015
959
Posted By cjcox
Yes... you are nuts. But aren't we all? Enjoy...
Yes... you are nuts. But aren't we all? Enjoy your new toy!!
24,053
Posted By cjcox
consider: import os, sys, time hostname...
consider:


import os, sys, time
hostname = "myclient"
response = os.system("ping -c 1 " + hostname + " >/dev/null 2>&1")

if response == 0:
print hostname, 'Reboot successful!'
...
5,311
Posted By cjcox
1. Dual Boot Really no restrictions, however...
1. Dual Boot

Really no restrictions, however Microsoft has been known to have service packs that require that Microsoft own the boot record in order to be applied (a patch in Windows 7 for...
898
Posted By cjcox
if [ $i -eq 5 ] then echo "Oh...
if [ $i -eq 5 ]
then
echo "Oh Nooo....etc"
break
fi
1,274
Posted By cjcox
We probably need a bit more on what a "DL" is for...
We probably need a bit more on what a "DL" is for you. Is this some kind of alias setup outside of your control? Maybe if you could be a bit more specific??
859
Posted By cjcox
You said: exec sh -c "$filename" | sed ......
You said:

exec sh -c "$filename" | sed ... etc...


I think you want to do your sed on the file, so either "cat" the file or use file as an argument to your sed.
1,484
Posted By cjcox
did you reallly replace the space-^I in those...
did you reallly replace the space-^I in those charset sequences with space-<tab key>?

It should work pretty much anywhere. Sp those char set sequences are either:

[<space><tab>]
or...
3,048
Posted By cjcox
Doesn't really make much sense to say which is...
Doesn't really make much sense to say which is closer, however you could at least say that the default gateway of 10.0.0.1 is out through eth1 on the 10.0.0.0/24 network.

Your host knows where...
1,484
Posted By cjcox
Just for fun, place ^I with literal tab.... ...
Just for fun, place ^I with literal tab....


(sed -e '/^[ ^I]*$/d' -e '1s/^\([^ ^I].*\)/ cat >"\1" <<EOF/' -e '2,$s/^\([^ ^I].*\)/cat >"\1" <<EOF/' -e '/^cat/i\EOF' -e 's/^[ ^I]*//'...
1,096
Posted By cjcox
First of all, last data is easily circumvented. ...
First of all, last data is easily circumvented. So, while last is "ok", a person can "login" into your host and not be recorded in the wtmp/utmp file.

What is last not showing you? It will show...
1,096
Posted By cjcox
awk version last -ai | awk '{...
awk version


last -ai | awk '{ user=$1;ip=$NF;if (t[ user ip ] == "") { c[ user ]++;t[ user ip ]=1 }} END { for (name in c) { if (c[ name ] > 10) { print name }}}'
621
Posted By cjcox
1. sorted your file based on 4th column and saved...
1. sorted your file based on 4th column and saved it: sort -k4,4 test.bed >test.bed.sorted

2. ran my solution minus the wc -l and saved that: sort -u -k4,4 test.bed >test.bed.uniq

3. here are...
2,965
Posted By cjcox
Do you have to use sed? Easily done with ed. ...
Do you have to use sed? Easily done with ed. This is an edit inline example (editing the file itself).


ed file.txt <<EOF
/^######SEPARATOR#####
-2
a
# v0006 - New text
.
wq
EOF
Showing results 1 to 25 of 105

 

Featured Tech Videos

All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy