Alt + 0153..... ™... trademark symbol
Alt + 0169.... ©.... copyright symbol
Alt + 0174..... ®....registeredtrademark symbol
Alt + 0176 ...°......degree symbol
Alt + 0177 ...±....plus-or-minus sign
Alt + 0182 ...¶.....paragraph mark
Alt + 0190 ...¾....fraction, three-fourths
Alt + 0215 ....×.....multiplication sign
Alt + 0162...¢....thecent sign
Alt + 0161.....¡......upside down exclamation point
Alt + 0191.....¿.....upside down question mark
Alt + 1...........smiley face
Alt + 2 ......☻.....black smiley face
Alt + 15.....☼.....sun
Alt + 12......♀.....female sign
Alt + 11.....♂......male sign
Alt + 6............spade
Alt + 5.............Club
Alt + 3............. Heart
Alt + 4.............Diamond
Alt + 13......♪.....eighth note
Alt + 14......♫......beamed eighth note
Alt + 8721.... ∑.... N-ary summation (auto sum)
Alt + 251.....√.....square root check mark
Alt + 8236.....∞.....infinity
Alt + 24.......↑.....up arrow
Alt + 25......↓......down arrow
Alt + 26.....→.....right arrow
Alt + 27......←.....left arrow
Alt + 18.....↕......up/down arrow
Alt + 29......↔... left right arrow
Introduction to Linux/Unix Shell Commands
The purpose of this document is to provide the reader with a fast and simple introduction on using the Linux command shell and some of its basic utilities. It is assumed that the reader has zero or very limited exposure to the Linux command prompt.
Command Shell
BASH
The difference between BASH and DOS command prompt
Special Characters
Command Shell
- A program that interprets commands
- Allows a user to execute commands by typing them manually at a terminal, or automatically in programs called shell scripts
- A shell is not an operating system. It is a way to interface with the operating system and run commands
BASH
- Stands to Bourne Again SHell
- Bash is a shell written a free replacement to the standard Bourne Shell (/bin/sh) originally written by Steave Bourne for UNIX systems
- It has all of the features of the original Bourne Shell, plus additions that make it easier to program with and use from the command line
- Since it is Free Software, it has been adopted as the default shell on most Linux systems
The difference between BASH and DOS command prompt
- Case Sensitivity - In Linux/UNIX, commands and filenames are case sensitive, meaning that typing "EXIT" instead of the proper "exit" is a mistake.
- "\" vs. "/" - In DOS, the forward-slash "/" is the command argument delimiter, while the backslash "\" is a directory separator. In Linux/UNIX, the "/" is the directory separator, and the "\" is an escape character. More about these special characters in a minute!
- Filenames - The DOS world uses the "eight dot three" filename convention, meaning that all files followed a format that allowed up to 8 characters in the filename, followed by a period ("dot"), followed by an option extension, up to 3 characters long (e.g FILENAME.TXT). In UNIX/Linux, there is no such thing as file extension. Periods can be placed at any part of the filename, and "extensions" may be interpreted differently by all programs, or not at all.
Special Characters
Before we continue to learn about Linux shell commands, it is important to know that there are many symbols and characters that the shell interprets in special ways.
This means that certain typed characters:
- cannot be used in certain situations,
- may be used to perform a special operations, or,
- must be "escaped" if you want to use them in a normal way.
Character Description | Description |
/ | Escape character. If you want to reference a special character, you must "escape" it with a backslash first. Example: touch /tmp/filename \* |
\ | Directory separator, used to separate a string of directory names. Example: /usr/src/linux |
. | Current Directory. Can also "hide" files when it is the first character in a filename |
.. | Parent directory |
~ (tilde) | User's home directory |
* | Represents 0 or more characters in a filename, or by itself, all files in a directory. Example: pic*2002 can represent the files pic2002, picJanuary2002, picFeb292002, etc. |
? | Represents a single character in a filename Example: hello?.txt can represent hello1.txt, helloz.txt, but not hello22.txt |
[ ] | Can be used to represent a range of values, e.g. [0 - 9], [A-Z], etc. Example: hello[0-2].txt represents the names hello0.txt, hello1.txt, and hello2.txt |
| | "Pipe". Redirect the output of one command into another command. Example: ls | more |
> | Redirect output of a command into a new file. If the file already exists, over-write it. Example: ls > myfiles.txt |
>> | Redirect the output of a command onto the end of an existing file Example: echo "Mary 555-1234" >> phonenumbers.txt |
< | Redirect a file as input to a program. Example: more < phonenumbers.txt |
; | Command separator. Allows you to execute multiple commands on the single line Example: cd /var/log ; less messages |
&& | Command separator as above, but only runs the second command if the first one finished without errors. Example: cd /var/logs && less messages |
& | Execute a command in the background, and immediately get your shell back. Example: find / -name core > /tmp/corefiles.txt & |
Cent OS 5 Mail Server
1. Install Postfix and Mail Transport Agent Switcher
- Open
Package Manager Tool A.K.A (Add/Remove Software)
- Under
Servers>Mail Server Click Optional Package
- Click/Check
postfix-(version codes).i386 - Postfix Mail Transport Agent
- Under
Servers>Server Configuration Tools>Click Optional Package
- Click/Check
system-switch-mail-gnome-(version codes).noarch – A GUI interface for Mail
Transport Agent Switcher
- Click
Apply
- Goto
System>Administration>Mail Transport Agent Switcher
- Select
Postfix then Click Ok
- Copy
the content of etc_postfix to /etc/postfix
- Then
Restart the postfix service by typing (service postfix restart) into
Terminal
- To
test Postfix open the Terminal and type:
· telnet
localhost smtp
· ehlo
localhost
· mail
from:<johndoe>
· rcpt
to:<johndoe>
· data
· test
· .
· quit
- To
check log file /var/log/maillog if theres problem arise
2. Dovecot POP3/IMAP Server Installation and Configuration
- Open
Package Manager Tool A.K.A (Add/Remove Software)
- Under
Servers>Mail Server Click Optional Package
- Click/Check
dovecot -(version codes).i386 - Dovecot Secure imap server
- Copy
the content of etc_dovecot to /etc/dovecot/
- Then
Restart the postfix service by typing (service dovecot restart) into
Terminal
- To
test Dovecot open the Terminal and type:
· telnet
localhost pop3 'replace localhost with your server name
· user
johndoe 'replace johndoe with your chosed user name
· pass
password 'replace password with your password
· list
· retr
1
· quit
- To check
log file /var/log/maillog if theres problem arise
3. Postfix SMTP Authentication and Dovecot SASL
- Since we
already copied the content of etc_dovecot to /etc/dovecot
- Restart
the service again by typing (service dovecot restart) and (service postfix
restart) into the Terminal
4. SquirrelMail Webmail Installation and Configuration
- Open
Package Manager Tool A.K.A (Add/Remove Software)
- Under
Servers>Mail Server Click Optional Package
- Click/Check
SquirrelMail -(version codes).i386 - SquirrelMail Webmail client
- Start
httpd service by typing (service httpd restart) into the Terminal
- Open
/usr/share/squirrelmail/config/conf.pl:
· Type
2 and Press Enter to select the Server Settings menu
· Type
1 and Press Enter to select the Domain menu
· Type
in your domain name and Press Enter
· Type
S to Save data
Type Q to Quit
- Extract
squirrelmail-1.4.21.tar.gz to /usr/share/ that can found from the folder
· Rename
the old squirrelmail to squirrelmail correspond its version
· Copy
the following to the squirrelmail-1.4.21
· Configuration
files
· Plugins
· Skins
· Translations
· Themes
(if you've edited or added any of them)
· Preferences
(but only if you keep them inside the SquirrelMail directory)
· Rename
the squirrelmail-1.4.21 to squirrelmail
- Extract
retrieveuserdata.0.9-1.4.3 to /usr/share/squirrelmail/plugins/
- Open
/usr/share/squirrelmail/config/conf.pl
· Type
in 8 and press Enter to list the Plugins submenu
· Install
the retrieveuserdata plugin by typing in the number corresponding to it and
press Enter.
· Return
to the Main Menu by typing in 9 and press Enter. Go to the General Options by
typing in 4 and press Enter. In the General Options, type in 9 and press Enter
to configure the editing of identity. This option will allow you to disable
editing of the name and email address since this will be automatically updated.
Save your changes when you are done.
· Login
to SquirrelMail and go to the Options page and click Personal Information. The
Full Name and E-mail Address should have been automatically filled up.
· By
default, RetrieveUserData will retrieve the name and email address from the
Linux system accounts, but you can configure this by editing the file
/usr/share/squirrelmail/plugins/retrieveuserdata/config.php.
- Extract
change_passwd-4.2f.tar.gz to /usr/share/squirrelmail/plugins/
Extract
compatibility-2.0.16-1.0.tar.gz to /usr/share/squirrelmail/plugins/
· From
a Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press
Enter. This will launch the SquirrelMail Configuration utility
· Type
in 8 and press Enter to list the Plugin submenu
· Install
the change_passwd_plugin by typing in the number corresponding to it and press
Enter
· When
you are done, type in q and press Enter to quit then type in y and press Enter
to save your changes
· If
your version of SquirrelMail is not 1.4.13 and higher or 1.5.1 and higher, you
need to patch your SquirrelMail source Goto.
/usr/share/squirrelmail/plugins/compatibility and apply the compatibility path
by typing in the command s below
· cd
/usr/share/squirrelmail/plugins/compatibility/
· patch
-p0 < patches/compatibility_patch-1.4.8.diff
· Replace
1.4.8 with your SquirrelMail version
· In
the /usr/share/squirrelmail/plugins/change_passwd directory, copy the file
config.php.sample
· and
save it as config.php.sample and save it as config.php
· Edit
config.php and review the default settings
· Below
are settings in config.php you may wish to change
$minimumPasswordLength -
Minimum length of the password.
$changePasswdInLogin -
Change password from the login form.
· Login
to SquirrelMail and go to the Options page. You should see the new Change
Password section.
· Click
the Change Password link to view the new Change Password page.
- (Optional)
If you will be retrieving user information from an Active Directory or
LDAP server, it will be easier if you setup the LDAP addressbook first so
that the plugin can use the LDAP connection details there. Then all you have
to do is comment the line $SQRUD_RETRIEVE_DATA_FROM =
"passwd.php" and uncomment the line $SQRUD_RETRIEVE_DATA_FROM =
"ldap.php" in the configuration file.
5. SquirrelMail Change Password Howto
- Install
the Poppassd service by opening the poppassd_repository(double-click)
found inside the folder
- Install
poppassd by typing into the Terminal:
· yum
install poppassd
- Enable
the poppassd service
· System>Administration>Server
Settings>Services>On Demand Services(Tab)
· Look
for poppassd Click/Cheack then Click Save
- Edit
the file /etc/pam.d/poppassd and replace the content with the lines below
· auth
required pam_unix.so
· account
required pam_unix.so
· password
requisite pam_cracklib.so
· password
sufficient pam_unix.so md5 shadow
- The
line password requisite pam_cracklib.so requires the new password to be
strong and at least six (6) characters long. You can leave it out if you
do not want that restriction.
- In
a Terminal window, type in the highlighted commands
below.
Sample poppassd session.
Replace johndoe, secret and p@ssw0rd with
your own valid user account, old password and new password respectively.
· telnet
localhost 106
· user
johndoe
· pass
secret
· newpass
p@ssw0rd
· quit
6.) Firewall Configuration Howto
- Goto
System>Administration>Security Level and Firewall s
· POP3
· 110:tcp
· POP3S
· 995:tcp
· IMAP
· 143:tcp
· IMAPS
· 993:tcp
- Set
security level to Permissive mode in SELINUX(Tab) or
system-config-securitylevel-tui in Terminal to see text mode
7.) MailScanner Setup Howto
- Install
rpm_forge from the folder
- Lowering
the RPMforge priority
- Type
in (yum install yum-priorities) to the Terminal or from the folder
- Edit
the file /etc/yum.repos.d/rpmforge.repo and add the line below:
· priority=10
- Test
your configuration using the command below. You should see a priority
protections message in the output.
· yum
check-update
- In
the address box, type in http://www.mailscanner.info/downloads.html and
press Enter. Download the stable version for RedHat, Fedora and Mandrake
Linux.
- The
MailScanner source code should now be on your desktop. Right click the
newly downloaded
- file
and click Extract Here.
- After
extracting, a MailScanner folder should be found on your Desktop. Right
click the MailScanner folder and click Open in Terminal.
- In
the terminal window, type in all the command below (in one line) to
install the required Perl modules from the RPMforge repository.
Type in:
· yum
install perl-Archive-Zip
· perl-DBI
· perl-DBD-SQLite
· perl-Filesys-Df
· perl-Net-CIDR
perl-OLE-Storage_Lite
· perl-Sys-Hostname-Long
- Then
finally type in (yum install --nogpgcheck mailscanner*) then press Enter
Labels:
Server
Setup VPN on Local Network (Windows)
On Server Side
- Go to “New Connection Wizard” then “Click Next”
- Setup Advance Connection
- Select “Accept Incoming Connections” then “Click Next”
- Select “Allow virtual private connections” then “Click Next”
- Select “Users allowed to connect”
- Specify IP Address Range then “Click Next”
- Then finally “Click Finish”
On Client Side
- Configure IP Address, the gateway must be the IP Address of the Server
- Goto “New Connection Wizard” then “Click Next”
- Select “Connect to the Network at my workplace” then “Click Next”
- Select “Virtual Private Network connection” then “Click Next”
- Enter your “Company Name” it will become your connection name then “Click Next”
- Enter “Host Name” or “IP Address of the VPN Server you will be connecting”
- Then finally select “Make Shortcut on Desktop” then “Click Finish”
Testing Connection:
- On Client Side Double+Click the Shortcut on your Desktop then input your User Name and Password allowed on the Server then “Click Connect”
- You will notice the network is registering its connection
- On Server Side you will notice the connection labeled with your User Name will appear beside the LAN Connection.
Labels:
Networking
How to make linux ghost image
Creating or Restoring a drive image locally
- Boot to the G4L CD. Select the newest kernel.
- Once everything loads, you will see some disclaimers. Hit "enter" until you get to a command prompt.
- Type "g4l" and hit enter to run G4L. Select "YES" to accept the disclaimer.
- Select "RAW Mode", then "Local Use"
- Select "Pick drive", then choose the drive where the image file will be saved (or where it is located, if you are restoring)
- Select "config filename".
- If you are backing up, enter the name of the image file you will create.
- If you are restoring, enter the name of the image file you want to restore.
- Begin the operation
- If you are backing up a drive/partition, select "backup". Choose the drive or partition to backup.
- If you are restoring, select
"restore". Choose the drive or partition you want to
restore to.
NOTE: you must restore with the same compression setting you saved with. I recommend putting the compression method in the image file name, e.g. "myharddrive.img.lzop". Also, normal backup/restore is incompatible with NTFSClone backup/restore. If you use NTFSClone, you might want to note that in the filename as well, e.g. "myWindowsDrive.ntfs.img.lzop".
Labels:
System
Install nano on pfSense
pkg_add -r ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-8.1-release/Latest/nano.tbz
or
on terminal
ssh to your pfsense
then, copy paste the code above
and press enter
then, try nano by typing nano
congrats, you will get nano editor on pfsense
pfSense Captive Portal passthrough port and ip address
If you need to allow certain application to run along with the log-in screen, for example
a chat box on the pfSense's Captive Portal. you need to first allow a specific port or an IP Address to passthrough a the Captive Portal.
Go to terminal
nano /etc/inc/captiveportal.inc
use ctrl+w to find
Any rule after this line
# redirect non-authenticated clients to captive portal
add 65532 fwd 127.0.0.1,{$listenporthttp} tcp from any to any dst-port 80 in.....
will get blocked so it should be added before it's blocked.
let say I want port 5900 to open in
captive portal, I should:
add 5900 pass tcp from any to any out
# redirect non-authenticated clients to captive portal
add 65532 fwd 127.0.0.1,{$listenporthttp} tcp from any to any dst-port 80 in.....
Labels:
Networking
How to fix Starting emulator for AVD 'androidname' PANIC: Could not open: androidname on MAC OSX
On MAC OSX you may encounter this error when you programming in android using Android SDK on Eclipse Kepler. This happens when you logged in to your root account and by trying to run a specific android avd and nothing happens.
Starting emulator for AVD 'androidname'
PANIC: Could not open: androidname
Starting emulator for AVD 'androidname'
PANIC: Could not open: androidname
Labels:
Programming,
System
Subscribe to:
Posts (Atom)