BootDB

Code | Open Source | Web

Mysql Meta Commands Cheat Sheet

Create New User:

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';</pre>
<p></p>


Grant Privileges:


    GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
    GRANT CREATE ON * . * TO 'newuser'@'localhost';
    GRANT DROP PRIVILEGES ON * . * TO 'newuser'@'localhost';
    GRANT DELETE PRIVILEGES ON * . * TO 'newuser'@'localhost';
    GRANT INSERT PRIVILEGES ON * . * TO 'newuser'@'localhost';
    GRANT SELECT PRIVILEGES ON * . * TO 'newuser'@'localhost';
    GRANT UPDATE PRIVILEGES ON * . * TO 'newuser'@'localhost';</pre>
    <p></p>


    Revoke:


        REVOKE [type of permission] ON [database name].[table name] FROM ‘[username]’@‘localhost’;</pre>
        <p></p>


        Flush:


            FLUSH PRIVILEGES;</pre>
            <p></p>


            Drop user:


                DROP USER ‘demo’@‘localhost’;</pre>
                <p></p>

List of SQL Injection Strings

Below are the list of SQL injection strings:

' or 1=1--

" or 1=1--

or 1=1--

' or 'a'='a

" or "a"="a

') or ('a'='a

") or ("a"="a

 

Office365 Email Settings

Below are the office365 email settings in the following format

Server name
Port
Encryption method

POP3

outlook.office365.com
995
SSL

IMAP4

outlook.office365.com
993
SSL

SMTP

smtp.office365.com
587
TLS

How to Import Azure Cdmlets Into Powershell

After installing Azure SDK by using Import-Module we can import azure cdmlets into Powershell like below:

Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure"</pre>
<p><code></p>

How to Format a Drive in Linux

To format a drive in Linux use:

# Choose which volume you want to format:
fdisk -l

# Unmount the volume:
umount /dev/sdb1

# Format it:
mkfs.vfat /dev/sdb1</pre>
<p></p>

How to Read Process Output in Powershell

If you are running a process via powershell you can capture the stdout and stderr using StandardOutput.ReadToEnd() and StandardError.ReadToEnd(), below is the example:

$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = "ping.exe"
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = "localhost"
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$p.WaitForExit()
$stdout = $p.StandardOutput.ReadToEnd()
$stderr = $p.StandardError.ReadToEnd()
Write-Host "stdout: $stdout"
Write-Host "stderr: $stderr"
Write-Host "exit code: " + $p.ExitCode

Convert CR2 to JPG in Ubuntu

Convert cr2 to jpeg files in Ubuntu in a few simple steps:

Step 1: Install ufraw

sudo apt-get install ufraw

Step 2: For ufraw

for i in *.CR2; do ufraw-batch $i --out-type=jpeg --output $i.jpg; done;

This will convert all cr2 files a directory into jpeg files, later if you don’t want cr2 files use rm -f *.cr2

Install Mac Theme in Ubuntu

Make your Ubuntu look like a Mac by installing mac theme:

sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install mac-ithemes-v3
sudo apt-get install mac-icons-v3