Shell script that required password
Hi,
I'm using an automator script to upload some files to a remote Linux server, and I'm using rsync in an automator shell script action.
That command required a password to work, how can I enter the password in the shell script action?
Thanks
Thanks for your answer, but as I'm no expert in AS,
I'm not sure to understand your answer.
How do those parameters are sent to AS?
You put it in the statement:
do shell script "rsync /source /dest" password "xyzzy" user name "you"
You can set up a keychain for the password and retrieve it when needed, to be secure in your code. Post back or head over to AS forum, we'll help you out. http://discussions.apple.com/forum.jspa?forumID=724
I suppose it can be run within Automator using a run
AS instead of a run shell script. As my automator do
some other task too.
Yes, Automator has Run AppleScript action.
And yes, you're right, iWeb publishing that is! Good
guest!
I saw some of your posts in iWeb board.
I'm mucking around with iWeb, it's a bloated monster. There are quite a few restrictions in iWeb, I had to hand code some of the stuffs, such as meta data keywords, tricky stuffs... I'm thinking of writing a script for post production.
Similar Messages
-
Need to call Shell script that uses SQL loader in APex4.1/11g
Hi there!
I have a requirement, wherein I have to call a shell script that connects to an external server, ftp's a file in and then uses sqlloader to load data into our table. Now we have the ftp script that does this for another program, but is a scheduled job. I wanted to call the ftp shell script from within APEX. Any suggestions on how this can be done, what PL/SQL logic can we use? I see online some people using dbms scheduler for this?
Thank you
SunHi,
Create some sh script on your oracle host machine where you can join into external server and run the process.
something like:
run_external_sh.sh
#!/bin/sh
ssh ext_user@ext_host ./sqlloader/import/import.shThen create a external JOB to call it via ORACLE(PL/SQL)
-- Call Shell Script.
BEGIN
DBMS_SCHEDULER.create_program (
program_name => 'external_call_sh',
program_type => 'EXECUTABLE',
program_action => '/local_host/call_external/sh/run_external_sh.sh',
number_of_arguments => 0,
enabled => TRUE,
comments => 'Call external SH script');
END;
/Now you can create a scheduled/or not scheduled JOB
-- Job defined by an existing program and schedule.
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'jb_external_call_sh',
program_name => 'external_call_sh',
schedule_name => 'external_call_scheduler', -- created scheduler
enabled => TRUE,
comments => 'Job defined by an existing external_call_sh program and schedule.');
END;
/Now you can call the JOB in APEX in PL/SQL process.
BEGIN
-- Run job synchronously.
DBMS_SCHEDULER.run_job (job_name => 'jb_external_call_sh');
END;Regards
J :D -
Ways to run a shell script that starts a python script
I have a shell script that is used to launch a python (2.5.1 installed via Fink) script (IDLE). The shell script, the IDLE script, and the python binary are all in /sw/bin as usual. This all has to be done AFTER X11 has been launched. I have to make this easy for my students to use.
In each account's home .xinitrc file, I have the lines
source .profile
vpython2.5 *
and this works, but it calls the vpython2.5 script every time X11 is launched. I've tried adding the vpython2.5 command to the X11 Applications menu, but this works ONLY if I add /sw/bin to the script name. Apparently the menu doesn't "know" about the current PATH setting. The keyboard shortcut I put in the menu neither shows up nor works either. So much for that option.
Now I've discovered Platypus and it looked promising, but I'm obiously not using it correctly and from the documentation, I can't figure out what I'm doing wrong.
So here's the ultimate question. Is there a way to use Platypus to encapsulate the vpython2.5 script, preferably also starting up X11, so students will only have to click on the new app's icon? This is how OpenOffice.org starts up. It seemed simple enough to do in Platypus, but I never saw the IDLE window open up.I added a shortcut key "j" for the "xman" app in X11, and it seems to work fine. Did you press the command key with the shortcut key? Are you sure the shortcut key you selected does not overlap with others in the menubar?
There should be no problems creating an application with Platypus using a shell script. In my experience, you have to source all necessary files, assuming that the shell script does not recognize your terminal settings. You can also launch X11.app in the shell script with the following command:
command open -a X11
It is a good idea to pause the shell script until X11 finishes launching. To do this, you need a command like,
command sleep 5
Otherwise, if you try to start X11-dependent apps in the shell script while X11 is launching, it will fail. There may be better ways to do this.
Hope this helps. -
For some banking sites that require passwords, I am 99.3% sure I at some time said "never remember passwords." Now I want to change my mind. When I go to Options/Options/Security/Remember.../Exceptions, the sites are not listed, but I still am not asked the question 'Want to remember....'
Thanks for your help and your quick reply, cor-el!
I did install the view passwords bookmarklet; it worked properly. I installed the saved-password-editor, and I think I entered all fields correctly, although (1) I was not sure of the meaning of the field 'submit prefix' and used the 'guess from current page' button, and (2) I winged it using the default on both the username field name and the password field name because the guess button simply said 'fill this form based on a likely login form on the current page.' [Does the button pick up that name?]
After fumbling a while, everything got to working! So, THANKS! Although I'm still not sure what the 'view passwords' bookmarklet does for me, since I do know the needed passwords.
I'm going to leave this open for one more day, since as a first-time user I don't know whether messages are added (such as explanations to my above minor issues) after I acknowledge the problem solved. I'll do that tomorrow. -
How to avoid password prompt in shell script for zip password protection
Hi
I am trying to set password protection to my oracle database export backup. Once the backup completed, it should compress with a password protection. Thats the plan. Initialy we were using the gzip for the compression. Then realized that there is no password protection for the gzip. Started using zip option. I tried using
zip -P <password> filename
But it was throwing below error.
-bash-3.2$ zip -P expreports REPORTS_2013FEB14.dmp
zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F)
zip error: Zip file structure invalid (REPORTS_2013FEB14.dmp)
Not quite sure why.
Then I used zip -e REPORTS_2013FEB14.dmp.zip REPORTS_2013FEB14.dmp
But this prompting for the password. As I am trying to put the command in the script. It will be tough if it prompts for the password.
I would like to know how to avoid the password prompting by saving somewhere or how the code should be written. Tried using expect feature of shell script. Below was the code I tried. It didnt work.
[oracle@SF40V6636 test]$ cat repexp.sh
zip -e REPORTS_imp.log.zip REPORTS_imp.log
expect "Enter password:"
send "imprep"
expect "Verify password:"
send "imprep"
So please help in avoiding this password prompt or let me know how to change the code.
Thanks
SHIYAS MHow about using gpg and adding a secret key to the requirement of a password? No one should be able to decrypt your file, not by knowing only the password.
1. Generate a public and private key pair:
$ gpg --gen-key
When it shows "We need to generate a lot of random bytes…" open another terminal session and type "dd if=/dev/sda of=/dev/null" to create traffic. When the public and secret key created and signed you can Ctrl-C the dd command.
To see what you have created:
$ gpg --list-keys
2. Encrypt and gzip your stuff:
$ tar zcf stuff.tgz file_or_folder
$ gpg recipient "Some Name" encrypt stuff.tgz
$ rm -f stuff.tgz
3. Decrypt and extract the archive:
$ gpg batch yes --passphrase "password" -d stuff.tgz.gpg > stuff.tgz
$ tar zxvf stuff.tgz
Again, knowing the password alone will not let anybody decrypt your stuff. -
Shell script adapter and passwords
Does anyone know how to get a password into a shell script resource adapter?
I've set up the "password" attribute in my resource adapter's schema, expecting at least to see the encrypted password in in $WSUSER_password, but it's always empty. Other attributes I add to the resource scheme show up in the scripts as shell variables just fine.
Side question - the Solaris resource adapter, which looks a lot like the shell script adapter, doesn't even have a password in its schema map, yet it seems to set passwords just fine. What's up with that?
The ShellScriptResourceObjects55.xml example doesn't seem to deal with passwords at all.Hi,
Have you been able to resolve this issue?
I am currently working on configuring a Shell Script Resource on my IDM system.
I am still in the "*Create User"* stage of things (I haven't even begun working with the other Actions : Get User, Get All Users, Delete User, Update User)
After a month-long period of trial-and-error, and a lot of headaches, I finally succeeded in Creating a new user on my Unix Machine, without any errors
Except for one thing : for some reason, the user I create is not being given a password!
A first, I configured the "Attribute Mapping" page to include a "Password" attribute. This did not work.
Then I removed the password from there (I figured that when I input the user's basic information on the IDENTITY tab in IDM, then the password gets automatically passed to the Unix machine).
Still, this did not work.
The funniest thing is : I am not getting any errors. The user is created on my Unix machine. And, also, in my My-SQL database.
The problem is : when I try to log into that same Unix machine as the user, it does not work, because......of course.....*.there is NO PASSWORD*.
What could be the problem? -
How to get name of batch file/shell script that starts program?
I don't think there's a way to do it, but I'm asking the question anyway...
of course, the startup script could pass its name as a parameter to the Java program, but I was wondering if the information could be determined "directly," via Java code. The idea is to allow your Java program to modify the startup configuration specified by your startup shell script.
For example, a "startup configuration" menu item would pop up a dialog box that would display- and allow you to change- the startup parameters, and then let you write the changes back to the script file.There are always some ways to do things.
I guess for your case, you need to go through JNI and have a native program to back track the Process ID of who started who. Never done that but I guess should work.
But a more natural way to do this is to have your startup configuration stored in an xml file or a properties file inside your classpath.
--lichu -
Shell script that captures key input? (keylogger)
I want to record all my keystrokes, just to see the frequency of some keys. There is a bunch of keyloggers on google that captures keystrokes, but none that is good and is in the AUR. Isn't it possible to do just with a little shell script? I don't mind if i have to keep the terminal open, and there is no need for any daemon/advanced stuff. Could you record a /dev/something or similar?
Haha, check this out: (cursor=move, z=fire, q=quit)
#! /usr/bin/python
from curses import *
import threading
class ckeylog( threading.Thread ):
def run(self):
file=open("/dev/input/event1","rb")
keymap={
'\x2c': 'z',
'\x2d': 'x',
'\x2e': 'c',
'\xc8': 'UP',
'\xd0': 'DOWN',
'\xcb': 'LEFT',
'\xcd': 'RIGHT',
'\x10': 'q',
'\x11': 'w',
'\x12': 'e',
'\x01': 'ESC',
'\x2a': 'LSHIFT',
'\x1c': 'ENTER',
self.loop=True
while self.loop:
event=file.read(48)
if event[28] == '\x01':
state=True
elif event[28] == '\x00':
state=False
else:
continue
if event[12] in keymap:
self.map[keymap[event[12]]]=state
file.close()
def quit(self):
self.loop=False
keylog=ckeylog()
keylog.map={}
keylog.start()
def main(s):
curs_set(0)
ship=[
"| /\ |",
"+/!!\+",
shipx=0
shipy=0
bullet="* *"
bulletx=0
bullety=0
fire=False
while True:
(my,mx)=s.getmaxyx()
if 'q' in keylog.map:
if keylog.map['q']: keylog.quit(); return
if 'UP' in keylog.map:
if keylog.map['UP']: shipy=shipy-1
if 'DOWN' in keylog.map:
if keylog.map['DOWN']: shipy=shipy+1
if 'RIGHT' in keylog.map:
if keylog.map['RIGHT']: shipx=shipx+1
if 'LEFT' in keylog.map:
if keylog.map['LEFT']: shipx=shipx-1
if 'z' in keylog.map:
if keylog.map['z']: (fire,bullety,bulletx)=(True,shipy,shipx)
if shipy<0: shipy=0
if shipy>my-len(ship): shipy=my-len(ship)
if shipx<0: shipx=0
if shipx>mx-len(ship[0]): shipx=mx-len(ship[0])
if fire and bullety == 0: fire=False
if fire: bullety=bullety-1
s.erase()
s.addstr(shipy,shipx,ship[0])
s.addstr(shipy+1,shipx,ship[1])
try:
s.addstr(shipy+2,shipx,ship[2])
except error: pass
if fire: s.addstr(bullety,bulletx,bullet)
s.refresh()
napms(10)
wrapper(main) -
hi
scenario: A folder contains n - number of folder which contains few generated pdf reports.
NOW I need a shell script which will solve two purpose simultaneously:
1. it will create folder for each folders in the specific directory according to the month and year AND it will copy the respected folder within them including the pdf files.
2. The newly created folders will be converted into a tar compressed file.
EXAMPLES:
Say the folder name is E-SEVA wich contains folders say 10_MAR_2011,12_MAR_2011 and n_YthMonth_2011 and same for 2012 year also.Now I need folders rather a tarz file for each month say MARCH_2011,FEB_2011,MARCH_2012,FEB_2012 and so on.
kind regardsThe following should do:
months="JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC"
years="2011 2012"
dir="E-SEVA"
cd "$dir"
for month in $months; do
for year in $years; do
for folder in $(find . -type d -name "*_${month}_${year}"); do
mkdir -p "${month}_${year}"
cp -pR "$folder" "${month}_${year}/"
tar -rf "${month}_${year}.tar" "${month}_${year}"
done
done
doneNote: You cannot add files to a compressed archive. -
How to check from a shell script that a particular software is installed
Hai friends
I want to write a shell script which has to check whether a particular software is installed on the machine, or not. If installed, then what version is it using and the get the version number and which type of installer is it? i mean is it a .rpm installation or a tar.gz installation.
how can i check this from a shell script. If any of you have any idea please give me a sample script to check this
Thank you@Raja_Abilash
I don't think this is a right thread & right forum to POST this question.
better go ahead with forums related to LINUX. -
Safari won't load pages that require passwords
Hi,
I am fairly new to Macs having made the switching from an ever problematic HP, and have found it to be a blessing. As such I took it with me to Spain (where I am now) and have encountered NUMEROUS problems with all most every aspect of Leopard and its applications.
I have found that Safari is unable to access any website which requires you to enter a username and password. I have researched the problem online and have tried several things to fix it including
1. Restarting Safari
2. Restarting the computer
3. Changing Cookie settings
4. Deleting all the Cookies
All to no avail
I didn't have these problems with the Macbook when I was in Australia, nor do I have problems accessing the same websites, through the same internet connection on a friends windows computer OR on firefox on this mac.
I am at a totally loss and any suggestions would be much appreciated!
Thank you in advance!I have the same problem. But when I switch to another user on the same computer, I can get the username and password prompt. But in my own login I can't. Something has changed in Safari. I did use Onyx to clear caches and logs, not sure if that had anything to do with it. I have deleted the preferences, reset Safari, tried lots of things, but nothing makes it work. It is obviously a setting on my login since it works on the other login. It works in Internet Explorer. I haven't tried disabling the plug-ins yet in the preferences under Security. I will do that next.
-
Can't get HttpURLConnection to work on sites that require passwords
Help!
I can't seem to get this code to work. I have found numerous sites
that show the same code that I am using.
I am using jdk 1.5 and trying to generate the
"Authorization: Basic erwerwqerwerwer" line in the http get header. I
have tried the "Authenticator.setDefault (new MyAuthenticator ());"
route and it did not work. I have found a lot of web sites with the
code snippets
// Build the string to be used for Basic Authentication
<username>:<password>
String userPassword = "username:password";
// Base64 encode the authentication string
String encoding = new sun.misc.BASE64Encoder().encode
(userPassword.getBytes());
URL url = new URL ("http://www.server.com");
HttpURLConnection connection =
HttpURLConnection)url.openConnection();
connection.setDoInput(true);
connection.setUseCaches(false);
connection.setRequestProperty("Authorization", "Basic " +
encoding);
connection.connect();
BufferedReader in =
new BufferedReader (new InputStreamReader
((InputStream)url.getContent()));
String line;
while ((line = in.readLine()) != null) {
pw.println (line);
but none of this works. All I get is:
GET / HTTP/1.1
User-Agent: Java/1.4.2
Host: www.server.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Either the JDK does not work or I am doing something stupid. Help!
Please? I am about to just say screw it and use a raw socket and write
the get request manually.
Thanks!My god! Is it me or is everyone finding ways to avoid my question? How can I explain this any better?
Encoding is not the problem. If there is a problem with the way I encode the user:password String, it is a separate issue. I have included the CGI transaction between my program and the server in my original question to illustrate the problem.
If you looked at it, you would realize it does not matter what was encoded because it was never included in the GET request. Didn't I show that in the original posted question? That was the point of my question.
here is another example of a GET request that would work:
GET /admin.cgi HTTP/1.1
Host: www.server.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Authorization: Basic kdkkseeoefksakf
Cache-Control: max-age=0
It is from a sniffer dump of the transaction between my browser and the web site (the URL and username:password are changed). That is the correct CGI transaction to get a web page from a password protected URL.
Now the sniffer dump from my Java code using HttpURLConnection :
GET /admin.cgi?mode=viewxml HTTP/1.1
User-Agent: Java/1.4.2
Host: www.server.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Encoding the password or putting a space between "Basic" and the encoded password string do not even come into the problem yet.
Is everyone asleep here or did I just not use the secret handshake and everyone is just screwing with me? -
CWMS 1.5.1.131.A - meetings that require password allowing dial-in
We are seeing meetings with passwords are open(no password required) users joining via phone-only. I was searching open & resolved caveats with MR2-&-3, and not seeing any data? -- is this a known issue, or expected behavior?
Hi Ken,
This is expected behavior in CWMS. If you schedule a WebEx meeting (with Web and Audio available), password is enforced only via WEB. There is no password/PIN for just dialing in to the meeting. Audio meeting restriction is included in Personal Conference meetings, where hosts and participants get access codes they are required to enter when joining the meeting.
I hope this helps.
-Dejan -
How to run Outlook Rule that fires a batch script that requires passing parameters.
How do I pass arguments/parameters to a batch script in an Outlook rule ? The Parameters would be located in the body of the message.
Thanks.Hi,
If the two arguments are always next to each other, then we can simply add that single phrase to the “specific words” list.
If the two arguments are not always next to each other, then there is no way in Outlook to do this with a single rule but we can achieve this by creating 2 rules. See:
http://www.msoutlook.info/question/220
Please Note: Since the web site is not hosted by
Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
Regards,
Steve Fan
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Sqlldr ops$user/password in a shell script - problem
Hello All:
i run the sqlldr command from a unix shell script that has
sqlldr ops$user/password@alias control='/path1/control.ctl' log='/path2/log.log'
I am geeting invalid user/password because of the $ sign in the username. What is the workaround for this? How to handle this in the script?
I tried single quote, USERID= unsuccessfully. Any ideas?
Thanks
San~Hello,
Single quote should work fine , can you post your shell script specially couple of line and try connecting from command line.
$ sqlplus 'test$user'/*****
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 14 14:36:04 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine optionsRegards
Edited by: OrionNet on Apr 14, 2009 2:38 PM
Maybe you are looking for
-
Multiple Messages in Same JMS queue
Hello, I have interfaces in which different xml messages from the same sender system will be placed in the same MQ queue, is there a way that XI JMS sender channel can differentiate the xml messages based on the payload? I can create a single communi
-
I am getting below error when the weblogic server starts. Can somebody help on this. DS (XreferenceDB) creation was successful but could not test (Not available in Testing tab). ####<Jul 3, 2012 7:18:14 PM IST> <Error> <Deployer> <PC165237> <AdminSer
-
ASA5510 RA VPN, ACS assigned address different subnet than inside interface
Currently we have our RA tunnels set up with IP Address pools that are in the same subnet as the ASA inside interface and that works to give the clients connectivity. I have seen that this is not the best way to go with this and also have seen some c
-
i want to unlock my ipod with a computer that i am using using now i have synced it with a pc which is now in another country , so what should i do now ?
-
Could not connect to server after OS got blue screen, Pls help.
Hi Expert, i want to ask about this error. when i'm trying to log in in BO Universe designer. I'm getting this error. [repo_proxy 13] SessionFacade::openSessionLogon with user info has failed(Unable to log on: Could not connect to server ekawati-f4e1