Programming :: Create An SSL Certificate And Answer The Questions Inside A Bash Script
Jan 24, 2011
I'm trying to create an SSL certificate and answer the questions inside a bash script. The command used to create the SSL certificate
Code: openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
The first question asked is. Country Name (2 letter code) [AU]:
View 4 Replies
ADVERTISEMENT
May 18, 2010
How can I set the outgoing port for the socket? In wireshark, my outgoing port is 1024, and i want to set it to 6800 (or a similar port) I see the outgoing broadcast-message in wireshark, but no answer. There are three ECU's in the LAN, which should answer. The following code is a mixture of C/C++ and jointed from different articles:
[code]...
In wireshark I can only see the outgoing message. But the "recvBuffer" (in the lower part of the code) contains the same content as the sendBuffer. Is it right, that I need a sender and further more a receiver? Or should I receive the broadcast-answer on the same socket on which I send the bc?
View 5 Replies
View Related
Dec 9, 2010
I'm having problems with bash quoting. Maybe someone can tell me what's going on.. Basically, I need to create a command line inside a bash script that contains arguments that contain spaces and bash variables that need to be expanded.
[Code]...
View 5 Replies
View Related
May 4, 2011
im pretty sure this is a remedial task for many of you but im having an issue with arrays from a shell script being accessed in an awk command. im pretty good with shell scripting but i am embarrassingly unfamiliar with awk. so here's the meat of the script...
Code:
I am trying to take an input file of ip addresses and corresponding netmasks and put it into a format to be loaded onto a juniper switch. the result should look something like this.. x.x.x.x/netmask using the cidr notation. no matter what subnet is provided though, /32 always gets appended to the end of the ip even when it should be /16, /24, etc... also, the cisco part works fine so that doesnt need any attention.
View 5 Replies
View Related
Oct 23, 2010
I want to do the following redirectin inside a bash script :
1. all the stdout will be redirected to a /tmp/log
2. all the errors will go to the stderr and also to the /tmp/log.
The following inside a bash script is not working, WHY and HOW to do it:
Rest of the bash script.
View 4 Replies
View Related
Nov 4, 2010
I have a simple BASH script that I want to make it execute USERNAME and PASSWORD to another bash script and htdigest. But After passwd, with htdigest and the script rustart, I have to manual enter the answers.
#!/bin/bash
echo -n "What is the user name?"
read -e USERNAME
[code]....
Quote:
This will ask me for username and password, but I want it to take the username and password from $USERNAME and $PASSWORD
service rustart restart
Quote:
This script needs a username to restart another exec, but I don't wana have to manually type in the username, I just want it to automatically fill in the $USERNAME
View 4 Replies
View Related
Apr 2, 2010
What I'm trying to do is grep [mysqld] from inside my.cnf and then add lines inside the file should they not be there. how do i do that?
View 3 Replies
View Related
Feb 16, 2011
Writing script to create backup of file by adding datetime to file name. Basically test for file presence if there, cp with datetime then rm original cp works fine from command line but get cannot stat `full path to file': No such file or directory
Code:
Here are the errors: cp: cannot stat `~/html/CVP_dadamail/.dada_files/.logs/errors.txt': No such file or directory rm: cannot remove `...': No such file or directory
The for statement is a placeholder as I have same file to backup out of several directories. using "bash -x scriptname" -OR- inserting echos, I can see I've constructed the strings properly. Believing it might be related to the hidden directories, I tried setting the shopt "glob" options to no avail.
Ultimately I'll add the other directories to the for loop and then run this from a cron job, so if you see potential pitfalls knowing I'm headed in that direction...believe construct would be
Code:
View 4 Replies
View Related
May 23, 2011
Im wondering how to create a menu in c like bash's select. I imagine there is already something out but I don't know what it would be. Im a c newb but been scripting for a long time now and trying to pick up a little c.this would be what I am looking to display:
Code:
1) option 1
2) option 2
3) option 3
Make a selection:obviously 1,2,3 would be the only valid selection and anything else would say invalid or something like that.
View 2 Replies
View Related
Jul 22, 2010
I have a Directory of files over time the directory has become a pain to manage... Its now a few 100GBs each file has a partner .log file so id would want some logic in keeping these together..So I want a script to move the files into sub-directories with a limit or 4GB and then i'll burn each of the directories to DVD.
View 14 Replies
View Related
Aug 9, 2010
I'm trying to write a script that will prompt the user for a username/password, then create that user/password in the right groups on all my machines. I know this is kind of a long way around to avoid a NIS server, but I like making my life more difficult.
This is what I have so far:
Code:
the script has 2 problems: The "if" functions return an error and do not compare the strings successfully. whatever password is entered does get applied properly and the user is unable to login
View 7 Replies
View Related
Dec 22, 2010
It could run on my computer. But there is no result.
[code]...
View 1 Replies
View Related
Dec 5, 2010
I'm starting bash shell script and I'm looping without any solution.
I'm trying to find some files under a folder hierarchy and in case of errors moving these files to a destination folder under the same hierarchy recreating this hierarchy if not exists.
Finding all ._* files under /src and moving them to /dest recreating folder1 or the others which contains ._* files but without moving files which does not correspond to the pattern.
Code:
I tried find command and I'am getting all needed files
Code:
But I don't know how to use the output to get the parent folder of files which are found to
1- create folder with mkdir -p /dest/folder1 or /dest/folder1/folder4
2- move found files from /src/... to /dest/... with rm command
I'm working on a find command as this trying to do all in the same line but ... little lost
Code:
View 8 Replies
View Related
Jun 20, 2010
i m using atoi() to convert char value to int. and then passing that int as a swtich variable.switch goes in a case and exectuing that particualr function but returning 0 value....for example: i am finding no of process() and system up time().when switch program goes in system up time it gives right values means correct no of days, hrs , min and sec but when it goes in no of process() it gives 0 answer.
View 8 Replies
View Related
Apr 28, 2011
I've noticed something, and hoped there was a work around.when I write a simple bash script, and run it, if I close the terminal i ran the bash script inside, the bash script stops. What are the solutions for this? Basically I want to run my bash script and close the terminal, keep the bash script running.
View 6 Replies
View Related
Jan 19, 2011
I would like to create a bash menu script for my home server For instance if i were to type ./script It would then bring up 3 options
a. Create a backup
b. Restore files from a backup
c. Quit
If you were to select a or b it should then ask you were you want to backup or restore from. And if i were to type in an incorrect letter i should get an error and take me back to menu. I have attepmted this a view time now and have magaged to get the menu up using parameters
View 9 Replies
View Related
May 20, 2010
I am trying to write little quiz to give different answer when given yes or no reply, however I got stuck with this. I am very very new to Python so please have patience. Can someone give me a sugesstions?
This is my code so far:
name = raw_input("
What is your name")
print "
Hello, " + name + "."
[Code]...
View 8 Replies
View Related
May 22, 2010
Code:
tupe=("File",("Open","Open a file"),"Edit",("Cut","Cut a file"),("Paste","Paste a file"),"About",("About","About the program"))
menutitle=""
menupos=0
for items in tupe:
if type(items)==str:
[Code]...
I'm trying to understand how to make "File" be the parent information for "Open","Open a file" and "Edit" to be the parent of "Cut, Cut a file" and "Paste", "paste a file". Does anyone have a suggestion for accessing the a nested tuple in this manner? The above code does not quite do what I want it to. The above code is for visual purposes, but I'm learning how to refactor for wx.python.
View 3 Replies
View Related
Dec 27, 2010
Things beyond my control are causing me to rush a bit in getting the website moved. I'm working hard to try and get it done, but something else has come up that SSL Certificate.I know that our website's "basket" area is protected by an SSL certificate to ensure customer information, especially credit info, is secure. With the move to Amazon's service, it looks like I may need to create our own self-signed SSL certificate to ensure the basket area remains secure.
I have found guides that walk through how to make one yourself and configuring apache to allow it, but something else has come to mind. The guides I found don't really indicate where the SSL certificate goes afterwards, and also doesn't suggest which sections should be governed by the certificate (as only the basket section uses it, not anything else). How would I find out that information?
View 1 Replies
View Related
Jun 8, 2011
I have trouble with using an alias inside aash function. I would like to ssh into multiple machines by executing:ssh machine To achieve this, I put something like the following into my ~/.bashrc:
alias machine='user@machine'
ssh()
{
[code]....
View 1 Replies
View Related
Dec 30, 2010
how do i use bash shell scripts inside php.I am just trying to call a simple cp command using php. Its not doing anything.
View 2 Replies
View Related
May 5, 2011
I'm trying create script to manage one mysql database, including new db and user creation. But I'm not able get it working when I put SQL commands into function. So I create simple script for testing which is still not working
Code:
#!/bin/bash -x
MAIN_DIR="/admin/mysql"
MYSQL_CNF="$MAIN_DIR/auth.cnf"
MYSQL_CMD="mysql --defaults-file=$MYSQL_CNF"
[code]....
View 1 Replies
View Related
Jan 28, 2010
I know that using alias I can run a whole command with a shortcut. But my requirement is to use parts of a long command and in between I have to pass some user defined values.
E.g. Suppose I have to routinely copy a directory to another remote directory on a remote machine.The remote machine name is quite long as well as the directory path to which I want to copy the files into.So the command to do scp would look like this[URL]Now I want to do some sort of aliasing (say "ecp") so that I just need to pass the source_directory name and the ecp command and do my job
View 3 Replies
View Related
Jan 19, 2010
During two instances now I have had to create a .js file in a folder. In one instance, (POLIPO) I can create the file, I just cannot save it. I have momentarily forgotten the error message stating why. In the second instance, I have to create a user.js file inside my Firefox folder to allow cut/copy/paste functionality in order to fully utilize an internet forum. I have a Windows desktop at home and used URL...to "fix" Firefox. My laptop, however, needs to have the same capabilities and is running Ubuntu 9.04, fully updated, and Firefox 3.0.17, fully updated.
In short, I would like to know how to have complete control over functions such as "create file" EVERY time I want to. Is this a permission issue? I have only one user on the Ubuntu box. Also, how can I modify Firefox to allow for cut/copy/paste in the Mozilla Rich Text Editor?I am new to using Linux, so a minor spoonfeeding may be required.
View 4 Replies
View Related
Jun 9, 2011
I created a tarball with multiple files. The rpm generator requires those files to be inside a folder. I don't want to move the files before generating the tar. Is there a way to create this folder while generating the tar or after it?
View 1 Replies
View Related
Jun 16, 2010
I have Administrator rights. I want to create new folder into /opt directory. So i clicked(Right click). but new folder menu has disabled. I cannot create new folder. Then Alternatively I used terminal. then I type mkdir /opt/lampp/htdocs/dummy now folder name has created. but I cannot paste anything into my dummy folder. So I checked permission which has you are not owner. How to create new folder & copy contents to new folder.
View 1 Replies
View Related
Sep 13, 2011
I want to create account for user named John Doe.
I'm trying: useradd "John Doe" and it's not work.
How to create user account with space inside on CentOS CLI?
View 6 Replies
View Related
Aug 4, 2011
I recently bought an host to have a personal website and would like to create a bash script to create make a mirror copy of it and then add it to crontab to run once a week. Essentially what I want to do is to get the website by using wget -m ftp://user***@ftp.host/mydir
Once this is done I'd like to have everything in an archive called mysite.date.tar.7z I've no experience at all of bash scripting but I guess this should be an easy task? How to make the user and password not visible ? Is there any other option better than wget? (maybe rsync it works better?)
View 2 Replies
View Related
Sep 10, 2010
i'm a new Ubuntu user and starting with programming, i've already installed XAMPP for LINUX at /opt directory and the Eclipse app to code php, java etc.When I try to write or create a file inside htdocs XAMPP directory the Eclipse outputs this message to me:"Parent of resource: /opt/lampp/htdocs/site/includes/include.php is marked as read-only./ opt/ lampp/ htdocs/site/includes/include.php (Permission denied)"Whats the matter with this possible error?
View 7 Replies
View Related
May 12, 2010
Is there some kind of certification or certificate for Python?
View 2 Replies
View Related