CyberKeeda In Social Media

How to Create Windows 10 Bootable USB on Ubuntu or any Linux desktop



Are you looking for any desktop application on Ubuntu to create a bootable pendrive/flash drive with Windows.

WoeUSB is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD.


WoeUSB  package contains two programs:
  • woeusb: A command-line utility that enables you to create your own bootable Windows installation USB storage device from an existing Windows Installation disc or disk image
  • woeusbgui: A GUI wrapper of woeusb based on WxWidgets


So, lets know how install the WoeUSB on Ubuntu 
Official & updated Installation and Github link : Here
#    sudo add-apt-repository ppa:nilarimogard/webupd8
#    sudo apt update
#    sudo apt install woeusb
In case if you wish to remove that woeusb PPA, remove it from the bellow command.
#    sudo add-apt-repository --remove ppa:nilarimogard/webupd8
#    sudo apt-update
Now, WoeUSB has installed on my Ubuntu, though the interface is self explanatory still let's move ahead and know how to use it.

Open WoeUSB application and choose the USB drive and your windows iso kept within your Ubuntu.
Once you are done click install and you are done, you can monitor the progress on screen.


In case you receive a error dialogue like below, follow the below steps

Find your USB drive's mounted file system and block by running lsblk on terminal and find your device their.
To filter, look for size of your USB or name of the USB drive, below screen shot gives the picture of my USB drive ( 8 GB ) size, and named as /dev/sdc
#    lsblk

So we will unmount that partition out of the system.
Notice there  /dev/sdc is the full size of my USB disk, but the data is witten on it's /dev/sdc1 partition.
My USB disk is  /dev/sdc, ensure your USB is unmounted with the following command. Replace /dev/sdc1 with your own partition name.
#    sudo umount /dev/sdc1
Now try again from the   WoeUSB desktop application.
In case if you are willing to do the same through woeusb CLI utility, here is the way.
#    sudo woeusb -v --device /home/kunal/windows-10.iso /dev/sdc
/home/kunal/windows-10.iso  :  Replace it with your iso location.
/dev/sdc : replace it with your USB drive ( check it from lsblk )
Read more ...

PIP SSL eeror while installing : SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)


If you too, have encountered SSL errors while installation/upgrading any python package from pip.
Here below is the workaround for it.


You might be flooded by this errors.
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579) 

Workaround.

Ignore SSL errors by setting pypi.org and files.pythonhosted.org as trusted hosts.
#  pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>
Lets assume i want to install pika through pip 
#  pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pika
Read more ...

How to Configure PostgreSQL user and Database

Content.

In this blog post, we will cover the below content.
  • Creating PostgreSQL users
  • Creating PostgreSQL databases
  • Adding an existing user to a database
  • Deleting PostgreSQL User
  • Deleting PostgreSQL Database.

By default PostgresSQL installation always includes the postgres superuser ( Linux Shell User) and postgresql database user too. Initially you have to use the same postgres user to coonnect to PostgreSQL until you create other users.
A PostgreSQL users are also known as role. 


Follow the steps to create a PostgreSQL user.


Use the passwd copmmand ( passwd postgres )to change the postgres linux user's password.
Just after PostgreSQL db instllation, change the password for default postgres  database superuser'spassword.
#    su - postgres
# psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"
Now we are all set to create new database user, switch again to postgres super user
#    su - postgres
#    createuser muser --pwprompt
Above crateuser will prompt you few questions.
  • Enter password for new role: prompt, type a password for the user.
  • Enter it again: prompt, retype the password.
  • Shall the new role be a superuser? prompt, type y if you want to grant superuser access. Otherwise, type n.
  • Shall the new role be allowed to create databases? prompt, type y if you want to allow the user to create new databases. Otherwise, type n.
  • Shall the new role be allowed to create more new roles? prompt, type y if you want to allow the user to create new users. Otherwise, type n.

Follow the steps to create a PostgreSQL Database.

Open a new linux terminal from root and run the commands one by one.
#    su - postgres
One can now run commands as the PostgreSQL superuser. 

To create a database, type the following command. Replace user with the name of the user that you want to own the database, and replace dbname with the name of the database that you want to create.

PostgreSQL users that have permission to create databases can do so from their own accounts by typing the following command, replacing dbname is the name of the database to create.
#    createdb -O myuser dbname
#    createdb dbname

Follow the steps to add a PostgreSQL db user to existing  Database.

Run the psql command program as the database's owner, or as the postgres superuser.
I will be using postgres user here
#    GRANT permissions ON DATABASE dbname TO username;
Replace above dbname and username as per your requirement.

Follow the steps to delete a PostgreSQL user.

Important point to consider before deleting a db user.


If the user owns any databases or other objects, you cannot drop the user. Instead, you receive an error message " dropuser: removal of role "username" failed: ERROR:  role "username" cannot be dropped because some objects depend on it "
DETAIL:  owner of database dbname "

You should change the database's owner (or drop the database entirely), and then you can drop the user, then run the below command
#    dropuser username
Follow the steps to delete a PostgreSQL Database
#    dropdb dbname

    Read more ...

    How to Install PostgreSQL Relational Database on CentOS



    PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
    Official link : Here 

    Let's know how to install PostgreSQL on CentOS 7.
      Note :   Video Tutorial at the bottom of the blog post

    Method 1

    Install from CentOS repository.
    For the time being CentOS 7 repositories ship with PostgreSQL version 9.2.15
    To install from the CentOS repositories, simply run:
     sudo yum install postgresql-server postgresql-contrib
    Now lets Initialize your Postgres database and start PostgreSQL and configure it to start on Boot
    #  sudo postgresql-setup initdb 
    #  sudo systemctl start postgresql
    #  sudo systemctl enable postgresql

    Method 2.

    Install the latest stable version of PostgreSQL from Postgres Repository
    Official repository link :  Here

    Note : Currently official repositiry provides packages based on RPM distribution ( Redhat/CentOS/Fedora...)

    Select the version you wish to install from the Postgres Yum repositories.
    Locate the CentOS 7 link for your chosen version and download it to your Centos 7 host.
    For the time being, I'm selecting Postgresql 9.6.3, choose as per your requirement.

    #  wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
    Install the downloaded postgres rpm package and install centos epel too.
    #  rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
    #  yum install epel-release
    Now we are almost all set to install PostgreSQL.

    Update Yum to apply your changes and install PostgreSQL.
    When installing Postgres manually, you will have to specify the version, we will be installaing postgresql-9.6
    #  sudo yum update
    #  sudo yum install postgresql96-server postgresql96-contrib
    Important Point to notice.
    When Postgres is installed using above method 2, the version number is included in its configuration directories. For example, /var/lib/pgsql becomes /var/lib/pgsql/9.6. 
    This is also the case with systemd units
    systemctl status postgresql becomes systemctl status postgresql-9.6
    Now lets Initialize your Postgres database and start PostgreSQL and configure it to start on Boot.
    #  sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
    #  sudo systemctl start postgresql-9.6
    #  sudo systemctl enable postgresql-9.6
    And we are done..

    In case you are looking for the Installation Video Tutorial, below is the stuff.





    Read more ...

    How to install Sublime text editor on Ubuntu


    Sublime text editor is one of the popular text editor for code, markup and prose that's the line it says on it's official website  and most of the users believe the same.
    So let's know how to install it on your Ubuntu Box.

    I'm using Ubuntu 18.04  while writing this blog during installation.

    Install the GPG key


      #  wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

    Make apt work using https also


      #  sudo apt-get install apt-transport-https

    Select the channel to use ( Recommended Stable )
    For Stable release use the below command.
      #  echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list 

    For Development release use the below command.
      #  echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

    Update apt sources and install Sublime Text


      #  sudo apt-get update #  
      #  sudo apt-get install sublime-text

    To remove/uninstall sublime text editor  use the below command


      #  sudo apt-get remove sublime-text && sudo apt-get autoremove #  


    Meanwhile you can anytime install it from Ubuntu Software Center,  it's also enlisted there.

    Official Installation Link : Here


    Read more ...

    Linux Find Commands with examples.



    Linux Find Commands Cheat sheet.

    Find Files Using Name in Current Directory.
    Lets assume we are currently under our /home directory.
      # find . -name myfile.txt
         /home/myfile.txt


    Find Files Using Name and Ignoring Case ( Ignore upper & lower case )


      # find . -iname myfile.txt
         /home/myfile.txt
         /home/MYFILE.txt

    Find Files under any specified Directory.


      # find . -iname myfile.txt
    
         /home/myfile.txt
    
         /home/MYFILE.txt


    Find Files Using Name and Ignoring Case ( Ignore upper & lower case )

        #  find . -iname myfile.txt
      
           /home/myfile.txt
      
           /home/MYFILE.txt


      Find files  based on extention ( .php .txt .csv .sh )


        #  find . -type f -name "*.php"
      
           /home/myfile.php
      
           /home/index.php
      
      
      
       #  find . -type f -name "*.csv"
      
           /home/abc.csv
      
           /home/newfile.csv
      
      
      
       #  find . -type f -name "*.sh"
      
           /home/myscript.sh
      
           /home/new.sh
      
      
      
      
      


      Find Directories 


        #  find . -type d -name  mydirectory
      
      
          /home/mydirectory


      Find files with 777 Permission


        #  find /home   -type f -perm 0777 -print
      
            /home/abc.txt

      Find files without  755 Permission


         #  find /home  -type f ! -perm 755
      
             /home/myfile.txt
      
             /home/MYFILE.txt


      Find  all files Based on User
      We will find all files placed within /home directory having ownership of user jackuna
        #  find /home -user jackuna
      
            /home/myfile.txt


      Find  all files based on specific Group
      We will find all files placed within /home directory having group of user sysadmins
        #  find /home -group sysadmins
      
            /home/admin.sh


      Find  specific file type for a user
      We will find all files with .txt extension for user jackuna under /home directory
        #  find /home -user jackuna -iname "*.txt"
      
           /home/myfile.txt


      Find all empty files ( no content )
      We will find all empty/blank files  under /tmp directory.
         #  find /tmp -type f -empty


      Find all empty directories ( no content )
      We will find all empty/blank directories  under /tmp directory.
         #  find /tmp -type d -empty


      Find all hidden files
      We will find all hidden files under /tmp directory.
         #  find /tmp -type f -name ".*"


      Find  and remove a single file
      We will find file named as  myfile.txt  under /home directory and remove it permanently 
        #  find /home  -type f -name "myfile.txt" -exec rm -f {} \;


      Find  and remove a multi[ple file
      We will find all files with .sh and .mp3 extension under /home and delete it permanently 
        #  find /home -type f -name "*.sh" -exec rm -f {} \;
       
        #  find  /home  -type f -name "*.mp3" -exec rm -f {} \;


      Find files that are older then n number of days 
      Below find command will find all files that are older then 20 days under /tmp directory
        #  find  /tmp -mtime +20 -print
      


      Find files that are accessed then n number of days before
      Below find command will find all files that are accessed  20 days before under /tmp directory
        #  find  /tmp -atime +20 -print


      Find files that are changed within last hour
      Below find command will find all files that are changed within last 60 min under /tmp directory
        #  find /tmp -cmin -60


      Find modified files in last 60 minutes
      Below find command will find all files that are modified within last 60 min under /tmp directory
        #  find /tmp -mmin -60


      Find accessed files in last 60 minutes
      Below find command will find all files that are accessed within last 60 min under /tmp directory
        #  find /tmp -amin -60

      
      
      Read more ...
      Related Posts Plugin for WordPress, Blogger...
      Designed By Kunal Saha