Here is the link where you can download PDF file about Basics of Terminal in Mac OSX:
http://homepage.mac.com/rgriff/files/TerminalBasics.pdf
Wednesday, November 9, 2011
Monday, November 7, 2011
How to add CODE block to Blogger post
If you want to add some code snippet to your post on Blogger just copy code snippet you need and go to this site http://www.simplebits.com. It has tools that will configure your snippet (it will change some signs).
How to hide and show div block with Javascript
1. Javascript
Add to the header the script that will hide/show div you need
In order to hide your div at the beginning add this to your CSS style:
In your HTML add hyperlink that will trigger the script for the id with the specific name:
Add to the header the script that will hide/show div you need
<script language="JavaScript">
function toggle(id) {
var state = document.getElementById(id).style.display;
if (state == 'block') {
document.getElementById(id).style.display = 'none';
} else {
document.getElementById(id).style.display = 'block';
}
}
</script>
2. CSSIn order to hide your div at the beginning add this to your CSS style:
#div1 {
display:none;
}
HTMLIn your HTML add hyperlink that will trigger the script for the id with the specific name:
<a href="#" onclick="toggle('div1');">Your text is here</a>
<div id="div1">
The content of this div will be hidden or shown after click on the link above.
</div>
Thursday, November 3, 2011
Enter user directory in single mode Linux
Use this command:
sudo -i -u username
cd /local/home/username/
sudo -i -u username
cd /local/home/username/
Wednesday, November 2, 2011
Tuesday, November 1, 2011
How delete all data from MySQL table
There are two ways to delete all the data in a MySQL database table.
TRUNCATE TABLE tablename; This will delete all data in the table very quickly. In MySQL the table is actually dropped and recreated, hence the speed of the query. The number of deleted rows for MyISAM tables returned is zero; for INNODB it returns the actual number deleted.
DELETE FROM tablename; This also deletes all the data in the table, but is not as quick as using the "TRUNCATE TABLE" method. In MySQL >= 4.0 the number of rows deleted is returned; in MySQL 3.23 the number returned is always zero.
TRUNCATE TABLE tablename; This will delete all data in the table very quickly. In MySQL the table is actually dropped and recreated, hence the speed of the query. The number of deleted rows for MyISAM tables returned is zero; for INNODB it returns the actual number deleted.
DELETE FROM tablename; This also deletes all the data in the table, but is not as quick as using the "TRUNCATE TABLE" method. In MySQL >= 4.0 the number of rows deleted is returned; in MySQL 3.23 the number returned is always zero.
Read more about it in this post:
How to list all tables in MySQL
If you want to see all tables created in your DataBase list them using this commands:
1. Enter to your DB
mysql db; (where db is the name for your DataBase)
2. Type
show tables;
1. Enter to your DB
mysql db; (where db is the name for your DataBase)
2. Type
show tables;
How to reorder or rename logical interface names in Linux
Here is the link where you can read about this topic.
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames
How to change permission in Linux
If you want to change the permission for some files or directories in Linux do this:
sudo -s
cd /dir1
find dir1/ -type f -perm 555 (if you just want to see that files)
find dir1/ -type f -perm 555 -exec chmod 644 {} \;
find dir1/ -type d -perm 555 -exec chmod 755 {} \;
ls -l
sudo -s
cd /dir1
find dir1/ -type f -perm 555 (if you just want to see that files)
find dir1/ -type f -perm 555 -exec chmod 644 {} \;
find dir1/ -type d -perm 555 -exec chmod 755 {} \;
ls -l
Wednesday, October 26, 2011
How to create TGZ archive with TAR
First of all: extension *.tar is the as tar.gz
Create tgz Archive with this command:
tar -cvzf newArchive.tgz sourceFileOrFolderNameForArchive
What is -cvzf:
c - "create" it means you want to create this archive
v - "verbose" if you want to see the process... it shows details about the results of running tar.
z - "zip" it means you want to compress file. tar will use the `compress' program.
f - "filename" it means you want to name archive with the specific name.
If you want to read the TAR manual in Terminal type in Terminal man tar
Or read this here http://ss64.com/bash/tar.html
Create tgz Archive with this command:
tar -cvzf newArchive.tgz sourceFileOrFolderNameForArchive
What is -cvzf:
c - "create" it means you want to create this archive
v - "verbose" if you want to see the process... it shows details about the results of running tar.
z - "zip" it means you want to compress file. tar will use the `compress' program.
f - "filename" it means you want to name archive with the specific name.
If you want to read the TAR manual in Terminal type in Terminal man tar
Or read this here http://ss64.com/bash/tar.html
Subscribe to:
Posts (Atom)