Posts

What is git?

Image
Git basics -What is Git?Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is a distributed version-control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

Previously ---

1.  Linux was used bit-keeper after that Linux stated the git

2.  Git stores a snapshot of the entire projects. If some files have no changes, git does not store them again.

Creator                       Linus Torvalds (Linux creator)
Developer(s)               Junio Hamano and others[
Initial release             7 April 2005; 14 years ago 0.99
Stable release             2.22.0 / 7 June 2019; 12 days ago
Written in                   C, Shell, Perl, Tcl, Python
Operating system        POSIX: Lin…

Upload files in AWS S3 Glacier in Rails

How to upload a file using multipart to glacier in Ruby What is Amazon Glacier?Amazon Glacier is a storage optimized for infrequently used data, or cold data. It is an extremely low-cost storage service that provides durable storage with security features for data archiving and backup.# Gemfile

gem 'aws-sdk', '~> 2.3'

Run bundle install and restart the Rails server after modifying the Gemfile.
View Page :-

<%= form_tag buy_glacier_upload_path, method: :post, multipart: true do %>
    <%= file_field_tag :file, required: true %>
    <%= submit_tag "Upload File", class: "btn submit-btn" %>
<% end %>


Now in the controller :-

class HomesController < ApplicationController

    ACCOUNT_ID         =  "6363463563636536"
    AWS_ACCESS_ID    =  "HDGHDHDHHFGHRGF"
    AWS_SECRET_KEY =  "Dghghghgggggggggghghtyeryey+/"
    AWS_REGION         =  "ap-southeast-2"
    AWS_VAULT           =  "videos"


  …

E: Package 'aptitude' has no installation candidate

Image
E: Package 'aptitude' has no installation candidateSometimes, we are getting broken package error. Please can easily solve this problem.

Example:- 
sudo apt-get install aptitude

If you got error like- 
E: Package 'aptitude' has no installation candidate
Solution:- sudo apt-get update

      sudo apt-get install build-essential


      sudo dpkg --configure -a


      sudo apt-get -f install
None of those worked in my case. I then went to Ubuntu Software Center>Edit> Software Sources and made these changes.




After that the following commands did the job

sudo apt-get update

      sudo apt-get install build-essential

      sudo apt-get install aptitude
Now, problem is solved.
Please follow the link below:- http://musingsonsoftware.blogspot.com/2014/02/ubuntu-apt-get-package-has-no.html

Installing a gem from a private GitHub repo (Heroku)

Installing a gem from a private GitHub repo (Heroku) I have a private repository on Github that I want to use. I deploy my app to Heroku. How can I specify a private repository as the source on my gemfile? I imagine it wouldn't be enough to simply saygem "mygem", :git=>"my github address" As per suggestion from Heroku tech support, the easiest way to do this is by putting the username and password into the URL, as in Basic HTTP Auth, e.g.gem "my_gem", :git => 'https://my_username:my_password@github.com/my_github_account/my_repo.git', :ref => 'revision_no'
On Heroku: Get your OAuth Token from GitHub To authenticate Bundler to GitHub, you will need an OAuth token. You can follow this guide to create a new one. Setting up your credentials To set up your credentials, use bundle-config: Then, add your GitHub credentials to Heroku: Then run the command :-heroku config:add BUNDLE_GITHUB__COM=github_username:github_password Install you…

How to migrate your Heroku Postgres database to Amazon RDS

How to migrate your Heroku Postgres database to Amazon RDS After created RDS database Add RDS certificate to your application:$ cd your_app
$ mkdir -p config

$ curl https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem > ./config/rds-combined-ca-bundle.pem

$ git add config/rds-combined-ca-bundle.pem

$ git commit -m "Add RDS certificate to app files"

$ git push heroku master
Dump your Heroku database locally This will take your application offline. $ cd your_app

$ heroku maintenance:on


$ heroku pg:backups capture


$ curl -o /tmp/latest.dump `heroku pg:backups public-url`

Switch the Heroku app to RDS heroku addons:destroy heroku-postgresql

heroku config:add DATABASE_URL='postgres://rohit:rohit00$$@blogger.cvss58cdh1jm.us-east-1.rds.amazonaws.com:5432/blogger?sslca=config/rds-combined-ca-bundle.pem&sslmode=require&encrypt=true'

Syntax;heroku config:add DATABASE_URL='postgres://myrdsusername:myrdspassword@my-instance.bdfsg3dsfg.ap-southeast-2.rds.amazona…

Errno::EIOErrno::EIErrorInput/output error - read

Errno::EIOErrno::EIErrorInput/output error - read Sometimes, we are getting error from Resque server  :-ps -ef | grep resque See also, https://stackoverflow.com/questions/23820469/errnoeio-input-output-error-stdout

Installing rvm 2.2.0 in Ubuntu.

Installing rvm 2.2.0 in Ubuntu. We can easily install rvm in ubuntucurl -sSL https://rvm.io/pkuczynski.asc | gpg --import -        curl -sSL https://rvm.io/mpapis.asc | gpg --import -Please follow the link below:-https://github.com/rvm/rvm/issues/4533

An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.

An error occurred while installing rmagick (2.16.0), and Bundler cannot continue. Sometimes, we are getting error at the time of installing rmagick.sudo apt-get install libmagickwand-dev imagemagick If you are getting rmagick error then run below aptitude command...sudo aptitude install libmagickwand-dev imagemagickthen, install the rmagick (now, problem in solved.)Orbundle Please follow the link below:-http://musingsonsoftware.blogspot.com/2014/02/ubuntu-apt-get-package-has-no.html

https://gist.github.com/galulex/2304847 

https://www.youtube.com/watch?v=hQYsaGvPJbQ

E: Unable to correct problems, you have held broken packages.

E: Unable to correct problems, you have held broken packages.Sometimes, we are getting broken package error. Please can easily solve this problem.

Example:- 
sudo apt-get install skype
If you got error like- 
E: Unable to correct problems, you have held broken packages.
Solution:-       We just need to use aptitude command.
sudo aptitude install skype
Now, problem in solved.
Please follow the link below:- https://www.youtube.com/watch?v=hQYsaGvPJbQhttp://musingsonsoftware.blogspot.com/2014/02/ubuntu-apt-get-package-has-no.html

Fix Ubuntu 18.4 Touchpad Not Working Properly

Fix Ubuntu 18.4 Touchpad Not Working ProperlyUbuntu 18.4 LTS (Bionic Beaver) has been released with Gnome Desktop (until 16.4 LTS uses Unity) and many cool features making it best version of Ubuntu ever released. Although Ubuntu 18.4 is great it comes with little bugs for touhpad and the problem is that, the touchpad cursor movement is not smooth and jumps around. I am using Dell Inspiron 15 3000 Series laptop that uses Synaptics touchpad. Many other laptops that use Synaptics will also have this touchpad problem, so here is how to fix that.

Ubuntu 18.4 comes with libinput touchpad driver by default and the OS is missing Synaptics touchpad driver.

Please follow the link below:-
https://sangams.com.np/fix-ubuntu-18-4-touchpad-not-working-properly/

FATAL: Peer authentication failed for user "postgres"

When we are getting error likeWhen we get error at the time of import the postgres database :- : FATAL:  Peer authentication failed for user "postgres"then:-
The problem is still your pg_hba.conf file (/etc/postgresql/9.1/main/pg_hba.conf). This line:local   all             postgres                                peer

Should be

local   all             postgres                                md5

After altering this file, don't forget to restart your PostgreSQL server. If you're on Linux, that would be 

sudo service postgresql restart

SEE ALSO,

http://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge

I cannot sign in to Blogger using my gmail account

Image
I cannot sign in to Blogger using my gmail account after April 2, 2019 - being redirected to the homepage all the time.  I believe it's related to the shutdown of Google+. I can view my blog but cannot go to Blogger to edit it.  I was able to sign in before April 2. I do use Google+ in the About Me section of my blog but that should be an easy change after I login to Blogger. Any ideas how to sign in to Blogger after the Google+ shutdown?My solution for this problem was to load again this "profile change" page -> enter my "Display Name" -> click "Continue to Blogger" . Here's the URL:https://www.blogger.com/switch-profile.g It only works if you've used your Google+ profile so far, or if you haven't yet chosen a Display Name for your Blogger profile. If you are currently not logged in to any of Google's services, you can do it here first: https://accounts.google.com/ServiceLogin

reason: 440 5.7.40 Access denied, banned sending IP [440.185.193.75]

reason: 440 5.7.40 Access denied, banned sending IP [440.185.193.75] Error 440 5.7.40 banned sending IP To troubleshoot the problem, verify which IP address you are using to communicate with Office 365. To easily identify your Public IP, type in Google what is my ip. You can just go that below and see the solution.https://nolabnoparty.com/en/office-365-error-505-5-7-606-banned-sending-ip/

Create a zip file with subfolders in Rails

Create a zip file with subfolders in RailsUsing system command we can create a zip file from Rails code.Here is the command-system "zip -r zipfile_name . -i /foldername/*"

Screen rotation issue in Ubuntu 18.04 LTS on system restart

Screen rotation issue in Ubuntu 18.04 LTS on system restart Whenever I restart my system. My screen rotate automatically. I recently installed Ubuntu 18.04. However I observed for another laptop for which I have installed same Ubuntu version, this is not happening. This issue can be temporary resolved by typing below command.Type below command to switch to normal screen  $ xrandr -o normalTry this command to stop and disable  $ sudo systemctl stop iio-sensor-proxy.service
  $ sudo systemctl disable iio-sensor-proxy.serviceTry this command to remove  $ sudo apt-get remove iio-sensor-proxy See also,https://www.programsbuzz.com/article/screen-rotation-issue-ubuntu-1804-lts-system-restart
https://askubuntu.com/questions/1035209/how-to-turn-off-screen-rotation-in-ubuntu-18-04-lts

How to install sublime text on Ubuntu

how-to-install-sublime-text-3-on-ubuntu-18-04 To install Sublime Text 3 on your Ubuntu system, follow these steps: 1.  Update the apt package list and install the dependencies necessary to fetch packages from https sources:

      sudo apt update

      sudo apt install apt-transport-https ca-certificates curl software-properties-common


2.   Import the repository’s GPG key using the following curl command:

      curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

     Add the Sublime Text APT repository to your system’s software repository list by typing:

      sudo add-apt-repository "deb https://download.sublimetext.com/ apt/stable/" 

3.   Once the repository is enabled, update apt sources and install Sublime Text 3 with the following commands:

sudo apt update

     sudo apt install sublime-text


See also https://linuxize.com/post/how-to-install-sublime-text-3-on-ubuntu-18-04/#installing-sublime-text-on-ubuntu



Wi-Fi Not Working on Ubuntu? Here's How to Fix it.

Wi-Fi Not Working on Ubuntu? Here's How to Fix it
Temporarily Solution:We need to open file /etc/resolv.conf# add this below line...

nameserver 8.8.8.8
then restarted using sudo /etc/init.d/networking restart
Now your system is connected with wifi. See also,https://askubuntu.com/questions/1021888/ubuntu-18-04-beta-cannot-connect-to-wifi-internet
https://www.youtube.com/watch?v=-qnCG3IOOvE Permanent Solution:We need to install Nvidia Proprietary Drivers in Ubuntu We need to follow link below,https://itsfoss.com/install-additional-drivers-ubuntu/

AWS EC2 INSTANCE, ASSOCIATE ELASTIC IP, RDS AND ELASTIC BEANSTALK

IF WE WANT TO CREATE EC2 INSTANCE and MAP WITH ELASTIC IP OR WANT TO CREATE RDS and DEPLOYMENT WITH ELASTIC BEANSTALK : -SO THESE BELOW LINK WILL HELP YOU 
Now I have tried the below attempts:

    1.  Increase EC2 Instance RAM :-       https://www.youtube.com/watch?v=YCI5sehyDNc


    2.  Map with elastic IP :-       
https://www.youtube.com/watch?v=mgfpduy5ZAo
https://www.youtube.com/watch?v=A3F2vIQYlu8


    3.  Difference between Elastic IP, Public IP and Private IP: 
https://www.youtube.com/watch?v=MTBR9jyD5RM
    4.  AWS Instance Pricing :- https://aws.amazon.com/ec2/pricing/on-demand/
    5.  How to Assign Multiple IPs to one EC2 Instance                                                                                
https://www.youtube.com/watch?v=Hd05tEuTv-E
    6.   Create RDS database in AWS :- 
https://www.youtube.com/watch?v=I9Fzm1obG7U
    7.   Elastic Beanstalk :-                                                                                                                            
h…