Open main menu

CDOT Wiki β

Changes

User talk:Bossa nesta

3,198 bytes removed, 09:17, 10 March 2009
no edit summary
Mid-term Note - SPR720= Agenda =<pre>
TO DO:
1. mNm, improvement
2. prepare sem 2
- NAD810
- SCR821
- SEC830
- SRA840
- SYA810
- co-op
3. osCommerce, Apache
4. Arcade
================================================ File Permission================================================</pre>
$ chmod 7777 rpm.txt ; ll rpm.txt= temp =-rwsrwsrwt 1 BossaNesta BossaNesta 41310 2008-10-12 16:39 rpm.txt$ chmod 7000 rpm.txt ; ll rpm.txt---S--S--T 1 BossaNesta BossaNesta 41310 2008-10-12 16:39 rpm.txt$ chmod 4234 rpm.txt ; ll rpm.txt--wS-wxr-- 1 BossaNesta BossaNesta 41310 2008-10-12 16:39 rpm.txt<pre>
</pre>
> set-user-id (suid) = use owner ID instead of current user ID> set-group-id (sgid) Notes= inherit group ID from directory, = sub-dir will automatic has same sgid = even over sudo command and root ID> sticky bit = on old systems, file was not swapped out and stuck in memory = a file in that directory can be renamed or deleted only by the owner of the file[http://directory or the superuserwww.zytrax. com/books/dns/ch6/#slave dns example]
<pre>
================================================ BASH SCRIPTING================================================$ cal 16 2008 2>&1 >all-output.txtrun 'cal' with parameter "16 2008", err out to displayhttp://terminal, output to "all-outputwww.txt"$ cal 16 2008 2>erroscommerce.txt >all-output.txterr out to "err.txt", output to file "all-output.txt"info/kb/osCommerce/General_Information
grep "http:/bin/bash$" www.pumo.com.tw/www/etcproducts/passwd | cut FAQ/teach-d: -f1 | sort | mail -s "Bash users" joe@exampleosc.comjsp
1http://oscdox. selects all BASH users from the system account file com/etccrossx/passwd2nav. cuts out the user name ('cut -d: -f1')3html?index. sorts them into order ('sort')4php. e-mails them to joe@example.com with the subject line "Bash users"source. html
$ vi $(date +%Y)-notes.txtcreat a note that start with year, forexample, "2007-note.txt", "2008-note.txt"</pre>
$ vi $(date +%Y%m%d)-notes.txtcreat a note with current year, month, date, e.g: "20081012-note.txt'= Bookmark =
$ vi Nes$(date +%Y%m%d)-notes.txt
creat a note with the name started with "Nes" follow by current year, month, date, e.g: "Nes20081012-note.txt'
<DT><H3 FOLDED>Bookmarks Menu</H3> <DL><p>= single quote is actual value </DL><p> <DT><H3 FOLDED>_tmp</string, double or no quote is variableH3> <DL><p>$ X <DT><A HREF="Test"$ echo "$http://neosmart.net/wiki/display/EBCD/Mac+OS+X"Test$ echo '$>Mac OS X'$X$ echo $XTest- NeoSmart Technologies Wiki</A> <DT><A HREF= ALWAYS use double quote for value$ touch "test file"$ NAME="test file"$ rm $NAMErmhttp: cannot remove `test': No such file or directoryrm: cannot remove `file': No such file or directory$ rm //www.insanelymac.com/lofiversion/index.php/t3622.html"$NAME" = 'export' >InsanelyMac Forum &gt; Help with adding OSX to turn variables into environment variables, so, all sub process can use the variable(s)GRUB</A>$ TEST="Yes" </DL><p>$ bash -c 'echo $TEST' <DT><H3 FOLDED>LUX</H3> <DL><p>$ export TEST$ bash -c 'echo $TEST'Yes$ <DT><H3 FOLDED>Weekly</H3> <DL><p> <DT><A HREF= destory"http:/erase variablesunset Var_NAME  Common Environment Variables Variable ↓ Description ↓$PATH command search paths$HOME Current user's home directory/zenit.$MAIL Current user's mailboxsenecac.$DISPLAY X window display specificationon.$TERM Current terminal type (used to analyze keypresses and send special codes such as colours and effects to the terminal)ca/wiki/index.$SHELL Absolute pathname of the default shell for the current userphp/Fall_2008_NAD710_Weekly_Schedule#Week_12_.$HOSTNAME Name of the host (computer) on which the shell is executing28Nov_24.29_-_Project_presentations">Fall 2008 NAD710 Weekly Schedule - Open Source@Seneca</A>$PS1 Primary prompt, used by the shell to request a command from the user <DT><A HREF="http://zenit.$PS2 Secondary prompt, used to request additional info from the usersenecac.$PS3 3rd prompt (rarely used)on.$PS4 4th prompt (rarely used)ca/wiki/index. php/Fall_2008_SPR720_Weekly_Schedule">Fall 2008 SPR720 Weekly Schedule - Open Source@Seneca</A>  <DT><A HREF= BASH automatically updates the value of certain special variables"http:Variable ↓ Description ↓$? Exit status of last pipeline$$ Process ID of the current shell$! Process ID of the last background pipeline$RANDOM Random integer (usually in the range 0-327687)//cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A>  Retrieving Exist Status <DT><A HREF= ONLY '0' IS successfull, the rest are error$ ls "http://tmp >zenit.senecac.on.ca/devwiki/null$ echo $?0$ ls index.php/temp Fall_2008_SYA710_Weekly_Schedule">Fall 2008 SYA710 Weekly Schedule - Open Source@Seneca</dev/nullA>ls <DT><A HREF="http: cannot access /temp: No such file or directory$ echo $?2 $ exit 2Set exit variable to '2/zenit.senecac.on.ca/wiki/index.php/Fall_2008_LPT730_Weekly_Schedule$ exit 2143Set exit variable to '2143" The test Command = BASH has a built>Fall 2008 LPT730 Weekly Schedule -in test command (similar to Open Source@Seneca</bin/test) which can perform basic string and integer comparisons using these operators (results are returned as an exit code):A>= return 0 or 1, where 0 is true, 1 is false Operator Comparision type Comparison Example-eq Integer Equal $x -eq 4-ne Integer Not equal $x -ne 4-gt Integer Greater than $x -gt 0-lt Integer Less than $x -lt 1000-ge Integer Greater</equal $x -ge $yDL><p>= String Equal "$x" <DT><A HREF= "Yhttp://zenit.senecac.on.ca/wiki/index.php/User_talk:Bossa_nesta">User talk:Bossa nesta - Open Source@Seneca</A>!= String Not equal "$x" !<DT><A HREF= "NEVER" Unary File TestsOperator Test Example-e File exists [ -e http:/etc/passwd ]-r File is readable [ -r zenit.senecac.on.ca/wiki/etcindex.php/hosts ]LUX_Student_2008-2009">LUX Student 2008-w File is writable [ 2009 -w Open Source@Seneca</tmp ]A>-x File is executable [ -x <DT><A HREF="http://zenit.senecac.on.ca/usrwiki/binindex.php/ls ]LUX_Program">LUX Program -f File is a regular file [ -f Open Source@Seneca</dev/tty ]A>-d File is a directory [ -d <DT><A HREF="http:/dev/tty ]  = For examplezenit.senecac.on.ca/~chris.$ test 10 -gt 5$ echo $?0 $ test 10 -lt 5$ echo $?1 $ [ -w tyler/planet/etc">opensource@seneca</passwd ]A>$ echo $?1 $ a <DT><A HREF=10; [ "$a" http://de-ge 100 -a "$aluxer.blogspot.com/" >De-le 1000 ]; echo $?Luxer</A>1 $ [ ! "a" <DT><A HREF= "bhttp://zenit.senecac.on.ca/wiki/index.php/Windows_Data_Migration_Tool" ]; echo $?0 $ [ ! "a" != "b" ]; echo $?1  ========================BASH FLOW CONTROL========================  Format of 'if'========================if pipelinethen success>Windows Data Migration Tool -commands[elif pipeline2 else-if-commands][else alt-commands]fiOpen Source@Seneca</A> <DT><A HREF======================== == CASE == echo -n "Are you sure you wish to remove '$file'?http://sites.google.com/site/bossanesta/Home/isaschedule">ISA_Schedule (bossa_nesta)</A>read YNif [ "$YN" <DT><A HREF= "y" -o "$YN" = "Y" ]then echo "Deleting '$file'http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_LUX_Grading">Fall 2008 LUX Grading - Open Source@Seneca</A> rm <DT><A HREF="$file"else echo "Abortedhttps://wiki. '$file' not deletedubuntu.com/MigrationAssistance">MigrationAssistance - Ubuntu Wiki</A>fi </DL><p> <DT><H3 FOLDED>iPhone</H3> <DL><p>if [ <DT><A HREF="$(date +%Y)http://testmyiphone.com/" >Testmyiphone.com -lt 2010 ]iPhone Speed Test</A>then echo <DT><A HREF="Still waiting for the Whistler Olympicshttp://www.aptana.com/iphone">Aptana Studio: iPhone Development Plugin | Aptana</A>fi </DL><p> <DT><H3 FOLDED>Python</H3> <DL><p>Format of <DT><A HREF="whilehttp://pbe.lightbird.net/"========================while pipelinedo commandsdone======================== == CASE ==num=1while [ $num >Python-le 5 ]do echo $num num=$[ $num + 1 ]done == CASE ==# In this case it will just print number 1 to 5========================while (( 1 ))do eject by-Texample</A>done  ======================= <DT><A HREF=Format of "forhttp://docs.python.org/tutorial/">The Python Tutorial — Python v2.6 documentation</A> <DT><A HREF========================for COLOUR in red blue greendo print "$COLOURhttp://pbe.lightbird.net/">Python-by-example - best</A>done </DL><p>======================== <DT><H3 FOLDED>Nes</H3>for ((x=0; x <DL><=10; x++))do echo $xdonep> <DT><A HREF========================for FILE in "https://etcwww1.royalbank.com/*do if [ cgi-x $FILE ] then echo "$FILE is executable" fidonebin/rbaccess/rbunxcgi?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE===================   ================================================ RPM================================================ RPM file names normally have the following format:<nameENGLISH">RBC Royal Bank -Sign In to Online Banking<version/A>- <releaseDT><A HREF="http://eric.bachard.free.fr/news/2008/10/fsoss-2008-saturday.html">ericb's place: FSOSS 2008 : saturday<arch/A>.rpm  <DT><A HREF== Query "http:// Verify commands 1zenit.senecac. Getting detailed information: $ rpm -qi wget 2on. Determining which package installed ca/usrwiki/binindex.php/wgetTalk:IPhone_Open_Source_Project">Talk:IPhone Open Source Project - Open Source@Seneca</A> $ rpm -qf <DT><A HREF="http://www.stevenlevy.com/usrindex.php/binother-books/wget 3crypto">StevenLevy. Showing all the files installed by the package wget:com » Crypto</A> $ rpm -ql wget </DL><p> 4. Viewing the documentation files for the command wget: <DT><H3 FOLDED>Seneca</H3> $ rpm -qd wget <DL><p> 5. Listing all files included in the not yet installed package wget by entering the following <DT><A HREF="https: $ rpm -qpl /mnt/isomy.senecacollege.ca/susewebapps/i586portal/wget-1frameset.10.2jsp">Blackboard Academic Suite -78My.i586.rpmSeneca</A> 6. Listing all files included in the installed package wget <DT><A HREF="https: $ rpm -ql wget 7//learn. Verifying that a package is no longer installed by entering: $ rpm -qa | grep wget 8senecac. Seeing what has changed in the files on your hard drive since the wget RPM was originally installed by entering the following: $ rpm -V wget 9. Checking package to ensure its integrity and origin: (NOTE: gpg or pgp software must be installed on your system before you use this command) $ rpm -K ca/mnt">My.Seneca Student WEBmail</isoA> <DT><A HREF="http:/suse/i586/wget-1fsoss.10senecac.2-78on.i586.rpmca/2008/?q=node/39">Schedule | FSOSS 08</A> </DL><p> <DT><A HREF== Install "http:/ Uninstall / Upgrade commands 1www.gam.co. Installing the package wget: $ rpm -ivh za/mntconnectivity/isobandwidth.php#">GamCo | Dynamic Internet Solutions</suseA> <DT><A HREF="http:/i586/wget-1utilities.10globequest.2-78com.i586.rpm 2. Uninstalling the package wget: $ rpm ph/cgi-e wget 3bin/BandWidthMeter. Upgrading the package wget: (NOTE: if the package is not installed it will install it for You, like option pl?session=1221629953"-ivh>Speed Test Results</A> <DT><A HREF=") $ rpm -Uvh http:/mnt/isocs.senecac.on.ca/suse~murray.saul/i586XWN740/wget-1notes.10.2-78.i586.rpmhtml">Murray Saul's Seneca Webpage</A> 4. Extracting RPM file using rpm2cpio and cpio command <DT><A HREF="http: (NOTE: RPM content will be extracted the current directory) $ rpm2cpio wget-1//zenit.10senecac.2-78on.i586ca/wiki/index.rpm | cpio php/LPT730">LPT730 -idmvOpen Source@Seneca</A>