Search This Blog

Monday, April 20, 2020

How to create Windows 8.1 Bootable Disk in Linux/Ubuntu

1. Download the windows 8.1 ISO
2. Install WoeUSB into linux
3. Take min 4-8 GB USB Pendrive
4. Insert USB Pendrive into slot.
5. Open WoeUSB, Now you can your drive list in the text area.
6. NOTE: now open terminal and un-mount your dirve. but dont unplug.
         > df -h 
         > umount /dev/sdb1

7. OR, in global search type Disks, It will display all your HDD's. There you can select your Pendrive and click stop/unmount button.

8. Just go to already opened WoeUSB window, just click install [Dont click refresh, it will not shown in the list].

DONE.


Insert your bootable perdrive and do recovery, reinstall etc..

Saturday, April 18, 2020

Postgres Restore All Databases taken from pg_dumpall


pg_dumpall > backup9.5.sql


Go to cmd prompt
cd C:\Program Files\Postgres\12\bin> psql -f d:\backup9.5.sql -U postgres


Tuesday, April 14, 2020

Python AWS S3 - Upload a File

import os
import boto3
from botocore.exceptions import NoCredentialsError

ACCESS_KEY = 'AK....'
AWS_ACCESS_SECRET_KEY = 'DZKtksHidEexxxxxxx'

def upload_to_aws(local_file, bucket, s3_file):
    s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
                      aws_secret_access_key=AWS_ACCESS_SECRET_KEY)

    try:
        s3.upload_file(local_file, bucket, s3_file)
        print("Upload Successful")
        return True
    except FileNotFoundError:
        print("The file was not found")
        return False
    except NoCredentialsError:
        print("Credentials not available")
        return False



file = open('test.png', 'r+')

key = file.name
bucket = 'dev-nw'

uploaded = upload_to_aws('test.png', bucket, key)
    


#download a file
s3 = boto3.client( 's3', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=AWS_ACCESS_SECRET_KEY );   
s3.download_file( bucket, key, 'D:/airtel-download.png' );



Sunday, April 12, 2020

Python Flask AttributeError: 'Request' object has no attribute 'is_xhr'

#. Remove flask and install recent version

    pip uninstall flask
    pip intall flask


#. Else, go to your requirements.txt remove the verions of your plugins/libraries.
   ex: flask=0.12.0
          to
         flask


Re run the requriements.txt and make sure all it is now in updated version.
#before uninstall manually and run the below command.

pip install -r requirements.txt


Friday, April 10, 2020

Joomla 1054 Unknown column 'a.extra_query' in 'field list'

Steps
1. Go to  Extension manager -> Database, and click the Fix button in the upper left corner
2. Now go to System. Control Panel. You can see it is fixed.

Fix Database
Screenshot

.htaccess file gives 500 internal server error

  1. In your root folder
  2. Create .htaccess file in your project root directory like below.

.htaccess

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
  1. Save .htaccess file.

Thursday, April 9, 2020

Added Google Site Verification HTML TAG in old Joomla Templates

Google Console

1. goto search.google.com
2. select right side option, give ur index url
    ex: http://www.infovijay.com
3. go down, select html tag verification.
4. Generate. copy that metatag, apply into your html/php of the main index.
5. Click verify


In your Joomla Template

1. Open filemanager
2. goto public_html/templates/avatar_nine/core/classes folder
3. Open template.php
4. find public function addHead()
{} method and add before return.

sample 

public function addHead() 
{
....
$head .= '< meta name="google-site-verification" content="BTDlLui-sdfdsfdsfdsf4r4454ergdrfgrdfgdfgikORSxw" / >';

return $head;

}

Friday, April 3, 2020

Spring Boot application.yml

Make sure your pom.xml

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.xml</include>
<include>**/*.yml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


OR

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


GlobalProperties.java

@Component
@ConfigurationProperties ( "product" )
public class GlobalProperties
{
String url;
          //setter, getter
}


application.yml

product:
      url: "http://url.com"

Hit Counter


View My Stats