Total Hit Counter

Wednesday, August 17, 2016

Wifi not getting up after suspend in ubuntu 16.04

Hi Friends,

Before couple of days I have upgraded my laptop from Ubuntu 14.04 to Ubuntu 16.04. After upgrade I was facing some misbehavior issues.

One of them was when I wake my laptop after suspend, it was unable to connect to any of wifi devices.

Here, I am going to give solution for the same. I figured it out that after suspend it was not able to start wifi again.


You just follow below steps and it will be done.

Step 1: To verify before applying this solution by executing below command after wake up from suspend, you check whether it will work for you or not.
$ sudo systemctl restart network-manager.service
Now if it works then further you apply below is permanent solution.

Step2: Create a file with name wifi-reset.service in /etc/systemd/system/ directory with below content:

[Unit]
Description=Restart networkmanager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart network-manager.service
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
Step3: Now enable service at boot time, wakeup time and hibernet time using following command: 
systemctl enable wifi-resume.service
That's it, you are done now.
Please check after suspend again....................





Wednesday, June 8, 2016

Getting started with Docker Container service

Hi Guys,

Below are the steps to install docker container and start working on it. As I have installed docker on Centos Server, below are the steps to install on it.

System Requirement:
1) Kernel must be 3.10 or more then that.
2) device-mapper-libs must be installed on it.

Steps are as below:

Step1: Installation of latest kernel.
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
yum -y --enablerepo=elrepo-kernel install kernel-lt
yum -y install device-mapper-libs
vim /etc/grub.conf and chnage default kernel to 0
reboot
uname -a

Step2: Installation of Docker packge repository
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

Step3: Installation and Start docker service.
yum install docker-engine
service docker restart

you can check logs by executing below command


tail -f /var/log/docker

Now Press CTRL+C

Step4: Start your hello-word container.
docker run hello-world
docker ps -a
You will see there will be 1 container running on your server with named hello-world


Example of Nginx Server: 

docker pull nginx
docker run --name docker-nginx -p 80:80 nginx
mkdir -p ~/docker-nginx/html
cd ~/docker-nginx/html
vim index.html

docker ps -a
docker stop docker-nginx
docker ps -a
docker rm docker-nginx
docker run --name docker-nginx -p 80:80 -d -v ~/docker-nginx/html:/usr/share/nginx/html nginx

Login to docker on bash shell:


docker exec -i -t 2f9f1cacb645 /bin/bash

Now you can check nginx service is running on it.
Also check ip address using below command
ip add

Now Browse the same ip in your server you will see sample page you have created.

That's it.................

Tuesday, January 5, 2016

Bootstrap Node in Chef-server

Now you need to bootstrap a node with your chef-server.

Please execute below command for the same.

knife bootstrap xxx.xxx.xxx.xxx --ssh-user root --ssh-password 'password' --run-list 'recipe[init-setup]'

Thursday, December 10, 2015

Chef Server install and configure


To get started with installation you must have below things ready.

  • Centos 6.5 installed.
  • Internet connection
  • Stop iptables and selinux.


Step1: Download latest rpm from chef website.

https://downloads.chef.io/chef-server/redhat/

I downloaded chef-server-core-12.3.1-1.el6.x86_64.rpm.

Step2: Now install chef rpm. Execute below command to install chef rpm





Step3: Edit /etc/hosts file and add chef-server fqdn to get it resolved. Chef server fqdn must be resolved from anywhere in you network.

127.0.0.1 chef-server.cignex.com

Create file /etc/opscode/chef-server.rb with below content

server_name = "chef-server.cignex.com"api_fqdn server_namebookshelf['vip'] = server_namenginx['url'] = "https://#{server_name}"nginx['server_name'] = server_namenginx['ssl_certificate'] = "/var/opt/opscode/nginx/ca/#{server_name}.crt"nginx['ssl_certificate_key'] = "/var/opt/opscode/nginx/ca/#{server_name}.key"


Step4: Now configure chef server by executing below command
chef-server-ctl reconfigure
At the last you will get message like Chef Server Reconfigured! 


Step5: To start with web console you have to install it.

chef-server-ctl install opscode-manage
 If above command fails then enable yum repo in this file /etc/yum.repos.d/chef-stable.repo
Then install opscode-manage manually and execute above command again.
chef-server-ctl reconfigureopscode-manage-ctl reconfigure
 Now execute below command for installing reporting tool.

chef-server-ctl install opscode-reporting
 If above command fails then enable yum repo in this file /etc/yum.repos.d/chef-stable.repo
Then install opscode-reporting manually and execute above command again.
chef-server-ctl reconfigureopscode-reporting-ctl reconfigure


Step 6: Now restart chef service. by executing below command.
/opt/opscode/bin/chef-server-ctl restart

Step 7:  Create Admin user for login into web console

Command:
chef-server-ctl user-create ADMIN_USER_NAME ADMIN_FIRST_NAME ADMIN_LAST_NAME ADMIN_EMAIL ADMIN_PASSWORD --filename ADMIN_USER_NAME.pem
Example:
[root@chef-server ~]# chef-server-ctl user-create shankar Shankar Patel shankar.patel@cignex.com Cignex --filename Cignex.pem
Reset password for created user
[root@chef-server ~]#  chef-server-ctl password shankar
         
Step 8:  Create Organization to manage nodes under a single roof

Command:
chef-server-ctl org-create ORG_SHORT_NAME "ORG_LONG_NAME" --association_user ADMIN_USER_NAME
Example:
[root@chef-server ~]# chef-server-ctl org-create cignex 'CIGNEX Datamatics Pvt Ltd' --association_user shankar 
You must define organization name in small leters, otherwise it will not create any organization.



Thats it!

You are done now.

Now you can browse URL to login in console

https://chef-server.cignex.com/login