Must Have for Windows:
In windows we don't have lots of things that comes out of the box so, if you are using you can consider few of the following must have.
Antivirus [ Along with internet security. ]
Q-Dir [ File explorer. ]
Sublime editor
Evernote [ My Must have]
ResophNotes
launchy [ http://www.launchy.net ]
CCLeaner
Defraggler
Google Chrome
Adobe Flash Player
Java
TreeSize
7-ZIP
Skype
Trillian
foxit-reader
nuance pdf reader
Adobe Acrobat Reader
Dropbox
Google Drive
LastPass
KeePass
MalwareBytes Anti-Malware
VirtualBox
VMPlayer
Audacity
GIMP
BSPlayer
VLCPlayer
FileZilla
DisplayFusion
Light Image Resizer
FeelTheBase
StressMyPC
IsMyLcdOK
Speccy
TeamViewer
QuickTime Player:
Wunderlist
recuva [ Data recovery tool ]
qBittorrent
soluto
Copernic Desktop Search
mp3finder
winDirStat
InfanView
Ninite
Everything
xbmc
Bullzip pdf printer
Thunderbird
Eclipse
LibreOffice
Microsoft Security Essentials
Picasa
ImgBurn
Free Download Manager
Pidgin
Photoscape
G-Talk
Notepad++
iTunes
Handbrake
Plex
Winamp
Teracopy
External links:
http://www.itcentralpoint.com/28-must-have-free-applications-on-your-new-windows-pc
http://lifehacker.com/lifehacker-pack-for-windows-2013-our-list-of-the-best-787533613
http://www.tomsguide.com/us/pictures-story/286-2-best-free-windows-apps.html
http://geekermagazine.com/top-15-windows-7-apps-you-must-have/
Disclaimer: Its a collection from lots of other site(s) and few of my notes. I would also like to declare that I am not owning lots of its content. Please feel free to contact me directly if you want me to remove any of your content, that you don't want to share to other through this blog.
Friday, 27 September 2013
Tuesday, 30 July 2013
svn migration
Installing the svn at the new server
- login to the new jira/svn server.
- I have already created an account "svn", so login to the svn user.
- Keeping the similar directory structure so keeping creating a dir as repos under /home/svn dir.
- sudo su - svn
- mkdir repos
- Copy the old repo backup.
- sudo apt-get install subversion
- svnadmin create /home/svn/repos/repos_name [ This will create a repository ]
- svnadmin load /home/svn/repos/repos_name < /from/the/backup/repo.file [ This will load the svn backup ]
- Start the svn server [ svnserve -d -r /home/svn/repos ] -> [ Here you have to provide the repo directory ]
- By default svn run at port: 3690
How to kill or stop svn server
- You need to kill the svn server.
- grep for the svnserve and then kill that pid.
How you will do a basic test
- check for the svnserve service is running or not.
- log in to any of your client server. [ I am using a ubuntu client ]
- on the client [ svn client ]
- svn checkout svn://<ip_of_svn_server>/repo/path
Big question
- its not asking for the username and password?
Got it: You need to have the following file updated [ /home/svn/repos/repos_name/conf ] cat svnserve.conf ### This file controls the configuration of the svnserve daemon, if you ### use it to allow access to this repository. (If you only allow ### access through http: and/or file: URLs, then this file is ### irrelevant.) ### Visit http://subversion.tigris.org/ for more information. [general] ### These options control access to the repository for unauthenticated ### and authenticated users. Valid values are "write", "read", ### and "none". The sample settings below are the defaults. anon-access = none auth-access = write ### The password-db option controls the location of the password ### database file. Unless you specify a path starting with a /, ### the file's location is relative to the directory containing ### this configuration file. ### If SASL is enabled (see below), this file will NOT be used. ### Uncomment the line below to use the default password file. password-db = passwd ### The authz-db option controls the location of the authorization ### rules for path-based access control. Unless you specify a path ### starting with a /, the file's location is relative to the the ### directory containing this file. If you don't specify an ### authz-db, no path-based access control is done. ### Uncomment the line below to use the default authorization file. # authz-db = authz ### This option specifies the authentication realm of the repository. ### If two repositories have the same authentication realm, they should ### have the same password database, and vice versa. The default realm ### is repository's uuid. realm = Your company Name.Then comment update the following at file "authz"
~/repos/repos_name/conf$ cat authz
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
#[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
ReadOnlyUserName=r
Then update the "passwd" file with user's auths.
example: ~/repos/repos_name/conf$ cat passwd ### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line. [users] # harry = harryssecret # sally = sallyssecretAfter this kill all the svn service and start it again.
sudo killall svnserve svnserve -d -r /home/svn/repos
######## SVN Hooks #########
http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html
http://svnbook.red-bean.com/nightly/en/svn.ref.reposhooks.html
The
hooks subdirectory is, by
default, filled with templates for various repository
hooks:$ ls repos/hooks/ post-commit.tmpl post-unlock.tmpl pre-revprop-change.tmpl post-lock.tmpl pre-commit.tmpl pre-unlock.tmpl post-revprop-change.tmpl pre-lock.tmpl start-commit.tmpl $
NOTE: The hooks files should be own by svn server's process owner and need to have executable permission.
NOTE: If its not having executable permission it will not work.
NOTE: If its not owned by proper user, it will not work.
-rwx-wx--x 1 svn svn 2764 2014-03-04 03:53 pre-revprop-change
-rwx-wx--x 1 svn svn 7208 2014-03-04 03:53 pre-commit -rwx-wx--x 1 svn svn 45233 2014-03-04 03:53 post-commit.1
DO a must test of: eol-style, by adding a new file...
To actually install a working hook, you need only place some executable program or script into the repos/hooks directory,
which can be executed as the name (suchas start-commit or post-commit) of the hook.
Example 5.1. hooks-env (custom hook script environment
configuration)
# All scripts should use a UTF-8 locale and have our hook script # utilities directory on the search path. [default] LANG = en_US.UTF-8 PATH = /usr/local/svn/tools:/usr/bin # The post-commit and post-revprop-change scripts want to run # programs from our custom synctools replication software suite, too. [post-commit] PATH = /usr/local/synctools-1.1/bin:%(PATH)s [post-revprop-change] PATH = /usr/local/synctools-1.1/bin:%(PATH)s
Common uses for hook scripts Repository hook scripts can offer a wide range of utility, but most tend to fall into a few basic categories: notification, validation, and replication. Notification scripts are those which tell someone that something happened. The most common of these found in a Subversion service offering involve programs which send commit and revision property change notification emails to project members, driven by the post-commit and post-revprop-change hooks, respectively. There are numerous other notification approaches, from issue tracker integration scripts to scripts which operate as IRC bots to announce that something's changed in the repository.
## How to see the tree structure.
This shows the tree output for revision 13 in our sample repository:
$ svnlook tree -r 13 /var/svn/repos / trunk/ button.c Makefile integer.c branches/ bookstore/ button.c Makefile integer.c
http://svnbook.red-bean.com/en/1.7/svn.ref.svnlook.html#svn.ref.svnlook.sw.full_paths
# About svn property:
To set the property: [ NOTE You most configure your svn server not to commit any file, if atleast "svn:eol-style " is not set.
svn propset svn:eol-style native path/of/file
svn propset svn:mime-type application/octet-stream path/of/file
To list the property:
svn proplist -v path/of/file
To delete the property:
svn propdel <your_property> path/to/file
# To Restart:
pkill svn; ps aux | grep -i svnserve | grep -v grep ; svnserve -d -r /home/svn/repos; ps aux | grep -i svnserve | grep -v grep
# SVN Error:
svn: E165001: Commit blocked by pre-commit hook (exit code 255) with no output.
http://stackoverflow.com/questions/11016458/commit-blocked-by-pre-commit-hook-svn
There are two different types of pre-commit hooks:
- Server side: This is the standard Unix pre-commit hook. The hook itself lives inside the repository
hooksdirectory. If the hook is not executable, or there is no hook script calledpre-committhe hook does not run. - TortoiseSVN Client Side Hooks: The hook is on the client and is specific to TortoiseSVN.
http://stackoverflow.com/questions/tagged/svn
-Amit Kumar Mund
Friday, 19 July 2013
How to migrate JIRA
- Find current running jira version information:
- Example: The current running is: jira standard 3.12 standalone version.
- you can download the same from there official site: atlassian-jira-standard-3.12-standalone.zip
- Example: The current running is: jira standard 3.12 standalone version.
Steps:
- Download the jira standard 3.12 standalone version from there official site.
- Login to the new server.
- Create a user account [ sudo useradd -d /home/svn svn ] [ given "svn" because most of the time the jira and svn repo runs at the same time ]
- Create the home directory [ sudo mkdir /home/svn ]
- Update the permission of the new home directory [ sudo chmod svn:svn /home/svn ]
- Create a password for the user [ sudo passwd svn ]
- Login as new jira user on the new server [ over here I have created svn, so login as svn. ]
- Download the jira zip file to the new server.
- Keep the jira zip file under /home/svn directory.
- Extract the jira zip file.
- Renamed the jira-xxx directory as "jira"
- Make sure all the is owned by the user, if not [ sudo chown -R svn.svn jira ]
Config Jira After completing the above steps
- Go to jira/bin directory and update the proper file permission. [ chmod +x /home/svn/jira/bin/*.sh ]
- NOTE as we are importing the data and indexes so we need a higher java mem.
- In the following I have updated the java memory size min to 512m and max to 1024m
~/jira/bin$ cat setenv.sh JAVA_OPTS="-Xms512m -Xmx1024m $JAVA_OPTS -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true "
From current JIRA server
- Go to the current server running JIRA server UI
- Log in as Administrator user.
- Take the backup.
- Ask users to stop using JIRA.
- Stop JIRA service from the current running server.
- upload the new backup_file [ that you did by login as Admin ] and the indexes file from the current running server to the new running server.
- NOTE: Good to upload these file under the new jira home directory. [ /home/jira/svn/ImportFromRunningJiraServer ]
What to do in the new JIRA server
- Login to the new JIRA server as the new user.
- Start the jira server [./home/svn/jira/bin/startup.sh ] [ To stop the service if needed is ~/jira/bin/shutdown.sh ]
- Open the new jira ui in the browser. [ usually http://<new_server_ip>:8080/ ]
- Select the option on restoring from backup option.
- In this page there 2 options that you have to fill.
- Provide the Absolute path of the back-file and index file that you have uploaded to the new server.
- It will take some of your time, and once you are done.
- Open the url again and do the check now.
Not yet done
- In the above steps the jira will be up but, it use the in-memory database, which is not good, so we have to configure jira for exernal db.
You are using HSQL DB, which is an in-memory database and susceptible to corruption when abnormally terminated. DO NOT USE THIS IN A PRODUCTION SYSTEM. Instead we recommend using an external database, for a list of supported databases please see our documentation
~/jira/database$ head jiradb.script
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE JIRAACTION(ID BIGINT NOT NULL,ISSUEID BIGINT,AUTHOR VARCHAR,ACTIONTYPE VARCHAR,ACTIONLEVEL VARCHAR,ROLELEVEL BIGINT,ACTIONBODY VARCHAR,CREATED TIMESTAMP,UPDATEAUTHOR VARCHAR,UPDATED TIMESTAMP,ACTIONNUM BIGINT,CONSTRAINT PK_JIRAACTION PRIMARY KEY(ID))
<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false">
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
username="jirauser"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>"
maxActive="20" />
Configuring mysql for jira
- Copy the mysql database and jiradb from the current running server and update the same to the new jira server
- Is coping mysql database is needed? Not really, you can just create a user and grant the user the jira db access.
- Is the jira db migration is needed? yes. Because its having all the details.
- Check for the mysql jdbc driver so that the jira application should be able to connect.
- sudo apt-get install libmysql-java [ If the jdbc is not there ]
- Note the above package install the driver but, not at the location where jira look for the driver.
- So, create a sym link of the same to the correct path where jira look for the driver.
- Original driver location [ can be found by using: sudo dpkg --listfiles libmysql-java ]
- In this case which is /usr/share/java/mysql-connector-java-5.1.10.jar
- And create a sym link [ at jira looking place] in this case: /home/svn/jira/common/lib ]
Configuring the server.xml
- you can see a database directory [ under jira ] which will be having the details about the in-memory db, so I just renamed it.. making sure that jira can not use it.
- Update the server.xml file [ ~/jira/conf ] with the db access details. [ In this case as following ]
username="jirauser"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/<jiraDB>?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>"
- Make sure you have the correct username at the db and that user have the correct grant for the the db.
- as per the above example, the user is connecting using the mysql.jdbc dirver located at [ ~/jira/common/lib ] to a local database.
- After this I found the following error:
Database type is invalid. entityengine.xml is configured for 'hsql', but the database is indicating 'MySQL' with the driver 'MySQL-AB JDBC Driver'. Please ensure entityengine.xml is correct.
- So, you have to fix entiyengine.xml: [~/jira/atlassian-jira/WEB-INF/classes/entityengine.xml ]
Following will be default entry [ line number around 100 ] > <datasource name="defaultDS" field-type-name="hsql" > schema-name="PUBLIC" That you have to update as following: < <datasource name="defaultDS" field-type-name="mysql" which is: [ field-type-name= <from hsql> to <mysql> and delete/comment schema-name
What else
- I check the catalina.out log file [ ~/jira/logs ] and found the following error, and that was again causing jira giving 404 error.
- As per the above log it was looking for 2 more directory that was missing, so I created that.
- 1. ~/jira/attachments [ attachments directory ] [ NOTE: do everything as the user that you have created for jira, e,g. here as svn ]
- 2. ~/jira/backups [ backups directory ]
- [ check for the log again to find further issue. e.g. mail services. ]
- After this I have restarted the jira service and found it is working. ]
The new version don't have configurable index folder or file path. Old version used to have this. and by default the indexing is disabled on the database and that need to be enabled. It need to be enabled:
Following are the steps:
$ sudo su -
$ cd /jiraHome/jira/bin
$ ./shutdown.sh
$ mysql -u root -p
mysql>
select * from propertynumber where id in (select id from propertyentry
where property_key = 'jira.path.index.use.default. directory' or property_key = 'jira.option.indexing');
mysql> update propertynumber set propertyvalue = 1
where id in (select id from propertyentry where property_key =
'jira.path.index.use.default. directory' or property_key = 'jira.option.indexing');
Login to Jira using admin credntial
goto administration link or tab
then indexing in left menu add index
Tuesday, 16 July 2013
AWS_ec2_InstanceData
Notes on how to get ec2 host's information from the command line and not getting into the aws console:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
I believe few of the following informations you might need handy: [ that you can create a small bash script and put that in your command path [ e.g. /bin/ as hostinfo.sh ]
echo "ami-id: "; curl http://169.254.169.254/latest/meta-data/ami-id/; echo -e "\n"
echo "hostname: "; curl http://169.254.169.254/latest/meta-data/hostname/; echo -e "\n"
echo "instance-type: "; curl http://169.254.169.254/latest/meta-data/instance-type/; echo -e "\n"
echo "local-hostname: "; curl http://169.254.169.254/latest/meta-data/local-hostname/; echo -e "\n"
echo "local-ipv4: "; curl http://169.254.169.254/latest/meta-data/local-ipv4/; echo -e "\n"
echo "mac: "; curl http://169.254.169.254/latest/meta-data/mac/; echo -e "\n"
echo "zone: "; curl http://169.254.169.254/latest/meta-data/placement/availability-zone/; echo -e "\n"
echo "public-hostname: "; curl http://169.254.169.254/latest/meta-data/public-hostname/; echo -e "\n"
echo "public-ipv4: "; curl http://169.254.169.254/latest/meta-data/public-ipv4/; echo -e "\n"
echo "public-keys: "; curl http://169.254.169.254/latest/meta-data/public-keys/; echo -e "\n"
echo "security-group: "; curl http://169.254.169.254/latest/meta-data/security-groups/; echo -e "\n"
Make sure, you grant this scripts with executable permission.
1. Login to the ec2 instance.
2. curl http://169.254.169.254/latest/meta-data/ [ This will show you all the system's meta-data that can be extracted using the command line:
example:
curl http://169.254.169.254/latest/meta-data/
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-action
instance-id
instance-type
kernel-id
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
public-keys/
reservation-id
Further few of the above meta-data have few more sub values as:
block-device-mapping/ [ Over here you will get ec2 instance's disk information. ]
ami
ephemeral0
root
swap
metrics/
vhostmd [ you will get some output like: <?xml version="1.0" encoding="UTF-8"?> ]
network/
interfaces/
macs/ [ network/interfaces/macs -> you will get the mac info [ same as user-data/mac ]
macs/ [ network/interfaces/macs -> you will get the mac info [ same as user-data/mac ]
placement/
availability-zone [ you will get the host's zone information example: us-east-1 ]
public-keys/
0=key_info
Further information about each of these meta data can be found at the following location:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
http://docs.aws.amazon.com/AWSEC2/2007-03-01/DeveloperGuide/AESDG-chapter-instancedata.html
This use a REST (RESTful) API or a web api to fetch system informations.
Following is a simple curl command to get most of the system details in a single line:
for i in `curl http://169.254.169.254/latest/meta-data/`; do echo ${i}; curl http://169.254.169.254/latest/meta-data/${i}/; echo -e '\n' ; done
I believe few of the following informations you might need handy: [ that you can create a small bash script and put that in your command path [ e.g. /bin/ as hostinfo.sh ]
echo "ami-id: "; curl http://169.254.169.254/latest/meta-data/ami-id/; echo -e "\n"
echo "hostname: "; curl http://169.254.169.254/latest/meta-data/hostname/; echo -e "\n"
echo "instance-type: "; curl http://169.254.169.254/latest/meta-data/instance-type/; echo -e "\n"
echo "local-hostname: "; curl http://169.254.169.254/latest/meta-data/local-hostname/; echo -e "\n"
echo "local-ipv4: "; curl http://169.254.169.254/latest/meta-data/local-ipv4/; echo -e "\n"
echo "mac: "; curl http://169.254.169.254/latest/meta-data/mac/; echo -e "\n"
echo "zone: "; curl http://169.254.169.254/latest/meta-data/placement/availability-zone/; echo -e "\n"
echo "public-hostname: "; curl http://169.254.169.254/latest/meta-data/public-hostname/; echo -e "\n"
echo "public-ipv4: "; curl http://169.254.169.254/latest/meta-data/public-ipv4/; echo -e "\n"
echo "public-keys: "; curl http://169.254.169.254/latest/meta-data/public-keys/; echo -e "\n"
echo "security-group: "; curl http://169.254.169.254/latest/meta-data/security-groups/; echo -e "\n"
vi publicip
curl http://169.254.169.254/latest/meta-data/public-ipv4/; echo -e "\n"Make sure, you grant this scripts with executable permission.
Wednesday, 10 July 2013
MyLinuxNote4
dd if=/dev/zero of=filename bs=1024 count=2 [ This will create a 2MB file.]
iptables -A INPUT -S 192.168.1.50 -p icmp -j DROP
echo "Hello root" | mail -v -s hello root@server1
cat bootdisk.img > /dev/fd0
dd if=bootdisk.img of=/dev/fd0
raid 0 -> striping.
raid 1 -> mirroring.
raid 5 -> striping with parity.
Different TTY output at the time of redhat linux installation:
alt-f1 -> the installer program in text mode
alt-f2 -> a bash shell
alt-f3 -> a log of installer messages
alt-f4 -> a log of kernel messages
alt-f5 -> stdout from mke2fs and grub command
alt-f7 -> The installer program in graphical mode
iptables -A INPUT -S 192.168.1.50 -p icmp -j DROP
echo "Hello root" | mail -v -s hello root@server1
cat bootdisk.img > /dev/fd0
dd if=bootdisk.img of=/dev/fd0
raid 0 -> striping.
raid 1 -> mirroring.
raid 5 -> striping with parity.
Different TTY output at the time of redhat linux installation:
alt-f1 -> the installer program in text mode
alt-f2 -> a bash shell
alt-f3 -> a log of installer messages
alt-f4 -> a log of kernel messages
alt-f5 -> stdout from mke2fs and grub command
alt-f7 -> The installer program in graphical mode
MyLinuxNote3 [ rpm ]
rpm:
path: - /usr/src/redhat/rpms
rpmbuild --rebuild filename.src.rpm
. /configure
make
make check
make install
rpm -q pkgName.rpm
rpm -ivh pkgName.rpm
rpm -uvh pkgName.rpm
rpm -ivh --replacefiles pkgName.rpm
rpm -q --redhatprovides bar.so.2
rpm -ivh <pkgName> --nodeps
rpm -3 foo
rpm -uvh --oldpackage pkgName.rpm
rpm -Fvh pkgName.rpm
rpm -q foo
rpm -qa
rpm -qf /bin/ls
rpm -ql foo
rpm -vf /usr/bin/foo
rpm -Va
rpm -Vp pkgName.rpm
rpm -qdf /usr/bin/free
rpm -qlp pkgName.rpm
man rpm
path: - /usr/src/redhat/rpms
rpmbuild --rebuild filename.src.rpm
. /configure
make
make check
make install
rpm -q pkgName.rpm
rpm -ivh pkgName.rpm
rpm -uvh pkgName.rpm
rpm -ivh --replacefiles pkgName.rpm
rpm -q --redhatprovides bar.so.2
rpm -ivh <pkgName> --nodeps
rpm -3 foo
rpm -uvh --oldpackage pkgName.rpm
rpm -Fvh pkgName.rpm
rpm -q foo
rpm -qa
rpm -qf /bin/ls
rpm -ql foo
rpm -vf /usr/bin/foo
rpm -Va
rpm -Vp pkgName.rpm
rpm -qdf /usr/bin/free
rpm -qlp pkgName.rpm
man rpm
MyLinuxNote2 [ Basic of Network layers ]
The Sever OSI layers:
1. Physical
2. Link
3. Network
4. Transport
5. Session
6. Presentation
7. Application
List of protocols OSI models:
IMP: http://en.wikipedia.org/wiki/List_of_network_protocols_%28OSI_model%29
Private IP Address:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
-> Local host IP Address: 127.0.0.1 [ Also known as loopback IP address]
IP Class:
A-> 00000000 -> 01111111 ( 0 - 127 ) but as 127. is used for loopback its ( 0 - 126 )
B -> 10000000 -> 10111111 (128 - 191)
C ->11000000 -> 11011111 (192 - 223)
D ->11100000 -> 11101111 (224 - 239)
E -> 11110000 -> 11110111 (240 - 247)
NOTE:
-> Go to network 10.0.0.0 255.0.0.0 via router R1
-> Go to everything else via Router R2
-> R2, therefor would be considered your default gateway.
man -k ssh
man ifconfig
ifconfig -a
*) # ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up
[ To make this permanent each time you boot up, add this above command in "/etc/rc.local". ]
*) /etc/sysconfig/network-scripts/ifcfg-eth0
if static: -
DEVICE = eth0
IPADDR = 192.168.1.100
NETMASK = 255.255.255.0
BOOTPROTO = static
ONBOOT = yes
if dhcp: -
DEVICE = eth0
BOOTPROTO = dhcp
ONBOOT = yes
*) ifdown eth0
*) ifup eth0
*) Assigning more then 1 IP to an interface:
ifconfig eth0:0 192.168.1.99 netmask 255.255.255.0 up
(or)
vi /etc/sysconfig/network-scripts/ifconfig-eth0:0
*) For range of ipaddress:-
*) netstat -nr [ Current routing table ]
*) route
*) Network with a gateway 0.0.0.0 are usually directly connected to the interface.
*) The router with a destination address of 0.0.0.0 is your default gateway.
*) # route add default gw 192.168.1.1 eth0
*) # vi /etc/sysconfig/network
NETWORKING = yes
HOSTNAME = amit
GATEWAY = 192.168.1.1
*) Configuring two gateways: - ( scenario)
S1. You have one router providing access to the internet that you would like to have a default gateway:
# route add default gw 192.168.1.1 eth0
S2. You have another router providing access to your corporate network using addresses range 10.0.0.0 to 10.255.255.255 . Let's assume that this router has an IP address of 192.168.1.254
# route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254 eth0
S3. If only for an individual server, then: -
# route add -host 10.0.0.1 gw 192.168.1.254 eth0
*) man route
*) for keeping the settings: ( add the commands in "/etc/rc.d/rc.local" )
Adding permanent static routs:
vi /etc/sysconfig/network-scripts/route-eth0
10.0.0.0/8 via 192.168.1.254
# The filename need to be: - " route-interfaceName "
*) Test: -
. /etc/sysconfig/network-scripts/ifup-routes route-eth0
ifup-route [ which should adds the route ]
*) route del -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254 eth0
packet forwarding: -
-> /etc/sysctl.conf : [ net.ipv4.ip_forward=1 ]
sysctl -p [ This command will reload the /etc/sysctl.conf file. ]
*) Some files and commands to look:
/etc/hosts
mii-tool eth0
ethtool eth0
netstat -i
arp -a
service iptables status
tracerouter -I <IP address>
tcpdump -i eth0 icmp
tcpdump -i eth0 -t host 192.168.1.102 and tcp port 22
nslookup <hostname/ipaddress> <dns server>
nmap -sT -T 5 -P 1-5000 192.168.1.153
nc -l 7777
nc <ServerIP> <server tcp port> -> nc 127.0.0.1 7777
last
who
whoami
tail -f /var/log/messages > /dev/tty9
1. Physical
2. Link
3. Network
4. Transport
5. Session
6. Presentation
7. Application
List of protocols OSI models:
IMP: http://en.wikipedia.org/wiki/List_of_network_protocols_%28OSI_model%29
Private IP Address:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
-> Local host IP Address: 127.0.0.1 [ Also known as loopback IP address]
IP Class:
A-> 00000000 -> 01111111 ( 0 - 127 ) but as 127. is used for loopback its ( 0 - 126 )
B -> 10000000 -> 10111111 (128 - 191)
C ->11000000 -> 11011111 (192 - 223)
D ->11100000 -> 11101111 (224 - 239)
E -> 11110000 -> 11110111 (240 - 247)
NOTE:
-> Go to network 10.0.0.0 255.0.0.0 via router R1
-> Go to everything else via Router R2
-> R2, therefor would be considered your default gateway.
man -k ssh
man ifconfig
ifconfig -a
*) # ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up
[ To make this permanent each time you boot up, add this above command in "/etc/rc.local". ]
*) /etc/sysconfig/network-scripts/ifcfg-eth0
if static: -
DEVICE = eth0
IPADDR = 192.168.1.100
NETMASK = 255.255.255.0
BOOTPROTO = static
ONBOOT = yes
if dhcp: -
DEVICE = eth0
BOOTPROTO = dhcp
ONBOOT = yes
*) ifdown eth0
*) ifup eth0
*) Assigning more then 1 IP to an interface:
ifconfig eth0:0 192.168.1.99 netmask 255.255.255.0 up
(or)
vi /etc/sysconfig/network-scripts/ifconfig-eth0:0
*) For range of ipaddress:-
*) netstat -nr [ Current routing table ]
*) route
*) Network with a gateway 0.0.0.0 are usually directly connected to the interface.
*) The router with a destination address of 0.0.0.0 is your default gateway.
*) # route add default gw 192.168.1.1 eth0
*) # vi /etc/sysconfig/network
NETWORKING = yes
HOSTNAME = amit
GATEWAY = 192.168.1.1
*) Configuring two gateways: - ( scenario)
S1. You have one router providing access to the internet that you would like to have a default gateway:
# route add default gw 192.168.1.1 eth0
S2. You have another router providing access to your corporate network using addresses range 10.0.0.0 to 10.255.255.255 . Let's assume that this router has an IP address of 192.168.1.254
# route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254 eth0
S3. If only for an individual server, then: -
# route add -host 10.0.0.1 gw 192.168.1.254 eth0
*) man route
*) for keeping the settings: ( add the commands in "/etc/rc.d/rc.local" )
Adding permanent static routs:
vi /etc/sysconfig/network-scripts/route-eth0
10.0.0.0/8 via 192.168.1.254
# The filename need to be: - " route-interfaceName "
*) Test: -
. /etc/sysconfig/network-scripts/ifup-routes route-eth0
ifup-route [ which should adds the route ]
*) route del -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254 eth0
packet forwarding: -
-> /etc/sysctl.conf : [ net.ipv4.ip_forward=1 ]
sysctl -p [ This command will reload the /etc/sysctl.conf file. ]
*) Some files and commands to look:
/etc/hosts
mii-tool eth0
ethtool eth0
netstat -i
arp -a
service iptables status
tracerouter -I <IP address>
tcpdump -i eth0 icmp
tcpdump -i eth0 -t host 192.168.1.102 and tcp port 22
nslookup <hostname/ipaddress> <dns server>
nmap -sT -T 5 -P 1-5000 192.168.1.153
nc -l 7777
nc <ServerIP> <server tcp port> -> nc 127.0.0.1 7777
last
who
whoami
tail -f /var/log/messages > /dev/tty9
Subscribe to:
Posts (Atom)