About the error control
public static void main(String[] args) {
if(args.length == 0) {
System.out.println("Usage: java ChargenClient host [port]");
return;
Above is a prt of my nio program at client side...
while i try to connect to server side, it keep failed and showing the msg of Usage: java ChargenClient host [port]..
i would like to know what the means by the control method of
if(args.length == 0)...
and what to do to avoid the args.length keep equal to 0??
i am quite new in java...so please somebody help me out.
public static void main(String[] args) {
if(args.length == 0) {
System.out.println("Usage: java ChargenClient host
ost [port]");
return;
Above is a prt of my nio program at client side...
while i try to connect to server side, it keep failed
and showing the msg of Usage: java ChargenClient host
[port]..
i would like to know what the means by the control
method of
if(args.length == 0)...
and what to do to avoid the args.length keep equal to
0??
args is an array of Strings that hold the command line arguments which get passed by the one who's running the application.
Compile the following code:public class Main {
public static void main(String[] args) {
System.out.println("You provided "+args.length+" arguments.");
for(int i = 0; i < args.length; i++) {
System.out.println((i+1)+" = "+args);
Now run it from the command prompt like this:java -cp . Main some command line arguments ...
Similar Messages
-
some one can help me please
i have no idea what i must to do.
an unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.The Exception Handler gave all the info that you need. No need to print the whole stack trace.
The exception handler says
Exception Details: java.lang.IllegalArgumentException
TABLE1.NAME
Look in the session bean (assuming that is where your underlying rowset is). Look in the _init() method for statements similar to the following:
personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
personRowSet.setTableName("PERSON");
What do you have? -
Im trying to restore my iphone 3G, i used itunes to restore it so it downloaded the iOS, after that it gives me the error 1015, when i read about the error then it tells me that i was downgrading, but how come since i used itunes to restore? why didnt it automatically provide me with the latest software made perfectly for the iPhone?
Your phone was jailbroken. You can't get help here.
In VERY RARE circumstances, this may indicate a hardware failure. -
Keep getting error 3004, every peice of information on this webstie about the error code is absolutly useless.
Have you tried on another computer connected to a different network?
-
Scenario:
With the release of Windows 10 Technical Preview (build 9926), some users may encounter an error message of “The account is not authorized to login from this station” when trying to access remote files saved in NAS storage. In
addition, the following error log may also be found via Event Viewer:
Rejected an insecure guest logon.
This event indicates that the server attempted to log the user on as an unauthenticated guest but was denied by the client. Guest logons do not support standard security features such as signing and encryption. As a result,
guest logons are vulnerable to man-in-the-middle attacks that can expose sensitive data on the network. Windows disables insecure guest logons by default. Microsoft does not recommend enabling insecure guest logons.
Background:
The error message is due to a change we made in Windows 10 Technical Preview (build 9926) which is related to security and remote file access that may affect you.
Previously, remote file access includes a way of connecting to a file server without a username and password, which was termed as “guest access”.
With guest access authentication, the user does not need to send a user name or password.
The security change is intended to address a weakness when using guest access. While the server may be fine not distinguishing among clients for files (and, you can imagine in the home scenario that it doesn’t
matter to you which of your family members is looking at the shared folder of pictures from your last vacation), this can actually put you at risk elsewhere. Without an account and password, the client doesn’t end up with a secure connection to the server.
A malicious server can put itself in the middle (also known as the Man-In-The-Middle attack), and trick the client into sending files or accepting malicious data. This is not necessarily a big concern in your home, but can be an issue when you take your
laptop to your local coffee shop and someone there is lurking, ready to compromise your automatic connections to a server that you can’t verify. Or when your child goes back to the dorm at the university. The change we made removes the ability to connect
to NAS devices with guest access, but the error message which is shown in build 9926 does not clearly explain what happened. We are working on a better experience for the final product which will help people who are in this situation.
As a Windows Insider you’re seeing our work in progress; we’re sorry for any inconvenience it may have caused.
Suggestion:
You may see some workarounds (eg. making a registry change restores your ability to connect with guest access).
We do NOT recommend making that change as it leaves you vulnerable to the kinds of attacks this change was meant to protect you from.
The recommended solution is to add an explicit account and password on your NAS device, and use that for the connections. It is a one-time inconvenience,
but the long term benefits are worthwhile. If you are having trouble configuring your system, send us your feedback via the Feedback App and post your information here so we can document additional affected scenarios.
Alex Zhao
TechNet Community SupportHi RPMM,
Homegroup works great in Windows 10 Technical Preview (9926 build), when I invited my Windows 10 Technical Preview (9926 build) joined in HomeGroup, I can access the shares smoothly:
My shares settings is like this:
Alex Zhao
TechNet Community Support -
Question About the Pen Control in Project Siena
Hi, good day.
I'am working on some tech demos with Project Siena, and I need to use the pen control so that the user draw some lines in the main page of the app. I decided to hide the pen controls, so there's only a white canvas. Sometimes the user will need to erase
some strokes... and because I hide the controls, I need a way to toggle between Draw Mode and Erase Mode.
I added a Toggle Switch so that in the OnCheck method I could add this expression "PenMode!Draw" or "PenMode!Erase",
but it doesn't help. I think I am using a wrong way. Are there any suggestions on how to switch between draw and erase mode within the pen control, without showing the controls?
Also, is there any way to erase or reset ALL the strokes in the pen control? For example, drawing some lines inside the pen control, and that the user can clean all the strokes at once.
Thanks,
Antonio S.Antonio,
It is possible to do both.
I have uploaded an example of this called Pen Control to the following:
https://onedrive.live.com/#cid=5CEEF21796F5830D&id=5CEEF21796F5830D%218724
For the Mode Toggle:
Set the Mode (Design > More > Mode) to CTRLpen
Create a Slider with the Min set to 0, and the Max set to 1.
Set the Slider's On Change to the following:
If(Slider1!Value = 0,UpdateContext({CTRLpen: PenMode!Draw}),UpdateContext({CTRLpen: PenMode!Erase}))
For the Erase All
Set the Pen's Clear to PenClear
Create a button.
Set the Button's On Select to the following:
UpdateContext({PenClear: true}); UpdateContext({PenClear: false})
Note:
CTRLpen and PenClear are names I made up. You can replace them with whatever names you want to use, as long as they are not names reserved by Siena.
-Bruton -
Know about the Error -36: an I/O error occurred?
I need help...trying to compress movies and this is the error I get in the export box.
I did examply same and getting same error anytime I tried to open a file. Did you get any response on the issue, that may help me?
Thanks Claire
Octavio -
About the Error after applying product key for bing search rest service
For the Project Siena I ve created the product key for Bing search rest service and i applied that product key which is valid even though i got the error when i click TRY button .can anyone please help me to find the solution
There was an error in retrieving sample data. Error : Unable to reach service. Please check if your service connector configuration is valid and you have network connectivityHello,
Thanks for your post. I am jotting down few steps to get the Bing search account key (you may have completed many/all of these).
To add Bing Search Service, go to
https://datamarket.azure.com/account/datasets and search for "Bing Search API". After you have subscribed to the service, navigate to "My Data" and click on Use. Click on Show and copy the
Primary Account Key information.
Note if your key contains a special character like / or = then double clicking on the content will copy the key partially.
Make sure you have copied the full key correctly. If the is incorrectly pasted in Siena's Primary Account Key field, you will get the error below:
This is similar to the error you have posted. Since the Primary Account Key is masked you can never be sure the contents are correct. It's best to clear the field and paste the key again.
If you still face the issue, please post your machine configuration (x86/OS) information.
Hope this helps,
-Karthik
This posting is provided "AS IS" with no warranties and confers no rights. -
Is there any body meetting that error message "java.lang.IllegalStateException: Response has already been committed"?
I couldn't find where the error is.
Could you give me a help?
Thanks for that.
joyceHi,
The IllegalStateException in a servlet is thrown when some information has already been sent to the client and then if you try to forward or redirect or include a page.
You can check it in your JSP code. -
Short question about the nano controls
Hi. I'm probably going to buy a 4Gb nano today, but first I'd like to ask a short question about the << >> buttons on the click wheel.
I read in a forum that the << & >> buttons are actually 'skip' buttons (only used to play the previous or next song respectively), and that it's impossible to rewind or fast-forward within the track you're listening to. This is extremely important for me as I have several 2-3 hours mp3, and I need to be able to access different parts of the file quickly (eg. not having to actually wait 1 hour to listen to my favorite part). I found this to be an important feature, and I can't believe Apple hasn't thought about it.
Anyway, I've never used an iPod, that's why this question may sound plain stupid.
Thanks for you replies!The iPod fast charges to about 80% and then trickle charges the rest of the way to prevent damaging the battery/iPod. A full charge takes more than an hour or two though the battery indicator will show full. The best way to tell if a full charge has occurred is to unmount the iPod from the computer but keep it connected. The screen will show an animation of a battery. When the animation stops the battery is fully charged.
Also, as your battery discharges the indicator will eventually show red indicating the battery is about to run out...in an hour or two. After you've owned your iPod for a couple months you'll figure out how much time you have left when the indicator turns red - it depends on a number of factors including play volume, equalizer use, etc. In real world use I'm getting over 11 hours.
The headphones are...average. If they didn't hurt my ears I'd find them acceptable for my pop music but not so acceptable for acoustic and symphonic nor music with booming bass - because they don't boom the bass.
I encode the majority of my music at 256 AAC and I've noticed no distortion caused by the EQ. This, plus your complaint about the earphones, leads me to think perhaps you got a bum set of phones. Borrow a pair from someone else and see what happens. -
Anyone knows about the Error 213:11 ?
I'll appreciate help fixing this problem
Here is the error information
01493, 0, "Invalid specification for dimension \"%(2)s\" in precompute condition for cube \"%(1)s\""// *Cause: The precompute condition contained an invalid specification. When a precompute percent is also specified, the precompute condition can specify only that the last dimensions in the cube's consistent solve specification are not precomputed.
// *Action: Remove the cube's precompute condition or precompute percent, or rewrite the cube's precompute condition so that it specifies only NONE for dimensions at the end of the cube's consistent solve specification.>
I have seen this once before with OWB. In that case it was due to mixed use of 'level' and 'cost' based precompute specifications. At the OLAP XML level the cube contained both a PrecomputeCondition and a PrecomputePercent value.
PrecomputeCondition is for 'level based' and PrecomputePercent is for 'cost based' aggregation. You can specify one, but not both in a single cube. More specifically, if you have PrecomputeCondition, then you need to either remove PrecomputePercent or else specify PrecomputePercent="0".
Here is what I heard from an OWB developer at the UI level.
If you switch off the level based aggregation on the cube's aggregation panel, that should make you good to go. For each dimension that has levels selected for precompute, just deselect. -
Dear All,
When I am excuting the SDK code created using VB6, the error message "run-time error '429' : activex component can't create object".
When I click debug, it refers to this following code (the yellow line colour is marking this following code):
Private Sub Class_Initialize()
Set oFSO = New FileSystemObject
Dim sSQL, LicServer, ServerPath, PathDir, FileTarget, FileSrc As String
Dim i As Integer
If Len(FileSystem.Dir(App.Path & "\" & "Settings.ini")) = 0 Then
MsgBox "Missing File Settings.ini ", vbOKOnly, "ERR_LOG"
If Not (oFSO.FileExists(App.Path & "\ERR_LOG.TXT")) Then
oFSO.CreateTextFile App.Path & "\ERR_LOG.TXT", False, False
End If
Set oStream = oFSO.OpenTextFile(App.Path & "\ERR_LOG.TXT", ForAppending)
oStream.WriteLine Now() & " MISSING FILE SETTINGS.INI "
End
Else
GetApplication
VB highlighted this one : Set oFSO = New FileSystemObject.
If I uncheck the microsoft scripting runtime in project preferences, the error message is changed. What is the solution to solve it ? I have tried to reinstall VB6 then reinstall Crystal report 9.2 or vice versa but so far it is not solved yet.
Pls give advice. I appreciate your help so much.
Rgd,
Steve
Edited by: steve andre on Aug 12, 2009 7:13 AMHello Steve,
Include Microsoft Scripting Runtime into the project.... then you can use FSO. Choose Add reference, on COM Tab select Microsoft Scripting Runtime .
OtherWise under System.IO namespace you can find everything wich is necessary for File and IO opearions.
You can use StreamWriter you write a textfile and IO.File.Exists to Query file exists or not. Also some fieatures has been changed from VB6 to .NET
App.Path -> My.Application.Info.DirectoryPath
FileSystemObject -> IO namespace....
Something like this:
Dim sSQL, LicServer, ServerPath, PathDir, FileTarget, FileSrc As String
Dim i As Integer
If IO.File.Exists(My.Application.Info.DirectoryPath & "\" & "Settings.ini") = False Then
MsgBox("Missing File Settings.ini ", vbOKOnly, "ERR_LOG")
Dim sw As New IO.StreamWriter(My.Application.Info.DirectoryPath + "\ERR_LOG", True)
sw.WriteLine(Now() & " MISSING FILE SETTINGS.INI ")
sw.Close()
Else
GetApplication()
Regards
J. -
Help about the error of installing the ides ehp5, error code:1073740791
hi All Basis Expert,
I have downloaded the ECC6.0EHP5, ides version. When I try to install it on windows server 2003 X64, I always got the error at phase 17, and the return code is 1073740791. the message like that:
Execution of the command "C:\usr\sap\EC2\SYS\exe\uc\NTAMD64\R3load.exe -testconnect" finished with return code -1073740791. Output:
The SAPinst.log file as follows:
SAPinst.log
INFO 2099-08-30 07:33:38.314
An error occured and the user decided to retry the current step: "|NW_ABAP_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_ABAP_Import_Dialog|ind|ind|ind|ind|5|0|NW_ABAP_Import|ind|ind|ind|ind|0|0|testDatabaseConnection".
INFO 2099-08-30 07:33:38.314
Working directory changed to C:/Program Files/sapinst_instdir/ERPEhP5/AS-ABAP/ORA/CENTRAL.
INFO 2099-08-30 07:33:38.408
Switched to user: cdp-ehp5\ec2adm.
INFO 2099-08-30 07:33:38.533
Creating file C:\Program Files\sapinst_instdir\ERPEhP5\AS-ABAP\ORA\CENTRAL\R3load.exe.log.
INFO 2099-08-30 07:33:38.548
Switched to user: cdp-ehp5\ec2adm.
INFO 2099-08-30 07:33:38.580
Output of C:\usr\sap\EC2\SYS\exe\uc\NTAMD64\R3load.exe -testconnect is written to the logfile R3load.exe.log.
WARNING 2099-08-30 07:33:41.830
Execution of the command "C:\usr\sap\EC2\SYS\exe\uc\NTAMD64\R3load.exe -testconnect" finished with return code -1073740791. Output:
ERROR 2099-08-30 07:33:41.845
CJS-30023 Process call 'C:\usr\sap\EC2\SYS\exe\uc\NTAMD64\R3load.exe -testconnect' exits with error code -1073740791. For details see log file(s) R3load.exe.log.
ERROR 2099-08-30 07:33:41.892
FCO-00011 The step testDatabaseConnection with step key |NW_ABAP_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_ABAP_Import_Dialog|ind|ind|ind|ind|5|0|NW_ABAP_Import|ind|ind|ind|ind|0|0|testDatabaseConnection was executed with status ERROR ( Last error reported by the step :Process call 'C:\usr\sap\EC2\SYS\exe\uc\NTAMD64\R3load.exe -testconnect' exits with error code -1073740791. For details see log file(s) R3load.exe.log.).
INFO 2099-08-30 07:33:42.517
Creating file C:\Program Files\sapinst_instdir\ERPEhP5\AS-ABAP\ORA\CENTRAL\__instana_tmp.xml.
Any ides? Any help? Many thanks.
Ross WangHi Vincent,
I don't know if the following information is enough?
disp+work information
kernel release 720
kernel make variant 720_REL
DBMS client library OCI_10201_SHARE,
DBSL shared library version 720.00
compiled on NT 5.2 3790 S x86 MS VC++ 14.00 for NTAMD64
compiled for 64 BIT
compilation mode UNICODE
compile time May 7 2010 02:47:09
update level 0
patch number 46
source id 0.046
supported environment
database (SAP, table SVERS) 700
710
701
702
703
711
712
720
730
731
DBMS server
ORACLE 10.1.0..
ORACLE 10.2.0..
ORACLE 11.2...*
operating system
Windows NT 5.0
Windows NT 5.1
Windows NT 5.2
Windows NT 6.0
Windows NT 6.1
disp+work patch information
( 0.001) Inconsistencies for <tt:call transformation> II (note 1240930)
( 0.001) SELECT with FOR ALL ENTRIES and dynamic WHERE condition II (note 110391
6)
( 0.001) Presentation buffer improvements (note 1332488)
( 0.001) Currency fields with manipulated input mask (note 1325894)
( 0.001) XBNF: Adjusted some identifier rules (note 1332293)
( 0.001) Suppressing input history for the SAP GUI (note 1264378)
( 0.001) VMC: Checking for null in JARM data condensing (note 1334807)
( 0.001) GUI status version (note 1081770)
( 0.001) VMC/JAC (note 1332616)
( 0.001) VMC/JAC (note 1332616)
Ross -
MSS - ECM - Have control about the error/warning messages
Hi experts,
We're working on MSS 6.0 EHP2.
We need to manage the messages appeared in the Compensation Planning scenario. It's possible to get a lot of messages if you have many employees. Then, I'd like to manage those messages to filter only the most important ones.
In the presentation situated in http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e04131e7-a828-2b10-23bd-9fcf1a33e418, page 24 it shows: "Messages appear as defined in Customizing" But I don't know how I can do it.
I can personalize the iview and put the message area to invisible, but then we lost all the messages and that it what we don't want.
Could you please help me??
ThanksMessages returned are of types : Informational, Warning and Error. What you can do (if you want to do from WD Java side ) try checking the BEcmplanning Web Dynpro Component present in MSS-ECM development component. There if you go to the context of the component controller you will see a context node named something as MD_Messages .... This context is filled at the time a backend function module is called and then based on the selected plan type FPM message manager gets the related message and displays in the message area. What you can do is.. before it gets displayed you can write a small logic to filter the messages..
In our case actually requirement was something related to more customization, where we needed to add (some messages based on custom logic) and remove some of the SAP message. So what we did, after getting the message from SAP standard Function module we passed the message table content to our custom function module which at the backend filtered/added messages and the final messages we got from our custom function module, were placed back into the MD_Messages context so the FPM message manager displays what we finally gave to it. -
What do you think of my Bash Script? What about the error checking?
Well what do you think of this Bash script
It works
I gave it some problems (i.e. unpluged the ethernet, messed up the URL's, uninstaled some programs...) to see if would report errors and stop or just keep going... But it did
I just kind of thought up a way to do some error checking with the commands that I know.....
What is a better way to do error checking?
What do you think I should add/Do to this script?
#!/bin/bash
# Shell script to make a USB Tumb Drive for Flashing BIOS on a Lenovo Ideapad Y510.
# This script needs to be owned and run as ROOT with the "sudo command"
# i.e. sudo usbbiosflasher
# If you have anyideas send me a PM on ubuntufourms.org my user name is HunterThomson
# Name/Rename this script usbbiosflasher and save it to the ~/home directory.
# Then run the command- chown root:root usbbiosflasher
# Then run the command- chmod 755 usbbiosflasher
# Then copy the script to the directory /usr/bin.
# Run this comand to do that- sudo cp ~/usbbiosflasher /usr/bin
# You also must have the program "mbr" installed
# You can install the mbr program by running this comand in the shell on Ubuntu
# sudo apt-get install mbr
# In Arch Linux you have to get it from Aur
# First you will need to know a few things...
# You will also need to know the Mount Point i.e. /media/disk and the /dev path i.e. /dev/sdb1.
# You can find these by using the df -T comand.
# Run df -T in the shell. Then plug in the USB Thumb Drive and run the df -T comand agin.
# The new listing is the USB Thumb Dirve.
# Also check to make sure the File System tipe is vFAT or FAT16 or FAT32.
# If it is not use gparted to format it to FAT32.
# I am farly certen that all USB Thumb drives come formated with FAT file system out of the BOX.
# You may want to fromat it anyway just to make sure.
echo "Interactive Shell Script to Make a USB Thumb Drive \for Flashing BIOS On a Lenovo Ideapad Y510"
echo ""
echo "You will need to have the program mbr installed"
echo "If you are on Ubuntu Linux you can retreve it form the repositories"
echo "If you are on Arch Linux you will need to get it from the Aur repository"
echo "Open anuther shell and \do that now..."
echo ""
verify="n"
while [ "$verify" != y ]
do
printf "Do you have mbr installed... yes or no?"
read AN1
echo ""
printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
read verify
done
echo ""
if [ "$AN1" == "no" ]
then
echo "Install mbr now. Then run this script agin"
exit
else
echo "contunuing script"
fi
echo ""
# The next comand will make a directory to put needed files into. Note this file and everything init will be owned by root.
mkdir ~/usbbiosfiles && check1="yes"
if [ "$check1" = "yes" ]
then
echo "Made directory usbbiosfiles... OK"
else
echo "Could not \make directory usbbiosfiles"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
exit
fi
# The next two comands will get the FreeDOS file and the .ROM file.
cd ~/usbbiosfiles && checka="yes"
if [ "$checka" = "yes" ]
then
echo "Changing to the usbbiosfiles directory... OK"
else
echo "Could not Change to the usbbiosfiles directory"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
wget "http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz" && check2="yes"
if [ "$check2" = "yes" ]
then
echo "Download of FreeDOS... OK"
else
echo "Could not Download FreeDOS"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
wget "http://ubuntuforums.org/attachment.php?attachmentid=78460&d=1216648756" && check3="yes"
if [ "$check3" = "yes" ]
then
echo "Download of the BIOS.ROM \file... OK"
else
echo "Could not Downlad the BIOS.ROM \file"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
# The next comand will name the .ROM file to the right name.
mv ~/usbbiosfiles/attachment.php?attachmentid=78460\&d=1216648756 ~/usbbiosfiles/06CN29WW.bios.update.tar.bz2 && check4="yes"
if [ "$check4" = "yes" ]
then
echo "Renameing of the BIOS.ROM \file... OK"
else
echo "Could not rename the BIOS.ROM \file"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
echo ""
# The next two comands set the variables. DEVX for the path i.e. /dev/xxx and MOUNTX for the mount point i.e. /media/xxx
verify="n"
while [ "$verify" != y ]
do
echo "You will need to know the Mount Point and the dev Path. You will also need to \make sure the File System \type is vFAT, FAT16 or FAT32."
echo ""
echo "With the USB Thumb Drive unpluged, Open another shell and run the comand df -T Then plug \in the USB Thumb Drive and run the comand df -T one \more time. The new device listed is the USB Thumb Drive. Note the Mount Point and The dev Path and the File system Type i.e. vFAT... If the File System \type is not vFAT, FAT16 or FAT32 you will need to fromat it with gparted. You may want to format the USB Thumb Drive anyway just to \make sure. In any \case delete all files and directorys on the USB drive before you go any ferther with this program."
echo ""
printf "Enter the dev path the USB Thumb Drive is at?"
read DEVX
echo ""
echo "Are you sure $DEVX is the dev path of the USB Thumb Drive... y or n?"
read verify
done
echo ""
verify="n"
while [ "$verify" != y ]
do
printf "What is the Mount Point of the USB Thumb Drive?"
read MOUNTX
echo ""
echo "Are you sure $MOUNTX is the Mount Point of the USB Drive... y or n?"
read verify
done
echo ""
install-mbr --enable A1 --partition 1 --force --timeout 0 $DEVX && check5="yes"
if [ "$check5" = "yes" ]
then
echo "Installing MBR on USB Thumb Dirve... OK"
else
echo "Could not install MBR on USB Thumb Drive"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
tar xjf ~/usbbiosfiles/*.tar.bz2 && check7="yes"
if [ "$check7" = "yes" ]
then
echo "Unpacking BIOS.ROM file... OK"
else
echo "Could not unpack BIOS.ROM file"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
gunzip ~/usbbiosfiles/FDOEM.144.gz && check8="yes"
if [ "$check8" = "yes" ]
then
echo "Unpacking FreeDOS files... OK"
else
echo "Could not unpack FreeDOS files"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
mkdir ~/usbbiosfiles/fdoem144 && check9="yes"
if [ "$check9" = "yes" ]
then
echo "Made directory fdoem144 in direcoty usbbiosfiles... OK"
echo ""
echo "Going to \sleep \for 5secs"
else
echo "Could not make directory fdoem144 in usbbiosfiles directory"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
modprobe loop && sleep 5 && check0="yes"
if [ "$check0" = "yes" ]
then
echo "Modprobeing loop... OK"
else
echo "Could not \modprobe loop"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
mount -o loop ~/usbbiosfiles/FDOEM.144 ~/usbbiosfiles/fdoem144 && check10="yes"
if [ "$check10" = "yes" ]
then
echo "Mounting FreeDOS on the fdoem144 directory... OK"
else
echo "Could not \mount FreeDOS on the fdoem144 directory"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
cp ~/usbbiosfiles/fdoem144/* $MOUNTX && check11="yes"
if [ "$check11" = "yes" ]
then
echo "Copying FreeDOS files to $MOUNTX... OK"
else
echo "Could not copy FreeDOS files to $MOUNTX"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
cp ~/usbbiosfiles/*.ROM $MOUNTX && check12="yes"
if [ "$check12" = "yes" ]
then
echo "Copying BIOS.ROM files to $MOUNTX... OK"
else
echo "Could not copy BIOS.ROM files to $MOUNTX"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
sync && check13="yes"
if [ "$check13" = "yes" ]
then
echo "Runing the syncing command... OK"
else
echo "Could not run the syncing command"
echo "look above \for \info"
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this scrip agin"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
rm -r ~/usbbiosfiles
exit
fi
umount ~/usbbiosfiles/fdoem144 && check14="yes"
if [ "$check14" = "yes" ]
then
echo "Unmounting of FreeDOS... OK"
else
echo "Could not unmount FreeDOS"
echo "Look above for errors or problems reported and fix the problem"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this script agin"
rm -r ~/usbbiosfiles
exit
fi
verify="n"
while [ "$verify" != y ]
do
printf "Do you see any errors... yes or no?"
read AN2
echo ""
printf "You answered... $AN2 to errors. Is this correct... y or n?"
read verify
done
echo ""
if [ "$AN2" == "yes" ]
then
echo "User Repoted... Error"
echo "Look above for errors or problems reported and fix the problem"
echo ""
echo "removeing directory usbbiosfiles..."
echo ""
echo "Reformat the USB Stick to FAT32 with gparted"
echo "Fix the problem and run this script agin"
rm -r ~/usbbiosfiles
exit
else
echo "Success"
echo "I did a lot of error checking too and didnt find anything"
echo ""
echo "Go get a pen and paper to write down these instructions"
printf "Then hit the Enter to continue"
read WAIT
echo ""
echo "Now leave the USB Thumb Drive pluged into your computer and Reboot. When the Lenovo Logo POST screen appears hit F2 to enter the CMOS setup utility. Go over to BOOT tab and go down to HardDrive \(Not Boot Order) \then \select the USB Thumb Drive as the 1st hard drve. Then F10 and yes to save changes. Your compter will reboot agin. Then when the Lenovo Logo POST Screen appers on reboot hit F4 to enter the BIOS FLASHING program. The USB Thumb Drive will be seen as the C drive \in the list on the Left, Select it. Then \select the .ROM \file \in the list on the Right and start the BIOS FLASH. \(NOTE Your hart may stop beating... This is normal) Pray to any God you know of and your computer should restart just like normal. Hit F2 and the BIOS will now stay it is 06CN29WW. You will need to \set the boot order to the way you like it and other things \if you need to because they have been changed to the default."
fi
echo ""
echo "End of script"
Last edited by hunterthomson (2008-08-10 11:17:47)Personally..... (this is just how I would have written it - if it works, then it's good enough for me though )
I would change this whole block:
verify="n"
while [ "$verify" != y ]
do
printf "Do you have mbr installed... yes or no?"
read AN1
echo ""
printf "You answered... $AN1 I have installed mbr. Is this correct... y or n?"
read verify
done
echo ""
if [ "$AN1" == "no" ]
then
echo "Install mbr now. Then run this script agin"
exit
else
echo "contunuing script"
fi
To this much shorter code:
MBR='/usr/bin/install-mbr' # Or where ever you expect it to be
if [ ! -x $MBR ] ; then
echo "mbr doesn't appear to be installed."
echo "If it is installed, check it's location, make sure it's executable and then make sure the MBR variable in this script is correct"
exit 1
fi
I wouldn't have used the checkXX variables for each stage:
mkdir ~/usbbiosfiles
if [ $? != 0 ] ; then
#failed
echo "Could not \make directory usbbiosfiles"
echo "look above \for \info"
echo "Fix the problem and run this scrip agin"
exit 1
else
echo "Made directory usbbiosfiles... OK"
fi
There is an issue with the way you do your verifications - the user can never get out unless they answer 'y' or hit CTRL+C. Something like this gives them options:
verify="n"
while [ "$verify" != "y" && "$verify" != "n" ]; do
echo "You need to answer 'y'es or 'n'o"
read verify
echo $verify | tr "[:upper:]" "[:lower:]" # This converts the answer to lowercase so replies entered in upper case will still work
done
if [ $verify != 'y' ] ; then
exit 1
fi
One last thing I try to do in scripts... Declare all your binaries as variables at the start of the program, then execute the binary program by using the variable. For example:
# Binaries
TAR='/bin/tar'
CP='/bin/cp'
CHMOD='/bin/chmod'
# Execute tar and chmod the created file
$TAR cvzf /tmp/tarfile.tar.gz /etc/*.conf
$CHMOD 400 /etc/*.conf
This way, it's easy to change the path in future without having to hunt through the script if the paths change, and it also ensures you're calling the programs using the full paths to make sure you're not executing some strange variant or alias that someone has setup. If I use `chmod` 30 times in a script, and the path changes in the future or on a different system (`chmod` is a bad example cause it's highly unlikely to change, but you know what I mean), then all you need to do is update the variable at the start of the script, and it all works again without having to script-hunt and change it 30 times.
Maybe you are looking for
-
Crystal Reports 2008 connecting to R/3
I have a general question for Crystal Reports 2008 for use with R/3. Crystal Reports 2008 with SAP/R3 Enterprise 4.7 I installed a trial version of Crystal Reports 2008 and connected it to the R/3 instance using a oracle id which has admin rights so
-
Change aspect ratio to letterboxed
Hello. I have a whole sequence in image size 640x480 that is pillarboxed. I want to turn this into a widescreen sequence as i think it's a 16:9 letterboxed. any ideas on how i can do this? I am new to the behind the scenes of premiere pro. thanks in
-
Selecting from a view when tables are in more than one schema problem
I give up where am I missing it. Why is the ORA-01031 error being generated on the view u1.bv1. In testing even if I give object access to u3 I still get the same errors: SQL> SQL> drop user u1 cascade; drop user u1 cascade ERROR at line 1: ORA-01918
-
I am building a webHelp system (primary layout) and I need to post it in TSF (Visual Studio) to they can build the install, but I am not sure how to do it. My file structure looks like this: My robohelp projects Capturx for ADR (my project) Under thi
-
How to make videos play only inside flash?
Hi. i have encoded(converted) some video files through Adobe Media Encoder to f4v. and i play them inside flash, through a flvlplayback component. I've placed the videos inside the same folder as my swf file. is there anyway i can protect the videos