ubuntu 14.04 Java SE Development Kit 8
Java SE Development Kit 8u102
This command will completely remove OpenJDK/JRE from your system
sudo apt-get purge openjdk-\*
This command will create a directory to hold your Oracle Java JDK and JRE binaries.
sudo mkdir -p /usr/local/java
Download
the Oracle Java JDK/JRE for Linux. Make sure you select the correct
compressed binaries for your system architecture 32-bit or 64-bit (which
end in tar.gz).
Select
Linux x64 172.95 MB jdk-8u102-linux-x64.tar.gz
Copy the Oracle Java binaries into the /usr/local/java directory.
sudo cp -r jdk-8u102-linux-x64.tar.gz /usr/local/java
Unpack the compressed Java binaries, in the directory /usr/local/java
sudo tar xvzf jdk-8u102-linux-x64.tar.gz
Edit the system PATH file /etc/profile and add the following system variables to your system path
Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.8.0_102
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Inform your Ubuntu Linux system where your Oracle Java JDK/JRE is located.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_102/jre/bin/java" 1
Only if you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_102/bin/javac" 1
Inform your Ubuntu Linux system that Oracle Java JDK/JRE must be the default Java.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set java /usr/local/java/jdk1.8.0_102/jre/bin/java
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_102/bin/javaws
test jdk installation
http://www.javatester.org
java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
64-bit Oracle Java instructions
To
enable your Java plug-in in your web browsers you must make a symbolic
link from the web browsers plug-in directory to the location of the Java
plug-in included in your distribution of Oracle Java.
cd /usr/lib/firefox-addons/plugins/
sudo ln -s /usr/local/java/jdk1.8.0_102/jre/lib/amd64/libnpjp2.so
oracle java control panel to add website in exception list
/usr/local/java/jdk1.8.0_102/bin/ControlPanel
Wednesday, February 28, 2018
how to install docker Ubuntu Xenial 16.04 (LTS)
install Docker Community Edition (Docker CE) on Ubuntu Xenial 16.04 (LTS)
To install Docker CE, you need the 64-bit version
Uninstall old versions
sudo apt-get remove docker docker-engine docker.io
The contents of /var/lib/docker/
The Docker CE package is now called docker-ce.
Some users download the DEB package
Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.
Some users download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
In testing and development environments, some users choose to use automated convenience scripts to install Docker.
Update the apt package index
$sudo apt-get update
$sudo apt-get install apt-transport-https
$sudo apt-get install ca-certificates
$sudo apt-get install curl
$sudo apt-get install software-properties-common
Add Docker’s official GPG key
$curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify key
$sudo apt-key fingerprint 0EBFCD88
set up the stable repository
$sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the apt package index
$sudo apt-get update
Install the latest version of Docker CE
$sudo apt-get install docker-ce
$docker version
OS requirements
To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:
Zesty 17.04
Xenial 16.04 (LTS)
Trusty 14.04 (LTS)
Verify old versions are removed.
$sudo apt-get remove docker docker-engine docker.io
To install Docker CE, you need the 64-bit version
Uninstall old versions
sudo apt-get remove docker docker-engine docker.io
The contents of /var/lib/docker/
The Docker CE package is now called docker-ce.
Some users download the DEB package
Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.
Some users download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
In testing and development environments, some users choose to use automated convenience scripts to install Docker.
Update the apt package index
$sudo apt-get update
Requirements
$sudo apt-get install ca-certificates
$sudo apt-get install curl
$sudo apt-get install software-properties-common
Add Docker’s official GPG key
$curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify key
$sudo apt-key fingerprint 0EBFCD88
set up the stable repository
$sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the apt package index
$sudo apt-get update
Install the latest version of Docker CE
$sudo apt-get install docker-ce
$docker version
OS requirements
To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:
Zesty 17.04
Xenial 16.04 (LTS)
Trusty 14.04 (LTS)
Verify old versions are removed.
$sudo apt-get remove docker docker-engine docker.io
how to install Java SE Development Kit 8 ubuntu 15.10
ubuntu 14.04 Java SE Development Kit 8
Java SE Development Kit 8u102
This command will completely remove OpenJDK/JRE from your system
sudo apt-get purge openjdk-\*
This command will create a directory to hold your Oracle Java JDK and JRE binaries.
sudo mkdir -p /usr/local/java
Download the Oracle Java JDK/JRE for Linux. Make sure you select the correct compressed binaries for your system architecture 32-bit or 64-bit (which end in tar.gz).
Select
Linux x64 172.95 MB jdk-8u102-linux-x64.tar.gz
Copy the Oracle Java binaries into the /usr/local/java directory.
sudo cp -r jdk-8u102-linux-x64.tar.gz /usr/local/java
Unpack the compressed Java binaries, in the directory /usr/local/java
sudo tar xvzf jdk-8u102-linux-x64.tar.gz
Edit the system PATH file /etc/profile and add the following system variables to your system path
Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.8.0_102
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Inform your Ubuntu Linux system where your Oracle Java JDK/JRE is located.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_102/jre/bin/java" 1
Only if you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_102/bin/javac" 1
Inform your Ubuntu Linux system that Oracle Java JDK/JRE must be the default Java.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set java /usr/local/java/jdk1.8.0_102/jre/bin/java
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_102/bin/javaws
test jdk installation
http://www.javatester.org
java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
64-bit Oracle Java instructions
To enable your Java plug-in in your web browsers you must make a symbolic link from the web browsers plug-in directory to the location of the Java plug-in included in your distribution of Oracle Java.
cd /usr/lib/firefox-addons/plugins/
sudo ln -s /usr/local/java/jdk1.8.0_102/jre/lib/amd64/libnpjp2.so
oracle java control panel to add website in exception list
/usr/local/java/jdk1.8.0_102/bin/ControlPanel
Java SE Development Kit 8u102
This command will completely remove OpenJDK/JRE from your system
sudo apt-get purge openjdk-\*
This command will create a directory to hold your Oracle Java JDK and JRE binaries.
sudo mkdir -p /usr/local/java
Download the Oracle Java JDK/JRE for Linux. Make sure you select the correct compressed binaries for your system architecture 32-bit or 64-bit (which end in tar.gz).
Select
Linux x64 172.95 MB jdk-8u102-linux-x64.tar.gz
Copy the Oracle Java binaries into the /usr/local/java directory.
sudo cp -r jdk-8u102-linux-x64.tar.gz /usr/local/java
Unpack the compressed Java binaries, in the directory /usr/local/java
sudo tar xvzf jdk-8u102-linux-x64.tar.gz
Edit the system PATH file /etc/profile and add the following system variables to your system path
Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.8.0_102
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Inform your Ubuntu Linux system where your Oracle Java JDK/JRE is located.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_102/jre/bin/java" 1
Only if you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_102/bin/javac" 1
Inform your Ubuntu Linux system that Oracle Java JDK/JRE must be the default Java.
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set java /usr/local/java/jdk1.8.0_102/jre/bin/java
If you are installing the JDK then Type/Copy/Paste:
sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_102/bin/javaws
test jdk installation
http://www.javatester.org
java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
64-bit Oracle Java instructions
To enable your Java plug-in in your web browsers you must make a symbolic link from the web browsers plug-in directory to the location of the Java plug-in included in your distribution of Oracle Java.
cd /usr/lib/firefox-addons/plugins/
sudo ln -s /usr/local/java/jdk1.8.0_102/jre/lib/amd64/libnpjp2.so
oracle java control panel to add website in exception list
/usr/local/java/jdk1.8.0_102/bin/ControlPanel
how to reset root password
- How to reset ESXi 5.x root password
https://www.youtube.com/watch?v=Nehxe8j9lgg
- Ubuntu 12.04, 14.04, 15.10 - Forgot Login Password? Change/Create New One.
https://www.youtube.com/watch?v=qGpvCZO2oOc
- Changing a forgotten root password on an ESX/ESXi host (1317898)
This article provides steps to reset a lost or forgotten root password of an ESX/ESXi host.If you have forgotten or do not know the password for the root user on an ESX host, you may be able to change it without reinstalling.Reinstalling the ESXi host is the only supported way to reset a password on ESXi.ESXi does not have a service console and as such traditional Linux methods of resetting a password, such as single-user mode.
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1317898
- Alternate Root Shell Method
All it takes is adjusting the boot parameters slightly and typing a command or two,
http://www.howtogeek.com/howto/linux/reset-your-forgotten-ubuntu-password-in-2-minutes-or-less
- Linux İşletim Sistemlerinde “root” Parolası Sıfırlama Yapılandırması
http://www.koraykey.com/?p=4988
holla el mundo ruby script
@ubuntu:~/ruby_scripts$ vi a.rb
#!/usr/bin/env ruby
puts "holla el mundo"
# the very first ruby script
@ubuntu:~/ruby_scripts$ ruby a.rb
holla el mundo
#!/usr/bin/env ruby
puts "holla el mundo"
# the very first ruby script
@ubuntu:~/ruby_scripts$ ruby a.rb
holla el mundo
how to ubuntu 12.04 desktop on vmplayer 5.x
- Root User Problem
By default, the Root account password is locked in Ubuntu.
This means that you cannot login as Root directly or use the su command to become the Root user.
since the Root account physically exists it is still possible to run programs with root-level privileges.
This is where sudo comes in - it allows authorized users (normally
"Administrative" users) to run certain programs as Root without having
to know the root password.
This means that in the terminal you should use sudo for commands that
require root privileges; simply prepend sudo to all the commands you
would normally run as Root
- Enable Disable Root account
To enable the Root account (i.e. set a password) use:
sudo passwd root
Re-disabling your root account
sudo passwd -dl root
- To download packages , use aptitude
sudo aptitude install g++
https://help.ubuntu.com/community/RootSudo
- how to convert .deb to .rpm package
- to install .deb package
- to list installed packages
- to install source package
gunzip mysql-5.5.27-linux2.6-i686.tar.gz
tar xfv mysql-5.5.27-linux2.6-i686.tar
- to install mysql server
sudo aptitude install mysql-server
sudo aptitude install mysql-workbench
- to enable shared folder on windows 7 host
Virtual Machine settings
Folder sharing = Always Enabled
you can list shared folder under /mnt/hgfs/ directory
how to install python on ubuntu 12.04
- download source code from www.python.org
Python-2.7.3.tgz
./configure
make
sudo make altinstall
it's installed under directories below
/usr/local/bin/
/usr/bin/
on the terminal type "python"
yeniceri@ubuntu:~/Desktop/Python-2.7.3$ python
Python 2.7.3 (default, Aug 30 2012, 05:57:53)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Use quit() or Ctrl-D (i.e. EOF) to exit
first hello world code, child is born
>>> print "holla el mundo"
holla el mundo
how to install ansible centos7
Ansible on centos7
Step 1 — Installing Ansible
sudo yum install epel-release
sudo yum install ansible
Step 2 — Configuring Ansible Hosts
sudo vi /etc/ansible/hosts
by default, try to connect to remote hosts using current username.
If that user doesn't exist on the remote system
connect to servers in the "servers" group with the sammy user
sudo mkdir /etc/ansible/group_vars
create YAML-formatted files for each group
sudo nano /etc/ansible/group_vars/servers
specify configuration details for every server
/etc/ansible/group_vars/all.
Individual hosts
/etc/ansible/host_vars.
Ping all of the servers
ansible -m ping all
ansible -m ping host1
ansible -m ping host1:host2
memory usage on our host1 machine
ansible -m shell -a 'free -m' host1
Usage: ansible <host-pattern> [options]
-m MODULE_NAME, --module-name=MODULE_NAME
Step 1 — Installing Ansible
sudo yum install epel-release
sudo yum install ansible
Step 2 — Configuring Ansible Hosts
sudo vi /etc/ansible/hosts
by default, try to connect to remote hosts using current username.
If that user doesn't exist on the remote system
connect to servers in the "servers" group with the sammy user
sudo mkdir /etc/ansible/group_vars
create YAML-formatted files for each group
sudo nano /etc/ansible/group_vars/servers
specify configuration details for every server
/etc/ansible/group_vars/all.
Individual hosts
/etc/ansible/host_vars.
Ping all of the servers
ansible -m ping all
ansible -m ping host1
ansible -m ping host1:host2
memory usage on our host1 machine
ansible -m shell -a 'free -m' host1
Usage: ansible <host-pattern> [options]
-m MODULE_NAME, --module-name=MODULE_NAME
Tuesday, February 20, 2018
how to install docker centos7
$sudo yum check-update
$curl -fsSL https://get.docker.com/ | sh
$ sudo usermod -aG docker myuser
logout/login
$ docker version
Client:
Version: 18.02.0-ce
API version: 1.36
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:14:12 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
$curl -fsSL https://get.docker.com/ | sh
$ sudo usermod -aG docker myuser
logout/login
$ docker version
Client:
Version: 18.02.0-ce
API version: 1.36
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:14:12 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Wednesday, February 14, 2018
ansible vagrant on WSL
Assuming you already have Windows Subsystem for Linux(WSL) running on your host machine.
edition:windows 10 enterprise
version:1709
OS Build:16299.192
sudo apt-get update
sudo apt-get install python-pip git libffi-dev libssl-dev -y
sudo apt-get -f install
sudo apt-get install python-pip git libffi-dev libssl-dev -y
pip install ansible pywinr
Problem:
Collecting pywinr
Could not find a version that satisfies the requirement pywinr (from versions: )
No matching distribution found for pywinr
cd /mnt/e/PURR/gluster_lab2/
touch test.yml
nano test.yml
ansible-playbook test.yml --connection=local
git clone https://github.com/githubfoam/ansible-vagrant-examples.git
sudo vagrant validate Vagrantfile
$ sudo vagrant up
No usable default provider could be found for your system.
Problem:
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
http://docs.ansible.com/ansible/latest/intro_windows.html
https://www.jeffgeerling.com/blog/2017/using-ansible-through-windows-10s-subsystem-linux
version:1709
OS Build:16299.192
sudo apt-get update
sudo apt-get install python-pip git libffi-dev libssl-dev -y
sudo apt-get -f install
sudo apt-get install python-pip git libffi-dev libssl-dev -y
pip install ansible pywinr
Problem:
Collecting pywinr
Could not find a version that satisfies the requirement pywinr (from versions: )
No matching distribution found for pywinr
cd /mnt/e/PURR/gluster_lab2/
touch test.yml
nano test.yml
ansible-playbook test.yml --connection=local
git clone https://github.com/githubfoam/ansible-vagrant-examples.git
sudo vagrant validate Vagrantfile
$ sudo vagrant up
No usable default provider could be found for your system.
Problem:
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
http://docs.ansible.com/ansible/latest/intro_windows.html
https://www.jeffgeerling.com/blog/2017/using-ansible-through-windows-10s-subsystem-linux
Monday, February 12, 2018
how to download freebsd source via svn
Install subversion
# make install
check out FreeBSD Source
if you want patches since release, you are likely wanting to do Release Engineering
Release
svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Release Engineering
svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Stable
# svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Currrent
# svn checkout http://svn.freebsd.org/base/head /usr/src
https://www.rhyous.com/2009/12/25/how-to-download-freebsd-source-using-svn/
https://www.freebsd.org/releng/index.html
- From ports
# make install
- From packages
check out FreeBSD Source
if you want patches since release, you are likely wanting to do Release Engineering
Release
svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Release Engineering
svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Stable
# svn checkout http://svn.freebsd.org/base/release/11.1.0/ /usr/src
Currrent
# svn checkout http://svn.freebsd.org/base/head /usr/src
https://www.rhyous.com/2009/12/25/how-to-download-freebsd-source-using-svn/
- This page contains documentation about the FreeBSD release engineering process.
https://www.freebsd.org/releng/index.html
how to ruby on rails on ubuntu 12.04
- update your package repository.
sudo apt-get update
git is a simple, fast and efficient version control system
sudo apt-get install git
Curl is a simple command line utility for getting file over web protocols, based on libcurl.
sudo apt-get install curl
RVM is not strictly required
VM requires the command to be executed as login shell, so open a terminal and go to Edit -> Profile Preferences -> Title and Command and check the box that says “Run Command as a login shell“
download rvm
curl -L get.rvm.io | bash -s stable
http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts
How to Install Zabbix Server 3.0 LTS on Ubuntu 15.10
Prerequisites
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 php5-cli php5-common php5-mysql
Update Timezone in PHP Configuration
sudo nano /etc/php5/apache2/php.ini
;[Date]
date.timezone = 'Asia/Kolkata'
Adding Apt Repository
sudo wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb
sudo dpkg -i zabbix-release_3.0-1+trusty_all.deb
sudo apt-get update
Install Zabbix Server
sudo apt-get install zabbix-server-mysql zabbix-frontend-php
Create Database Schema
mysql -u root -p
CREATE DATABASE zabbixdb;
GRANT ALL on zabbixdb.* to zabbix@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
quit
Import zabbix database schema in newly created database
cd /usr/share/doc/zabbix-server-mysql
sudo gunzip create.sql.gz
sudo mysql -u root -p zabbixdb < create.sql
Edit zabbix server configuration file and update following entries.
sudo nano /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbixdb
DBUser=zabbix
DBPassword=password
Restart Apache and Zabbix
sudo service apache2 restart
sudo service zabbix-server restart
Zabbix Web Installer
http://localhost/zabbix/
Login to Zabbix
Username: admin
Password: zabbix
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 php5-cli php5-common php5-mysql
Update Timezone in PHP Configuration
sudo nano /etc/php5/apache2/php.ini
;[Date]
date.timezone = 'Asia/Kolkata'
Adding Apt Repository
sudo wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb
sudo dpkg -i zabbix-release_3.0-1+trusty_all.deb
sudo apt-get update
Install Zabbix Server
sudo apt-get install zabbix-server-mysql zabbix-frontend-php
Create Database Schema
mysql -u root -p
CREATE DATABASE zabbixdb;
GRANT ALL on zabbixdb.* to zabbix@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
quit
Import zabbix database schema in newly created database
cd /usr/share/doc/zabbix-server-mysql
sudo gunzip create.sql.gz
sudo mysql -u root -p zabbixdb < create.sql
Edit zabbix server configuration file and update following entries.
sudo nano /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbixdb
DBUser=zabbix
DBPassword=password
Restart Apache and Zabbix
sudo service apache2 restart
sudo service zabbix-server restart
Zabbix Web Installer
http://localhost/zabbix/
Login to Zabbix
Username: admin
Password: zabbix
- How to enable SNMP on Windows 8
Linux Administrator Daily Tasks
- ------------------------------------------Filesystem------------------------------------------
# mount -o loop,offset=$((10860003 * 512)) disk.img /mnt
blkid
lsblk -f
mount -l
lshw -short
file -Ls
dmesg
format a USB storage device with FAT32 file system
mkfs –t vfat <USB-device-mount-point>
find out the USB device mount point
fdisk -l
mkfs.ext4 <USB-device-mount-point>
mkfs.ntfs <USB-device-mount-point>
unmount the drive,you can’t format a mounted drive.
fdisk -l
sudo umount /dev/sdb1
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ntfs /dev/sdb1
man mkfs.ntfs
man mkfs.vfat
Set label name to USB drives
sudo mkfs.vfat /dev/sdb1 -n sk
- ------------------------------------------System------------------------------------------
denyhosts
top
top -u sunsail
vmstat
w
uptime
ps
free
iostat
mpstat
pmap
cat /proc/cpuinfo
cat /proc/meminfo
cat /proc/zoneinfo
cat /proc/mounts
cat /etc/issue
uname -r
paste
lsblk -l
uname
history
sudo
mkdir
touch
chmod
chown
tar
date
ptree
pkill
killall
view the amount of free disk space
df –h
list files sorted by size
ls –lSr
see how much space /some/dir is consuming
du -sh /some/dir
List all running processes containing the string stuff
ps aux | grep stuff
extracting entire archive
tar -zxvf backup.tar.gz
extract .xz file
unxz tor-browser-linux32-5.5.4_en-US.tar.xz
tar xvf tor-browser-linux32-5.5.4_en-US.tar
extract .bz2 file
bzip2 -dk FileZilla_3.29.0_x86_64-linux-gnu.tar.bz2
tar xvf FileZilla_3.29.0_x86_64-linux-gnu.tar
linux version
lsb_release -a
cat /etc/issue
cat /etc/os-release
cat /etc/lsb-release
cat /etc/*-release
cat /proc/version
kernel version
uname -r
32x 64x query
uname –m
This displays only the machine hardware name and indicates, as above, whether your system is 32-bit (“i686” or “i386”) or 64-bit (“x86_64”)
The “arch” command is similar to the “uname -m” command and prints to the screen whether your system is 32-bit (“i686”) or 64-bit (“x86_64”)
~$ arch
i686
The “arch” command is similar to the “uname -m” command and prints to the screen whether your system is 32-bit (“i686”) or 64-bit (“x86_64”)
~$ arch
i686
virtual machine check
On Linux
$ dmesg |grep -i hypervisor
$ dmidecode -s system-manufacturer
watch is used to run any designated command at regular intervals.
watch -n 5 "ls -l | wc l"
md5sum ubuntu-6.10-desktop-i386.iso
sha256sum ubuntu-9.10-dvd-i386.iso
Validating the Files On Microsoft Windows GUI
https://wiki.centos.org/TipsAndTricks/sha256sum
iw distinguishes between wireless LAN hardware devices (the physical layer, referred to as phy) and the network interface configured to use that hardware (e.g. wlan0,
similar to an Ethernet eth0 interface). To see the list of devices, and interfaces for each device
iw dev
configure it to start Automatically while system start-up
# chkconfig tgtd on
verify that the run level configured correctly for the tgtd service
# chkconfig --list tgtd
identify processes using files, directories, or sockets
Who is Using a File or Directory
$ fuser .
$ fuser -v ./
Check Processes Using TCP/UDP Sockets
fuser -v -n tcp 5000
the processes that are using my 'home' directory
$ fuser ~
$ fuser ~ -v
check for the root directory
$ fuser /
$ fuser / -v
$ fuser -v /home/ismail
$ fuser -v -m /home/ismail/.bashrc
$ fuser -v -n tcp 8080
$ fuser -v -n udp 53
kill this TCP listener, you can use option -k
fuser -i -k 8080/tcp
shows all processes at the (local) TELNET port
fuser telnet/tcp
list signals
fuser -l
STOP a process
fuser -i -k STOP [FILE/DIRECTORY]
kills all processes accessing the file system /home
fuser -km /hom
- ------------------------------------------Networking------------------------------------------
netstat
iptraf
tcpdump
strace
nmap
list open files
lsof
list open files owned by user
lsof -u user1
list open file via tcp
lsof -i TCP:1-1024
lsof -i TCP:80
PID 27808
lsof -Pan -p 27808 -i
lsof -p 2
ifconfig
ifconfig -a
ifconfig eth0 up
ifconfig eth0 down
ifconfig eth0 192.168.70.131
ifconfig eth0 netmask 255.255.255.0
ifconfig eth0 broadcast 192.168.70.255
list out all connections
ss|less
Filter out tcp,udp or unix connections
ss -t
ss -A tcp
ss -u
ss -x
List all udp connections
ss -ua
ss -a -A udp
ss -nt
ss -ltn
udp
ss -lun
prints out the statistics
ss -s
netstat -a
netstat -at
netstat -s
netstat -au
netstat -l
netstat -lu
netstat -lt
netstat -tulpn ## To output numerical service sockets
netstat -plan
netstat -plan | grep ":80"
-p, --program Show the PID and name of the program to which each socket belongs.
# netstat -anp
Messaging
wall
write
talk
Get the PCI address of the NIC:
# lspci | grep Mellanox
Check what ethernet devices exist currently
# ls -al /sys/class/net
# ls /sys/class/net
look at the last ten lines of /var/log/messages
$ sudo tail /var/log/messages
someone last log in to the system
# lastlog
the system last rebooted
# last reboot
the login history of users
# last | grep sysadmin
temporary set the IP address
ifconfig eth0 192.168.8.185
ifconfig eth0 192.168.8.185 netmask 255.255.255.0 up
temporary change the MAC address
ifconfig eth0 down hw ether AA:BB:CC:DD:EE:FF && ifconfig eth0 up
- **Network Troubleshooting
ping 192.168.0.2 # ping a host
netstat -nr #show routing table without resolving domain names
netstat -ni # show informations about errors/collisions
traceroute www.example.com # find route to example.com
tcpdraceroute www.example.com # find route to example.com using tcptraceroute (which uses tcp to discover path).
netstat -i -I em0 # show statistics about your network card
sockstat -c # show connected sockets
sockstat -l # show listening sockets and processes
arp -na # show arp table
arp -d 192.168.0.2 # delete a record from arp table
arp -s 192.168.0.2 00:10:b5:99:bf:c4 # add a static record in arp table
tcpdump -tlni em0 # listen on em0 network interface and sniff packets that pass via em0
tcpdump -tlni em0 -n icmp # listen for ICMP traffic on em0 network interface
tcpdump -i nfe0 -c1 -n -s0 -vvvv icmp # capture one ICMP packet and decode itvagran
windows administrator daily tasks
- Active Directory
To quickly list all the groups in your domain, with members
dsquery group -limit 0 | dsget group -members –expand
To find all users whose accounts are set to have a non-expiring password
dsquery * domainroot -filter “(&(objectcategory=person)(objectclass=user)(lockoutTime=*))” -limit 0
To list all the FSMO role holders in your forest
netdom query fsmo
To refresh group policy settings
gpupdate
To list all applied GPO on client machine
gpresult /H c:/tmp/policy.html
To check Active Directory replication on a domain controller
repadmin /replsummary
To force replication from a domain controller without having to go through to Active Directory Sites and Services
repadmin /syncall
To see what server authenticated you (or if you logged on with cached credentials) you can run either of these commands:
set l
echo %logonserver%
To see what security groups you belong to
whoami
To see what security groups you belong to
whoami /groups
To see the domain account policy (password requirements, lockout thresholds, etc)
net accounts
- Windows Networking
To quickly reset your NIC back to DHCP with no manual settings,
netsh int ip reset all
To quickly generate a text summary of your system
systeminfo | more
To see all network connections your client has open
net use
To see your routing table, run either of these commands
route print
netstat -r
Need to run a trace
netsh trace start capture=yes tracefile=c:\capture.etl
netsh trace stop
To add an entry to your routing table that will be permanent, run the route add command with the –p option
route add 0.0.0.0 mask 0.0.0.0 172.16.250.5 –p
to see all open network connections, refreshing every second
netstat –ano 1
netstat –ano 8
netstat –ano 40
add a | findstr value to watch for only a specific connection, like a client ip.addr or port
netstat –ano | findstr 216.134.217.20
netstat –ano 1| findstr 216.134.217.20
netstat –ano 50| findstr 216.134.217.20
netstat -ano 1 | findstr :139
netstat -ano 50 | findstr :139
List out all connections
netstat -a
List only TCP connections
netstat -at
List only UDP connections
netstat -au
Disable reverse dns lookup for faster output
netstat -ant
List out only listening connections
netstat -tnl
Get process name/pid and user id
netstat -nlpt
netstat -ltpe
Print statistics
netstat -s
Display kernel routing information
netstat -rn
Print network interfaces
netstat -i
Get netstat output continuously
netstat -ct
ipconfig /all IP Configuration (Display Connection Configuration)
ipconfig /displaydns IP Configuration (Display DNS Cache Contents)
ipconfig /flushdns IP Configuration (Delete DNS Cache Contents)
ipconfig /release IP Configuration (Release All Connections)
ipconfig /renew IP Configuration (Renew All Connections)
ipconfig /registerdns IP Configuration (Refreshes DHCP & Re-Registers DNS)
ipconfig /showclassid IP Configuration (Display DHCP Class ID)
ipconfig /setclassid IP Configuration (Modifies DHCP Class ID)
to shutdown or reboot a machine, including your own, in a simple scheduled task
shutdown –r –t 0 –m \\localhost
Scan for open ports for specific IP/host
nmap -n -sV 192.168.1.4
Scan for open ports for a network
nmap -n -sV 192.168.1.0/24
- Windows Administration
to enable the local administrator account
net user administrator * /active:yes
see all the open files on a system
openfiles /query
reset IIS without having to reboot the whole server
iisreset
To check if server is virtual.
On Windows
CMD:
Systeminfo | findstr /i model
powershell:
gwmi -q "select * from win32_computersystem"
determine if the current version of Windows is either 32-bit or 64-bit from the command line
echo %PROCESSOR_ARCHITECTURE%
check the PROCESSOR_ARCHITECTURE environment variable. 64-bit systems will say AMD64 and 32-bit systems should say "x86"
C:\>wmic OS get OSArchitecture
OSArchitecture
32-bit
To display the MD5 hash of a file, type the following command at a command prompt:
fciv.exe filename
fciv.exe -sha1 filename
- AD Shortcuts
adsiedit.msc ADSI Edit
AdRmsAdmin.msc Active Directory Rights Managment Services Administration
azman.msc Authorization Manager
certsrv.msc Active Directory Certificate Services
CluAdmin.msc Failover Cluster Manager
dfsmgmt.msc DFS Managment
dhcpmgmt.msc DHCP Management
dnsmgmt.msc DNS Management
domain.msc Active Directory Domains and Trusts
fsrm.msc File Server Resource Manager
gpmc.msc Group Policy Management Console
gpme.msc Group Policy Management Editor
lsdiag.msc Remote Desktop Licensing Diagnoser
remoteprograms.msc RemoteApp Manager
rrasmgmt.msc Routing and Remote Access
sbmgr.msc Remote Desktop Connection Manager
tsadmin.msc Remove Desktop Services Manager
tsconfig.msc Remove Desktop Session Host Configuration
tsmmc.msc Remote Desktops
winsmgmt.msc WINS Management
WSRM.msc Windows System Resource Manager
- Local Computer Shortcuts
fsmgmt.msc Shared Folders
eventvwr.msc Event viewer
certlm.msc Certificates – Local Computer
certmgr.msc Certificates – Local Users
certtmpl.msc Certificates Templates Console
appwiz.cpl Programs and Features
Firewall.cpl Windows Firewall
compmgmt.msc computer management
psr.exe steps recorder
comexp.msc Component Services
devmgmt.msc Device Manager
diskmgmt.msc Disk Management
lusrmgr.msc Local Users and Groups
ncpa.cpl Network Connections
perfmon.msc Performance Monitor
sysdm.cpl System Properties
WF.msc Windows Firewall with Advanced Security
- Windows Run Commands Shortcuts
Control Panel Program Shortcuts
control Control Panel
control netconnections Network Properties
control printers Printers Folders
control userpasswords2 Manager all User Accounts
control update Windows Update
control admintools Administrative Tools
control schedtasks Scheduled Tasks
appwiz.cpl Program and Features
intl.cpl Regional Settings (International)
sysdm.cpl System Properties
firewall.cpl Windows Firewall
Windows Tools
explorer Windows Explorer
regedit Registry Editor
services.msc Windows Services (local)
taskmgr Task Manager
msconfig System Configuration Utility
mstsc Remote Desktop (Microsoft Terminal Services)
logoff Log Off Windows (without confirmation!
shutdown Shuts Down Windows (don't try unless you are ready to shutdown)
msinfo32 System Information
- Tools
Network Monitor
Nagios Core
OpenNMS
Advanced IP Scanner
Messsage Analyzer
Capsa Free
Wireshark
Fiddler
NetworkMiner
Zenoss Core
Pandora FMS
Xirrus Wi-Fi Inspector
WirelessNetView
Xymon
NetXMS
Total Network Monitor
Icinga 2
Angry IP Scanner
Splunk
The Dude
PRTG Network Monitor Freeware
fciv gpg4win-2.2.5.exe -sha1
fciv gpg4win-2.2.5.exe -md5
fciv gpg4win-2.2.5.exe -sha1 > filedownloaded.txt
fciv gpg4win-2.2.5.exe -md5 > filedownloaded.txt
_System Tools
Shadow Explorer
_Security Tools
Malwarebytes Anti-Malware
Hitman Pro3
_Data Recovery Tools
Data Recovery Wizard Free 9.0
R-STUDIO
Recuva
storage administrator daily tasks
Note:
1. Storage = disk, tape, SAN, and storage software
2. Percentage after each task is approximatley timed
1. Manage current storage environment (20%)
Resolve any storage shortages
Alert and resolve any performance issues and notify end-users
Insure that data is available to all applications
2. Application support (20%)
Work with application developers to determine storage requirements
Work with existing programmers, DBAs to optimize storage
3. Backup (15%)
Maintain proper backup schedule
Restore and recover data as requested
Facilitate off-site storage of tape
4. Monitor current storage environment (15%)
Usage
Performance
Availability
Reporting on status
5. Capacity planning (10%)
Forecast storage growth
Determine allocation of different storage types
1. Storage = disk, tape, SAN, and storage software
2. Percentage after each task is approximatley timed
1. Manage current storage environment (20%)
Resolve any storage shortages
Alert and resolve any performance issues and notify end-users
Insure that data is available to all applications
2. Application support (20%)
Work with application developers to determine storage requirements
Work with existing programmers, DBAs to optimize storage
3. Backup (15%)
Maintain proper backup schedule
Restore and recover data as requested
Facilitate off-site storage of tape
4. Monitor current storage environment (15%)
Usage
Performance
Availability
Reporting on status
5. Capacity planning (10%)
Forecast storage growth
Determine allocation of different storage types
infrastructure engineer daily tasks
network monitoring tool (nagios, zabbix etc)
monitoring capturing log files
monitoring capturing servers cpu memory usage
monitoring capturing file system space
monitoring capturing network usage
automate with scripts routine users/sysadmin tasks
end user management/support 1/2/3 layer support
building knowledge base
documentary/sharing procedures
emergency phone list for support
ITIL product
ITSM,IT infrastructure, IT operations
backup software
tape backup management
disaster recovery plan
business continuity plan
RAID configuration,implementation
update management software, WSUS
antivirus software endpoints
adding new hardware
server room visits
check on aircon extractor fans blinking alarms
trailing cables
humidity controls
internet connectivity
domain controllers
cleanup logs, automation
webmin, apache,sendmail,mysql
remote access tools
vnc,dameware,webex,teamviewer
spam filter
mailbox sizes
db fragmentation
how to install .deb file ubuntu
- To install a downloaded Debian (Ubuntu) package (.deb)
To remove a Debian (Ubuntu) package (.deb):
sudo dpkg -r packagename
How to install keepass on Ubuntu 16.04.2
- sudo apt-add-repository ppa:jtaylor/keepass
sudo apt-get install keepass2
https://launchpad.net/~jtaylor/+archive/ubuntu/keepass
- https://keepass.info/download.html
add-apt-repository 'deb http://packages.linuxmint.com/ julia main'
add-apt-repository ppa:gnome-desktop
20 sudo add-apt-repository 'deb http://ftp.de.debian.org/debian sid main'
22 sudo apt-cache search keepass2
23 sudo apt-get install keepass2
24 sudo apt-get -f install
25 sudo apt-get install keepass2
Subscribe to:
Posts (Atom)