Changes

Jump to: navigation, search

User talk:Bossa nesta

3,096 bytes removed, 09:17, 10 March 2009
no edit summary
Mid-term Note - SPR720  ======================== File Permission =======================Agenda =
<pre>
$ chmod 7777 rpm.txt ; ll rpm.txt
-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
TO DO:
1. mNm, improvement
2. prepare sem 2
- NAD810
- SCR821
- SEC830
- SRA840
- SYA810
- co-op
3. osCommerce, Apache
4. Arcade
> set-user-id (suid)
= use owner ID instead of current user ID
> set-group-id (sgid)
= 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/directory or the superuser.
</pre>
======================== BASH SCRIPTING =======================temp =<pre>$ cal 16 2008 2>&1 >all-output.txtrun 'cal' with parameter "16 2008", err out to display/terminal, output to "all-output.txt"$ cal 16 2008 2>err.txt >all-output.txterr out to "err.txt", output to file "all-output.txt"
grep "</bin/bash$" /etc/passwd | cut -d: -f1 | sort | mail -s "Bash users" joe@example.compre>
1. selects all BASH users from the system account file =Notes=[http:/etc/passwd2www. cuts out the user name ('cut -d: -f1')3zytrax. sorts them into order ('sort')4. e-mails them to joe@com/books/dns/ch6/#slave dns example.com with the subject line "Bash users". ]
$ vi $(date +%Y)-notes.txtcreat a note that start with year, forexample, "2007-note.txt", "2008-note.txt"<pre>
$ vi $(date +%Y%m%d)-noteshttp://www.txtcreat a note with current year, month, date, e.g: "20081012-noteoscommerce.txt'info/kb/osCommerce/General_Information
$ vi Nes$(date +%Y%m%d)-noteshttp://www.pumo.txtcreat a note with the name started with "Nes" follow by current year, month, date, ecom.g: "Nes20081012tw/www/products/FAQ/teach-noteosc.txt'jsp
http://oscdox.com/crossx/nav.html?index.php.source.html
= single quote is actual value/string, double or no quote is variable $ X="Test"$ echo "$X"Test$ echo '$X'$X$ echo $XTest = ALWAYS use double quote for value$ touch "test file"$ NAME="test file"$ rm $NAMErm: cannot remove `test': No such file or directoryrm: cannot remove `file': No such file or directory$ rm "$NAME" = 'export' to turn variables into environment variables, so, all sub process can use the variable(s)$ TEST="Yes"$ bash -c 'echo $TEST' $ export TEST$ bash -c 'echo $TEST'Yes$ = destory/erase variablesunset Var_NAME  Common Environment Variables Variable ↓ Description ↓$PATH command search paths$HOME Current user's home directory.$MAIL Current user's mailbox.$DISPLAY X window display specification.$TERM Current terminal type (used to analyze keypresses and send special codes such as colours and effects to the terminal).$SHELL Absolute pathname of the default shell for the current user.$HOSTNAME Name of the host (computer) on which the shell is executing.$PS1 Primary prompt, used by the shell to request a command from the user.$PS2 Secondary prompt, used to request additional info from the user.$PS3 3rd prompt (rarely used).$PS4 4th prompt (rarely used).  = BASH automatically updates the value of certain special variables: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).  Retrieving Exist Status= ONLY '0' IS successfull, the rest are error$ ls /tmp >/dev/null$ echo $?0$ ls </temp pre>/dev/nullls: cannot access /temp: No such file or directory$ echo $?2 $ exit 2Set exit variable to '2" $ exit 2143Set exit variable to '2143" The test Command = BASH has a built-in test command (similar to /bin/test) which can perform basic string and integer comparisons using these operators (results are returned as an exit code):= 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 $y= String Equal "$x" = "Y"!= String Not equal "$x" != "NEVER" Unary File TestsOperator Test Example-e File exists [ -e /etc/passwd ]-r File is readable [ -r /etc/hosts ]-w File is writable [ -w /tmp ]-x File is executable [ -x /usr/bin/ls ]-f File is a regular file [ -f /dev/tty ]-d File is a directory [ -d /dev/tty ]  = For example....$ test 10 -gt 5$ echo $?0 $ test 10 -lt 5$ echo $?1 $ [ -w /etc/passwd ]$ echo $?1 $ a=10; [ "$a" -ge 100 -a "$a" -le 1000 ]; echo $?1 $ [ ! "a" = "b" ]; echo $?0 $ [ ! "a" != "b" ]; echo $?1 ======================== BASH FLOW CONTROL ========================  Format of 'if'========================if pipelinethen success-commands[elif pipeline2 else-if-commands][else alt-commands]fi======================== == CASE == echo -n "Are you sure you wish to remove '$file'?"read YNif [ "$YN" = "y" -o "$YN" = "Y" ]then echo "Deleting '$file'..." rm "$file"else echo "Aborted. '$file' not deleted."fi  if [ "$(date +%Y)" -lt 2010 ]then echo "Still waiting for the Whistler Olympics."fi  Format of "while"========================while pipelinedo commandsdone======================== == CASE ==num=1while [ $num -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 -Tdone  ========================Format of "for"========================for COLOUR in red blue greendo print "$COLOUR"done========================for ((x=0; x<=10; x++))do echo $xdone========================for FILE in /etc/*do if [ -x $FILE ] then echo "$FILE is executable" fidone========================   ======================== RPM ========================
RPM file names normally have the following format:<name>-<version>-<release>.<arch>.rpm= Bookmark =
== Query / Verify commands
1. Getting detailed information:
$ rpm -qi wget
2. Determining which package installed /usr/bin/wget:
$ rpm -qf /usr/bin/wget
3. Showing all the files installed by the package wget:
$ rpm -ql wget
4. Viewing the documentation files for the command wget:
$ rpm -qd wget
5. Listing all files included in the not yet installed package wget by entering the following:
$ rpm -qpl /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm
6. Listing all files included in the installed package wget:
$ rpm -ql wget
7. Verifying that a package is no longer installed by entering:
$ rpm -qa | grep wget
8. 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 /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm
<DT><H3 FOLDED>Bookmarks Menu</H3> <DL><p> </DL><p> <DT><H3 FOLDED>_tmp</H3> <DL><p> <DT><A HREF="http://neosmart.net/wiki/display/EBCD/Mac+OS+X">Mac OS X - NeoSmart Technologies Wiki</A> <DT><A HREF="http://www.insanelymac.com/lofiversion/index.php/t3622.html">InsanelyMac Forum &gt; Help with adding OSX to GRUB</A> </DL><p> <DT><H3 FOLDED>LUX</H3> <DL><p> <DT><H3 FOLDED>Weekly</H3> <DL><p> <DT><A HREF= Install "http:/ Uninstall / Upgrade commandszenit.senecac.on.ca/wiki/index.php/Fall_2008_NAD710_Weekly_Schedule#Week_12_.28Nov_24.29_-_Project_presentations">Fall 2008 NAD710 Weekly Schedule - Open Source@Seneca</A> 1 <DT><A HREF="http://zenit.senecac.on.ca/wiki/index. Installing the package wgetphp/Fall_2008_SPR720_Weekly_Schedule">Fall 2008 SPR720 Weekly Schedule - Open Source@Seneca</A> <DT><A HREF="http://cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A> $ rpm <DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_SYA710_Weekly_Schedule">Fall 2008 SYA710 Weekly Schedule -ivh Open Source@Seneca</mntA> <DT><A HREF="http:/iso/susezenit.senecac.on.ca/wiki/i586index.php/wgetFall_2008_LPT730_Weekly_Schedule">Fall 2008 LPT730 Weekly Schedule -1Open Source@Seneca</A> </DL><p> <DT><A HREF="http://zenit.senecac.on.10ca/wiki/index.2php/User_talk:Bossa_nesta">User talk:Bossa nesta -78Open Source@Seneca</A> <DT><A HREF="http://zenit.i586senecac.rpmon.ca/wiki/index.php/LUX_Student_2008-2009">LUX Student 2008-2009 - Open Source@Seneca</A> 2 <DT><A HREF="http://zenit.senecac.on.ca/wiki/index. Uninstalling the package wgetphp/LUX_Program">LUX Program - Open Source@Seneca</A> <DT><A HREF="http://zenit.senecac.on.ca/~chris.tyler/planet/">opensource@seneca</A> $ rpm <DT><A HREF="http://de-e wgetluxer.blogspot.com/">De-Luxer</A> 3 <DT><A HREF="http://zenit.senecac.on.ca/wiki/index. Upgrading the package wgetphp/Windows_Data_Migration_Tool">Windows Data Migration Tool - Open Source@Seneca</A> <DT><A HREF="http: //sites.google.com/site/bossanesta/Home/isaschedule">ISA_Schedule (NOTEbossa_nesta)</A> <DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_LUX_Grading">Fall 2008 LUX Grading - Open Source@Seneca</A> <DT><A HREF="https://wiki.ubuntu.com/MigrationAssistance">MigrationAssistance - Ubuntu Wiki</A> </DL><p> <DT><H3 FOLDED>iPhone</H3> <DL><p> <DT><A HREF="http: if the package is not installed it will install it for You, like option //testmyiphone.com/">Testmyiphone.com -ivhiPhone Speed Test</A> <DT><A HREF=")http://www.aptana.com/iphone">Aptana Studio: iPhone Development Plugin | Aptana</A> </DL><p> <DT><H3 FOLDED>Python</H3> <DL><p> $ rpm <DT><A HREF="http://pbe.lightbird.net/">Python-by-Uvh example</mntA> <DT><A HREF="http:/iso/susedocs.python.org/i586tutorial/wget">The Python Tutorial — Python v2.6 documentation</A> <DT><A HREF="http://pbe.lightbird.net/">Python-by-example - best</A> </DL><p> <DT><H3 FOLDED>Nes</H3> <DL><p> <DT><A HREF="https://www1.royalbank.com/cgi-bin/rbaccess/rbunxcgi?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE=ENGLISH">RBC Royal Bank - Sign In to Online Banking</A> <DT><A HREF="http://eric.bachard.free.fr/news/2008/10/fsoss-2008-saturday.html">ericb's place: FSOSS 2008 : saturday</A> <DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Talk:IPhone_Open_Source_Project">Talk:IPhone Open Source Project - Open Source@Seneca</A> <DT><A HREF="http://www.stevenlevy.com/index.2php/other-78books/crypto">StevenLevy.com » Crypto</A> </DL><p> <DT><H3 FOLDED>Seneca</H3> <DL><p> <DT><A HREF="https://my.senecacollege.ca/webapps/portal/frameset.i586jsp">Blackboard Academic Suite - My.rpmSeneca</A> 4 <DT><A HREF="https://learn.senecac.on.ca/">My. Extracting RPM file using rpm2cpio and cpio commandSeneca Student WEBmail</A> <DT><A HREF="http: (NOTE//fsoss.senecac.on.ca/2008/?q=node/39">Schedule | FSOSS 08</A> </DL><p> <DT><A HREF="http: RPM content will be extracted the current directory)//www.gam.co.za/connectivity/bandwidth.php#">GamCo | Dynamic Internet Solutions</A> $ rpm2cpio wget <DT><A HREF="http://utilities.globequest.com.ph/cgi-1bin/BandWidthMeter.pl?session=1221629953">Speed Test Results</A> <DT><A HREF="http://cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A> <DT><A HREF="http://zenit.10senecac.2-78on.i586ca/wiki/index.rpm | cpio php/LPT730">LPT730 -idmvOpen Source@Seneca</A>

Navigation menu