Search Results

Search: Posts Made By: cjcox
Forum: Solaris 04-06-2016
3,770
Posted By cjcox
Not terribly obfuscated: trap "echo...
Not terribly obfuscated:


trap "echo goodbye;sleep 10" 0 1 3 15
1,865
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,957
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...
1,804
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,...
1,255
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.
5,103
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...
4,390
Posted By cjcox
Just source in your aliases after the su. ....
Just source in your aliases after the su.

. /path/to/your/aliases.ksh
918
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.
...
9,949
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...
9,949
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
1,192
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!!
31,652
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!'
...
13,808
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...
1,452
Posted By cjcox
if [ $i -eq 5 ] then echo "Oh...
if [ $i -eq 5 ]
then
echo "Oh Nooo....etc"
break
fi
2,046
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??
1,308
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.
5,139
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...
2,317
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...
2,317
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]*//'...
918
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...
6,197
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
3,086
Posted By cjcox
If data is in test.txt... (if not using awk is...
If data is in test.txt... (if not using awk is ok):


sort -u -k4,4 test.txt | wc -l
1,936
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 }}}'
1,936
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,082
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...
Showing results 1 to 25 of 105

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