Difference between revisions of "User talk:Bossa nesta"

From CDOT Wiki
Jump to: navigation, search
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
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
+
<pre>
$ 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>
  
> set-user-id (suid)
+
=Notes=
= use owner ID instead of current user ID
+
[http://www.zytrax.com/books/dns/ch6/#slave dns example]
> 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    ========================
+
http://www.oscommerce.info/kb/osCommerce/General_Information
$ cal 16 2008 2>&1 >all-output.txt
 
run 'cal' with parameter "16 2008", err out to display/terminal, output to "all-output.txt"
 
$ cal 16 2008 2>err.txt >all-output.txt
 
err 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.com
+
http://www.pumo.com.tw/www/products/FAQ/teach-osc.jsp
  
1. selects all BASH users from the system account file /etc/passwd
+
http://oscdox.com/crossx/nav.html?index.php.source.html
2. cuts out the user name ('cut -d: -f1')
 
3. sorts them into order ('sort')
 
4. e-mails them to joe@example.com with the subject line "Bash users".  
 
  
$ vi $(date +%Y)-notes.txt
+
</pre>
creat a note that start with year, forexample, "2007-note.txt", "2008-note.txt"
 
  
$ vi $(date +%Y%m%d)-notes.txt
+
= Bookmark =
creat a note with current year, month, date, e.g: "20081012-note.txt'
 
  
$ 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>
= single quote is actual value/string, double or no quote is variable
+
<DL><p>
 
+
</DL><p>
$ X="Test"
+
<DT><H3 FOLDED>_tmp</H3>
$ echo "$X"
+
<DL><p>
Test
+
<DT><A HREF="http://neosmart.net/wiki/display/EBCD/Mac+OS+X">Mac OS X - NeoSmart Technologies Wiki</A>
$ echo '$X'
+
<DT><A HREF="http://www.insanelymac.com/lofiversion/index.php/t3622.html">InsanelyMac Forum &gt; Help with adding OSX to GRUB</A>
$X
+
</DL><p>
$ echo $X
+
<DT><H3 FOLDED>LUX</H3>
Test
+
<DL><p>
 
+
<DT><H3 FOLDED>Weekly</H3>
= ALWAYS use double quote for value
+
<DL><p>
$ touch "test file"
+
<DT><A HREF="http://zenit.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>
$ NAME="test file"
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_SPR720_Weekly_Schedule">Fall 2008 SPR720 Weekly Schedule - Open Source@Seneca</A>
$ rm $NAME
+
<DT><A HREF="http://cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A>
rm: cannot remove `test': No such file or directory
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_SYA710_Weekly_Schedule">Fall 2008 SYA710 Weekly Schedule - Open Source@Seneca</A>
rm: cannot remove `file': No such file or directory
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_LPT730_Weekly_Schedule">Fall 2008 LPT730 Weekly Schedule - Open Source@Seneca</A>
$ rm "$NAME"
+
</DL><p>
 
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/User_talk:Bossa_nesta">User talk:Bossa nesta - Open Source@Seneca</A>
= 'export' to turn variables into environment variables, so, all sub process can use the variable(s)
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/LUX_Student_2008-2009">LUX Student 2008-2009 - Open Source@Seneca</A>
$ TEST="Yes"
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/LUX_Program">LUX Program - Open Source@Seneca</A>
$ bash -c 'echo $TEST'
+
<DT><A HREF="http://zenit.senecac.on.ca/~chris.tyler/planet/">opensource@seneca</A>
 
+
<DT><A HREF="http://de-luxer.blogspot.com/">De-Luxer</A>
$ export TEST
+
<DT><A HREF="http://zenit.senecac.on.ca/wiki/index.php/Windows_Data_Migration_Tool">Windows Data Migration Tool - Open Source@Seneca</A>
$ bash -c 'echo $TEST'
+
<DT><A HREF="http://sites.google.com/site/bossanesta/Home/isaschedule">ISA_Schedule (bossa_nesta)</A>
Yes
+
<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>
= destory/erase variables
+
<DT><H3 FOLDED>iPhone</H3>
unset Var_NAME
+
<DL><p>
 
+
<DT><A HREF="http://testmyiphone.com/">Testmyiphone.com - iPhone Speed Test</A>
 
+
<DT><A HREF="http://www.aptana.com/iphone">Aptana Studio: iPhone Development Plugin | Aptana</A>
Common Environment Variables
+
</DL><p>
 
+
<DT><H3 FOLDED>Python</H3>
Variable  ↓ Description  ↓
+
<DL><p>
$PATH command search paths
+
<DT><A HREF="http://pbe.lightbird.net/">Python-by-example</A>
$HOME Current user's home directory.
+
<DT><A HREF="http://docs.python.org/tutorial/">The Python Tutorial — Python v2.6 documentation</A>
$MAIL Current user's mailbox.
+
<DT><A HREF="http://pbe.lightbird.net/">Python-by-example - best</A>
$DISPLAY X window display specification.
+
</DL><p>
$TERM Current terminal type (used to analyze keypresses
+
<DT><H3 FOLDED>Nes</H3>
and send special codes such as colours and effects to the terminal).
+
<DL><p>
$SHELL Absolute pathname of the default shell for the current user.
+
<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>
$HOSTNAME Name of the host (computer) on which the shell is executing.
+
<DT><A HREF="http://eric.bachard.free.fr/news/2008/10/fsoss-2008-saturday.html">ericb's place: FSOSS 2008 : saturday</A>
$PS1 Primary prompt, used by the shell to request a command from the user.
+
<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>
$PS2 Secondary prompt, used to request additional info from the user.
+
<DT><A HREF="http://www.stevenlevy.com/index.php/other-books/crypto">StevenLevy.com » Crypto</A>
$PS3 3rd prompt (rarely used).
+
</DL><p>
$PS4 4th prompt (rarely used).  
+
<DT><H3 FOLDED>Seneca</H3>
 
+
<DL><p>
= BASH automatically updates the value of certain special variables:
+
<DT><A HREF="https://my.senecacollege.ca/webapps/portal/frameset.jsp">Blackboard Academic Suite - My.Seneca</A>
Variable  ↓ Description  ↓
+
<DT><A HREF="https://learn.senecac.on.ca/">My.Seneca Student WEBmail</A>
$? Exit status of last pipeline
+
<DT><A HREF="http://fsoss.senecac.on.ca/2008/?q=node/39">Schedule | FSOSS 08</A>
$$ Process ID of the current shell
+
</DL><p>
$! Process ID of the last background pipeline
+
<DT><A HREF="http://www.gam.co.za/connectivity/bandwidth.php#">GamCo | Dynamic Internet Solutions</A>
$RANDOM Random integer (usually in the range 0-327687).
+
<DT><A HREF="http://utilities.globequest.com.ph/cgi-bin/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.senecac.on.ca/wiki/index.php/LPT730">LPT730 - Open Source@Seneca</A>
Retrieving Exist Status
 
= ONLY '0' IS  successfull, the rest are error
 
$ ls /tmp >/dev/null
 
$ echo $?
 
0
 
$ ls /temp >/dev/null
 
ls: cannot access /temp: No such file or directory
 
$ echo $?
 
2
 
 
 
$ exit 2
 
Set exit variable to '2"
 
 
 
$ exit 2143
 
Set 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 Tests
 
Operator 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 pipeline
 
then
 
  success-commands
 
[elif pipeline2
 
  else-if-commands
 
]
 
[else
 
  alt-commands
 
]
 
fi
 
========================
 
 
 
== CASE ==
 
echo -n "Are you sure you wish to remove '$file'?"
 
read YN
 
if [ "$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 pipeline
 
do
 
  commands
 
done
 
========================
 
 
 
== CASE ==
 
num=1
 
while [ $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 -T
 
done
 
 
 
 
 
========================
 
Format of "for"
 
========================
 
for COLOUR in red blue green
 
do
 
  print "$COLOUR"
 
done
 
========================
 
for ((x=0; x<=10; x++))
 
do
 
  echo $x
 
done
 
========================
 
for FILE in /etc/*
 
do
 
  if [ -x $FILE ]
 
  then
 
      echo "$FILE is executable"
 
  fi
 
done
 
========================
 
 
 
 
 
 
 
========================   RPM          ========================
 
 
 
RPM file names normally have the following format:
 
<name>-<version>-<release>.<arch>.rpm
 
 
 
== 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
 
 
 
== Install / Uninstall / Upgrade commands
 
  1. Installing the package wget:
 
      $ rpm -ivh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm
 
  2. Uninstalling the package wget:
 
      $ rpm -e wget
 
  3. Upgrading the package wget: (NOTE: if the package is not installed it will install it for You, like option "-ivh")
 
      $ rpm -Uvh /mnt/iso/suse/i586/wget-1.10.2-78.i586.rpm
 
  4. Extracting RPM file using rpm2cpio and cpio command: (NOTE: RPM content will be extracted the current directory)
 
      $ rpm2cpio wget-1.10.2-78.i586.rpm | cpio -idmv
 

Latest revision as of 08:17, 10 March 2009

Agenda


TO DO:
1. mNm, improvement
2. prepare sem 2
 - NAD810
 - SCR821
 - SEC830
 - SRA840
 - SYA810
 - co-op
3. osCommerce, Apache
4. Arcade

temp


Notes

dns example


http://www.oscommerce.info/kb/osCommerce/General_Information

http://www.pumo.com.tw/www/products/FAQ/teach-osc.jsp

http://oscdox.com/crossx/nav.html?index.php.source.html

Bookmark

Bookmarks Menu

</DL><p>

_tmp

<p>
<A HREF="http://neosmart.net/wiki/display/EBCD/Mac+OS+X">Mac OS X - NeoSmart Technologies Wiki</A>
<A HREF="http://www.insanelymac.com/lofiversion/index.php/t3622.html">InsanelyMac Forum > Help with adding OSX to GRUB</A>
<p>

LUX

<p>

Weekly

<p>
<A HREF="http://zenit.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>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_SPR720_Weekly_Schedule">Fall 2008 SPR720 Weekly Schedule - Open Source@Seneca</A>
<A HREF="http://cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_SYA710_Weekly_Schedule">Fall 2008 SYA710 Weekly Schedule - Open Source@Seneca</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_LPT730_Weekly_Schedule">Fall 2008 LPT730 Weekly Schedule - Open Source@Seneca</A>
<p>

<A HREF="http://zenit.senecac.on.ca/wiki/index.php/User_talk:Bossa_nesta">User talk:Bossa nesta - Open Source@Seneca</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/LUX_Student_2008-2009">LUX Student 2008-2009 - Open Source@Seneca</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/LUX_Program">LUX Program - Open Source@Seneca</A>
<A HREF="http://zenit.senecac.on.ca/~chris.tyler/planet/">opensource@seneca</A>
<A HREF="http://de-luxer.blogspot.com/">De-Luxer</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Windows_Data_Migration_Tool">Windows Data Migration Tool - Open Source@Seneca</A>
<A HREF="http://sites.google.com/site/bossanesta/Home/isaschedule">ISA_Schedule (bossa_nesta)</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Fall_2008_LUX_Grading">Fall 2008 LUX Grading - Open Source@Seneca</A>
<A HREF="https://wiki.ubuntu.com/MigrationAssistance">MigrationAssistance - Ubuntu Wiki</A>

<p>

iPhone

<p>
<A HREF="http://testmyiphone.com/">Testmyiphone.com - iPhone Speed Test</A>
<A HREF="http://www.aptana.com/iphone">Aptana Studio: iPhone Development Plugin | Aptana</A>
<p>

Python

<p>
<A HREF="http://pbe.lightbird.net/">Python-by-example</A>
<A HREF="http://docs.python.org/tutorial/">The Python Tutorial — Python v2.6 documentation</A>
<A HREF="http://pbe.lightbird.net/">Python-by-example - best</A>
<p>

Nes

<p>
<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>
<A HREF="http://eric.bachard.free.fr/news/2008/10/fsoss-2008-saturday.html">ericb's place: FSOSS 2008 : saturday</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/Talk:IPhone_Open_Source_Project">Talk:IPhone Open Source Project - Open Source@Seneca</A>
<A HREF="http://www.stevenlevy.com/index.php/other-books/crypto">StevenLevy.com » Crypto</A>
<p>

Seneca

<p>
<A HREF="https://my.senecacollege.ca/webapps/portal/frameset.jsp">Blackboard Academic Suite - My.Seneca</A>
<A HREF="https://learn.senecac.on.ca/">My.Seneca Student WEBmail</A>
<A HREF="http://fsoss.senecac.on.ca/2008/?q=node/39">Schedule | FSOSS 08</A>
<p>

<A HREF="http://www.gam.co.za/connectivity/bandwidth.php#">GamCo | Dynamic Internet Solutions</A>
<A HREF="http://utilities.globequest.com.ph/cgi-bin/BandWidthMeter.pl?session=1221629953">Speed Test Results</A>
<A HREF="http://cs.senecac.on.ca/~murray.saul/XWN740/notes.html">Murray Saul's Seneca Webpage</A>
<A HREF="http://zenit.senecac.on.ca/wiki/index.php/LPT730">LPT730 - Open Source@Seneca</A>