Inconsistent results from hostname Unix command via ARD
I sometimes get the DNS name and sometimes get the local sharing name.
Some one pointed out to me
% scutil --set HostName DNS-name
as root will do the job.
So the next question is can one get the Mac to cough up its DNS name or
IP address without major acrobatics.
For example
% ifconfig en0 inet
gives the IP address but you have to parse it out and
% host IP-address
will give the DNS name but again you have to parse it out.
We have a bunch of machines that are all named via the Sharing panel in System Preferences. Our network is giving them a different DNS name. We'd like to be able to access the Sharing name via the command-line (hostname gives DNS name). I assume this is possible because Remote Desktop seems to get it somehow.
Similar Messages
-
Cant send UNIX commands via ARD
I have ARD, and the option to send UNIX commands is greyed out. Help?
On the client, apple menu, system preferences, sharing, Remote Management.
If allow access is set to all users, then click the options button.
else, select the user your using to connect to the client, and then click the option button.
Make sure every thing is checked.
click ok
try again on ARD.
Other things to try:
quit and re-open ARD.
delete, then and re-add the client computer from ARD.
unchecking, and then re- checking remote management on the client. (to force the service to restart) -
Inconsistent results from CallableStatement
We are getting inconsistent results from a call to an Oracle database. We have a CallableStatement that returns 4 INTEGERs.
It runs perfectly if I run the Oracle procedure directly from the sql command line and then call it from the java code.
However if I recompile the Oracle stored procedures and execute the Callable Statement (without first running it from sql) then I am getting incorrect results...1,2,1,1 is being returned instead of 1,2,0,3. Are these results being cached somewhere???
We are using Oracle 8.1.7, JDK 1.3.1, and Oracle thin driver 8.1.7.
The code is as follows:
<pre>
private CallableStatement autoLBNumbersNeeded;
private void prepareStatements(){
autoLBNumbersNeeded=dbConnection.prepareCall("{CALL
pkg_scheduler.pr_auto_lb_nos(?,?,?,?)}");
autoLBNumbersNeeded.clearParameters();
autoLBNumbersNeeded.registerOutParameter(1, java.sql.Types.INTEGER);
autoLBNumbersNeeded.registerOutParameter(2, java.sql.Types.INTEGER);
autoLBNumbersNeeded.registerOutParameter(3, java.sql.Types.INTEGER);
autoLBNumbersNeeded.registerOutParameter(4, java.sql.Types.INTEGER);
public UserNumber[] doAutoLoadBalancing () throws SQLException {
autoLBNumbersNeeded.clearParameters();
autoLBNumbersNeeded.execute();
mwFF = autoLBNumbersNeeded.getLong(1);
mwHF = autoLBNumbersNeeded.getLong(2);
wmFF = autoLBNumbersNeeded.getLong(3);
wmHF = autoLBNumbersNeeded.getLong(4);
autoLBNumbersNeeded.clearParameters();
</pre>
The Oracle procedure is
<pre>
PROCEDURE proc1( p_parm_1 OUT NUMBER, p_parm_2 OUT NUMBER, p_parm_3
OUT NUMBER, p_parm_4 OUT NUMBER)
AS
BEGIN
-- Get Counts
SELECT COUNT(*)
INTO p_parm_1
FROM blah ......
SELECT COUNT(*)
INTO p_parm_2
FROM blah ......
SELECT COUNT(*)
INTO p_parm_3
FROM blah ......
SELECT COUNT(*)
INTO p_parm_4
FROM blah ......
EXCEPTION
blah .......
END proc1;
</pre>
Can anyone help?
Many thanks
FionnualaHi
Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
public UserNumber[] doAutoLoadBalancing () throws SQLException {
autoLBNumbersNeeded.clearParameters();
autoLBNumbersNeeded.execute();
mwFF = autoLBNumbersNeeded.getLong(1);
mwHF = autoLBNumbersNeeded.getLong(2);
wmFF = autoLBNumbersNeeded.getLong(3);
wmHF = autoLBNumbersNeeded.getLong(4);
autoLBNumbersNeeded.clearParameters();
if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
</pre> -
Send a Unix command through ARD that will change a OS X admin user to a standard user.
I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
sudo dscl . -delete /Groups/admin GroupMembership USERNAME
which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
dscl . -delete /Groups/admin GroupMembership ARDusername
or
dscl . -append /Groups/admin GroupMembership ARDusername
What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
By the way the '/' doesn't work in the syntax in ARD.
Thanks -
Inconsistent Results from dbms_output.get_lines
Hi,
I am getting inconsistent results from using dbms_output.get_lines.
I'm using get_lines in a procedure A that executes a function B to test if the function returns 0 or > 0 to indicate validity of my data. In that function, I use dbms_output.put_lines to communicate data points that I want to use. My procedure A does a get_lines after executing function B then either logs the lines into a table or sends an email.
Right now, get_lines is behaving sporadically for me. Sometimes I the chararr returns some lines while other times it doesn't. The strange thing is numlines does return a value, and it's the value that I expected.
Can someone please help?
Thanks.Use parameters or even global package variables to transport data from one procedure to the other. dbms_output is not meant for this, it will not work.
-
Unable to run reports from the unix command line
hi
all of a sudden i am unable to run reports ( on App server 10g) either from the unix scripts or from the unix command line. But i can run them from the forms.
Any one have any idead about this.
Thank youthanks all for replying
i have set the env variables for the session and it worked. Looks like i have to set the oracle_home and ld_library_path every time ( opening a new putty session) i call sqlldr.
But in a whole i am trying to run sql loader from the forms. Right now we have Oracle app server 10g which forms 10g version. As oracle app server 10g didnt come with sqlldr, we are copied the sqlldr of database on to app server with different home. after this we can run sqlldr ( on app server ) from unix scripts but not from Forms. Then we opened a qurey with oracle about app server 10g not commig with sqlldr and its remedy . But they said that they dont have specific remedy for that and suggested the same what we did.
So we came up with java package which does the same funtion as host command and trying to run sqlldr which is on the database( ie replacing the host command in the forms with the database funtion). By using that funtion i am able to run the sqlldr from sql plus but not from forms. I couldnt easily debug it as i wont through any error messages.
Any one have any idea of this ...
Thank you -
How can I import eex files into Applications EUL from the unix command line
How can I import *.eex and *.dis files into an Applications EUL from the unix command line?
ThanksHi
The simple answer is you either have to use the client tool DIS51ADM to import files using the command line (Discoverer Admin is a windows only client tool), or the Java command line which needs a browser.
In theory if you have a browser running on your Unix box you may be able to use the Java command line to make this work.
Best wishes
Michael -
Unix command in ARD to remove DNS Servers from Network prefs?
I need to know how to send a unix command to remove DNS Servers in Network preferences. I need the DNS Servers field to be blank. Can this be done?
Our network administrator is getting ready to change the IP address of our DNS server. This means I have over 30 Macs that will be needing changes to their DNS settings. Since each machine is setup with limited access to the system prefs, that means I have to go to each machine and log in as the admin user to make this change. In the interest of saving time, is this something I can do with Remote Desktop and how? Would I use the same commands in this post and replace dns1 with our DNS' new IP address? Will this distrupt the users access to the network when I do so?
Thanks for any help.
Beth -
Using Sent Unix Command in ARD 3 with proxy authentication
I'd like to use Unix commands to update Apple software through ARD thus allowing me to lock the computer screen before the process using the ARD command to do so, thus keeping the users from interfering with the process .
Our network utilizes password protected firewall proxy that hangs ARD when using the softwareupdate command through ARD's "Send Unix Command..." at the point in which it would ask for authentication if using the same command in the terminal.
Is there a Unix/terminal script or a series of script commands that could be modified to wait and enter the appropriate authentication at the previous mentioned prompt?
I've researched this topic on this forum and discover a few post that states it is not possible but they are fairly old posts so I am hoping ARD 3 has some scripts or commands that can pass thru a username and passwordWelcome,
I use the "System Events" handler, e.g.:
tell application "System Events" to delay 5.5
tell application "System Events" to keystroke "K"
tell application "System Events" to delay 0.5
tell application "System Events" to keystroke return
Regards,
Shawn -
Output from Send Unix command stalled
after send a unix command to a client the output from
the command stalls. It seems that the output is buffered
and that the final buffers are not flushed. This behaviour
is new since 10.5.5 --
Anyone know of a way to control the buffer size, when
they are flushed or to how to run unbuffered ??
ARD 3.2.2 all around and 10.5.6 all around ARD on a Quad Xenon
and clients iMac Alumwell this seems to have been a red herring --
I had not set the "linebuffering" option on the
command
the command was lapply from the radmind suite
needed to set "-i"
thanks -
Inconsistent results from AlphaComposite and AffineTransform
I'm developing a game using Java, and I've run into a fairly major issue. On my primary development machine, I can use combinations of AlphaComposite.SRC_IN and AffineTransforms with rotation just fine (I'm using the composite to create a lighting overlay for the game by drawing light beams onto the alpha channel of an all-black image buffer). On my other computer, while the image itself rotates and draws on the alpha channel fine, the computer also completely clears a bounding rectangle around the rotated image.
The first computer (the one for which this works) has a GeForce 8800GTS video card, while the second has an older Radeon 9700. The first computer also has the most recent version of the JDK (6). Could either of these factors make the difference?
edit: Upgrading to JDK 6 fixed it. Will need to include a notice about upgrading to JDK 6 with the game, probably.
Message was edited by:
HyoukoHi
Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
public UserNumber[] doAutoLoadBalancing () throws SQLException {
autoLBNumbersNeeded.clearParameters();
autoLBNumbersNeeded.execute();
mwFF = autoLBNumbersNeeded.getLong(1);
mwHF = autoLBNumbersNeeded.getLong(2);
wmFF = autoLBNumbersNeeded.getLong(3);
wmHF = autoLBNumbersNeeded.getLong(4);
autoLBNumbersNeeded.clearParameters();
if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
</pre> -
I am trying to cue computers through keystroke commands using ARD
I want to know a unix shell or script command to hit keystrokes on my ARD machines.
EXAMPLE... I want machine X to press the letter K.
I am also wondering if you can send multiple commands doing this , multiple keystrokes with built in delays
Thank youWelcome,
I use the "System Events" handler, e.g.:
tell application "System Events" to delay 5.5
tell application "System Events" to keystroke "K"
tell application "System Events" to delay 0.5
tell application "System Events" to keystroke return
Regards,
Shawn -
Can this script be converted to a UNIX command for ARD?
First I'd like to thank "Neil" again for providing the script below:
set the_versions to (do shell script "mdls -name kMDItemVersion /Applications/Microsoft\\ Office\\ 2011/Microsoft\\ Excel.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Reader.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Safari.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Google\\ Chrome.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Acrobat\\ X\\ Pro/Adobe\\ Acrobat\\ Pro.app")
set the_versions to the_versions & return & (do shell script "SW_vers")
Output for this script yields exactly what I requested in the thread. Ex:
"kMDItemVersion = \"14.4.1\"
kMDItemVersion = \"11.0.07\"
kMDItemVersion = \"7.0.4\"
kMDItemVersion = \"35.0.1916.114\"
kMDItemVersion = \"10.1.10\"
ProductName: Mac OS X
ProductVersion: 10.9.3
BuildVersion: 13D65"
I'd like to be able to run this command (or a variation) in Apple Remote Desktop (ARD) remotely, and as a UNIX command in order to generate a similar ARD report if possible. Even better, I'd like the report to include the Application name and I'd like it to not to halt if an Application isn't present. My guess is that functionality like this for ARD would help a LOT of ARD Administrators because it would seem that the only way to do anything similar is to derive the metadata piecemeal (machine by machine) or end up having to wade through a ton of unwanted content using a full System Report... Thanks.Forum software NOW prevents posting complete shell scripts. You'll have to piece together the code.
First build an array of the applications that you are looking for in this form. Note; I truncated the applications.
apps=( "/Applications/Microsoft Office 2011/Microsoft Excel.app" "/Applications/Adobe Reader.app" "/Applications/Safari.app" )
Next loop thru the array
for i in "${apps[@]}"; do
printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
done
If you want to create a report then change the above loop to the following
for i in "${apps[@]}"; do
printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
done > app_report.txt
sw_vers >> app_report.txt
Message was edited by: Mark Jalbert -
Unix security and privacy setting unix command via apple remote desktop
Could someone guide me on the unix command to set System Preferemces Security & Privacy to xx minutes [see screenshot please] via Apple Remote Desktop.
https://dl.dropbox.com/u/5485939/osx_screenshots/sys%20pref%20security%20privacy .png
Thank you,Pereference tend to be stored for the computer as a whole
/Library/Preferences/
or specifcally for the user
/Users/USERNAME/Library/Preferences/
well when I set required password for XX minutes... I see that
/Users/USERNAME/Library/Preferences/com.apple.screensaver.plist modfication date & time changes to the current time & date... hMMM maybe the setting we want is stored here? Can we test this?
If I check require password and then do the terminal command:
defaults read ~/Library/Preferences/com.apple.screensaver
I see
askForPassword = 1;
askForPasswordDelay = 0;
tokenRemovalAction = 0;
turn it off
run the terminal command;
defaults read ~/Library/Preferences/com.apple.screensaver
I see:
askForPassword = 0;
askForPasswordDelay = 0;
tokenRemovalAction = 0;
so I can turn it on with
defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
and I can turn it off with
defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool FALSE
So if a user is logged into a computer. I could send unix command as current console user.
defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
BUT what if the user is logged out? or there are more then one user on the computer?
then I could run unix command as user root and send
defaults write /Users/USERNAME/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
(replace USERNAME with the user's short name.)
but what if I don't know the user name? or names
send unix command as root
ls -al /Users/
get back a list of folders
bob
surely
shares
and then do
send unix command as root
defaults write /Users/bob/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
defaults write /Users/surely/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
you could also do some thing like
defaults write ~/Library/Preferences/com.apple.screensaver askForPasswordDelay -integer 5
if you want to change the period of time to lock to 5 seconds
or
defaults write ~/Library/Preferences/com.apple.screensaver askForPasswordDelay -integer 900
(900 seconds / 60 seconds = 15 minutes) -
Help with 2 UNIX Commands using ARD
Hello All,
Can someone help me with 2 UNIX commands I would like to set up? The first one... how to delete a range of users within /Users by date (i.e. the oldest user who last logged in "Mar 22 09:40 00796216" to "Mar 25 17:01 01036773"). Currently, I'm using "sudo rm -r " followed by each home directory name separated by a space. It works but to save time, it would be nice to do this all within 1 UNIX command.
Second, is there a UNIX command where I can delete a range of users by ID numbers? (We have users assigned with an 8 digit ID number. Is there a UNIX command where I can delete users from 12345678 to 23456781?) Again, I'm using "sudo rm -r " followed by each home directory name separated by a space.
Thank you in advance!
MikeThis happens with or without SIM card, with and without wifi... with and without SD card as well-- even bought a new 32GB class 10 SanDisk-- but it still crashed.
Just an update: Went to the Nokia Care Center yesterday, they reflashed the firmware and I got back the phone within the day... when I went back home to try the phone again... again it kept hanging... in a period of 5 minutes, I had 5 hangs... right from startup, went straight to the cam, took some pics then pinched zoom... and phone simply crashed-- had no SD car, no sim card then.
So today I went back to Nokia Care Center... they said they will do some more tests and see... but they insist its a software problem, we'll see in a day or 2.
Maybe you are looking for
-
How do I erase an email address in known recipients list?
iPhone 4 Hi, I have this friend who changed his email address and everytime I send him an email his old email address keeps popping up in the list of known recipients. I removed his old email address from my address book but it stills shows up in the
-
My Seagate Expansion 500GB external hard drive no longer works with my Mac
Hi i have had a seagate expansion hard drive for the last year ish and it has worked as a time machine without any problem. when i first got it i had to format it to windows but that was simple and worked well. recently i unplugged it for a few weeks
-
Adding a text label to multiple photos in an event
I wonder if I can embed a label to all photos in an event? For example: Name of photographer and website.
-
How to find 2 different characters from a string
Hi All, I would like to remove 'T' and 'Z' from "20110428T10:33:45Z" and convert the string in date/time. I was looking at instr function but that allows to search for one character only. Thans for the help.
-
The picture frame in the blog summary!
Hey, by default a frame of the blog entry picture shows up in the blog summary right with its text... It was all good, but by adding my second blog entry i suddenly found both entries on the blog summary page are without no photos... even by playing