Tuesday, August 10, 2021

Run Skype as a root user in Linux Ubuntu CentOS Fedora

Skype is not working for root in ubuntu

Now Skype does not work for root user in Linux.

In recent versions, they have also removed the option --no-sandbox for root user.

Here is the solution to open Skype as root user in Linux without any security loophole and without --no-sandbox

Once you have installed latest version of Skypeforlinux in your Ubuntu, CentOS, Fedora or any other distribution, now follow the tutorial to open the skype as a root user in Linux.

 


Run Skype version 60.0+ on Centos 7, Centos 8, Ubuntu 20.04 or Ubuntu 18.04 as a root


Run Skype version 70.0+ on Centos 7, Centos 8, Ubuntu 20.04 or Ubuntu 18.04 as a root

Skype crashes when I run it as a root user in Linux | skypeforlinux not launch anymore | Skype for linux as a root user in Ubuntu | Open Skypeforlinux as a root user | skype not running as root user in linux | skype now working with sudo


Saturday, August 7, 2021

Django Migration Error - '%s=%s' % (k, v) for k, v in params.items(),

Django Migration Error :

  File "/home/pavi/ldap/lib/python3.8/site-packages/django/contrib/admin/__init__.py", line 4, in <module>
    from django.contrib.admin.filters import (
  File "/home/pavi/ldap/lib/python3.8/site-packages/django/contrib/admin/filters.py", line 10, in <module>
    from django.contrib.admin.options import IncorrectLookupParameters
  File "/home/pavi/ldap/lib/python3.8/site-packages/django/contrib/admin/options.py", line 12, in <module>
    from django.contrib.admin import helpers, widgets
  File "/home/pavi/ldap/lib/python3.8/site-packages/django/contrib/admin/widgets.py", line 151
    '%s=%s' % (k, v) for k, v in params.items(),

Solution :

Update file at line number 151

Add the Parenthesis
  File "/home/pavi/ldap/lib/python3.8/site-packages/django/contrib/admin/widgets.py", line 151

('%s=%s' % (k, v) for k, v in params.items()),

Postman Error : The requested URL /upload/drive/v3/files was not found on this server. That’s all we know.

Error : The requested URL /upload/drive/v3/files was not found on this server. That’s all we know. 

Solution :

The issue is in the Headers section.
Add always default header Host, Do not skip it while sending the request.

Django sqlite Migration error

Error : django.db.utils.OperationalError: no such table: main.auth_user__old

Solution :
Do not use Django 2.0.0 with sqlite database. The issue is fixed in later versions of Django.
Django 2.1.5 does not have this error.

pip install django==2.1.5

Google Drive api uploads file name as "Untitled"

If you are uploading a file on google drive using Google API, you might face incorrect filename issue. If uploaded filename is not the real name of the file, its name is Untitled, here is the solution for you.

You need to send metadata json with the post data. Metadata json contains filename and content type. When google api finds metadata json with the post data, it uploads the file with correct name.

Here is the tutorial to upload the file on the google drive using postman.

https://linuxamination.blogspot.com/2021/08/upload-files-on-google-drive-using.html

If you are using curl or any other scripting method to upload the files on drive, you need to send metadata json with the post data.

It will solve the issue.

Complete Solution :



Upload Files on Google Drive using Postman


SR. No.
Parameter Value
1
Request Type Post
2
URL https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart
3.1 Authorization Authorization Type Oauth2.0
3.2
Available Token <here-is-the-token>
3.3
Token Name Authorization
3.4
Grant Type Authorization Code
4.1 Headers Authorization Bearer <here-is-the-token>
4.2
Content-Type multipart/form-data; boundary=<calculated when request is sent>
4.3
Content-Length <calculated when request is sent>
4.4
Host <calculated when request is sent>
5.1 Body Key Empty
5.2
File filename.json
5.3
Key Empty
5.4
File file.png

Screenshots : (Click on image to see bigger view)


 



a) filename.json

    Content-Type: application/json; charset=utf-8
    {
      "name": "file.png",
      "mimeType": "image/png"
    }

b) file.png

    An image file

Wednesday, August 4, 2021

Run Google Chrome as root in Linux without no sandbox

If you are facing issue while running Google Chrome or other softwares as a root user on Linux systems like Ubuntu, CentOS, KALI, Fedora etc, here is the guide for you.


# Create a User for Google Chrome or other software

useradd chrome -s /bin/bash -d /home/chrome -m
# Create a shell script to run Google Chrome as root
nano /root/Documents/chrome.sh

# Add following content in the script

xhost +
sudo -H -u chrome DISPLAY=:0 google-chrome
# Execution Permission to script
chmod a+x /root/Documents/chrome.sh

 # Run the script by command line

bash /root/Documents/chrome.sh

or double click on the sh file. 

You should be able to run Chrome or other softwares like skype as a root user.