sql server – restore or extract MSSQL bak files

During a penetration test, I found several .bak files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. To restore the master database, I put the server in single user mode and tried to restore the database in the following way (I also tried the same through SSMS):

RESTORE DATABASE master
FROM DISK = & # 39; C:  Foo  master.bak & # 39;
WITH MOVE & # 39; master & # 39; A & # 39; C:  Foo  master.mdf & # 39 ;,
MOVE & # 39; master_log & # 39; A & # 39; C:  Foo  master_log.ldf & # 39 ;,
REPLACE
TO GO

This gave me an error like:

.. it can not be restored because it was created by a different version of the server (13.00.4435) than this server (14 …).

Then I downloaded MSSQL 2016 with service pack 1 by subscribing to "Visual Studio Dev Essentials" at my.visualstudio.com. Now I have the error:

.. it can not be restored because it was created by a different version of
the server (13.00.4435) that this server (13.00.4001).

So now I needed to update. I downloaded MSSQL 2016 Service Pack 2, which gave me the error:

.. it can not be restored because it was created by a different version of
the server (13.00.4435) that this server (13.00.5026).

So it really seems like I need the exact patch. However, I can not find a patch list with the corresponding server versions. Does anyone have an idea on how to find the right patch?

If you could just extract the .bak file to your .mdf- and .ldf files, that would be enough. I found a lot of tools to restore .bak files from MSSQL, but I want everyone to want to connect to a database (to do a simple restore). I would be very happy if I could get the correct version of SQL Server or extract the .bak file.

Google Sheets: extract the static value from the cell that will change later

I have a sheet where I calculate the average of a daily value of the last 30 days with a continuous average. I would like to be able to extract the daily values ​​and store them in another sheet. I want to store the static values ​​for that day. When I add to the data for the next few days, the average changes but I do not want the value stored to change.

The data source is stored in the "Workbook" sheet with a list of names and the average number of people stored in A19: A30 and B19: B30 respectively. The output must be the name with its average of a specific day. Ideally, I would like the output to be ordered in ascending order by average.

I hope this makes sense.

plot – Extract Plot data

I want to extract data from these plots.

There are many ways to extract data from the graphs (if you look, you will find good examples).

One method that I like is Evaluation Monitor Since one can control what data to extract and how to format it, even if it is not the most efficient?

Clear all[m, c, x]
subway[c_] : = {{1, -c + 1, 2}, {c, 5, c}, {2, 5, c}};
data = harvest @
Plot[Eigenvalues[m[c]]{c, 0, 1},
Evaluation monitor:> Plant[{c, Eigenvalues[m[c]]}]];
data = data[[2, 1]]

And now the data contains what you want.

    {{2.04082 * 10 ^ -8, {5., 2.56155, -1.56155}},
{0.0196287, {5.04462, 2.52608, -1.55108}},
{0.0409084, {5.09137, 2.48926, -1.53972}},
....

The first value in each row is do and the second list in each row are the proper values ​​for that do.

For example

    Own values[m[0.0196286612015304`]]

Gives

    {5.04462, 2.52608, -1.55108}

What you see is the second row at the exit. etc.

The above is basically the same as doing.

    Table[{c, Eigenvalues[m[c]]}, {c, 0, ...}]

The only difference is that you are using Plot choice of sample values ​​of do He used to make the plot, which is not known in advance.

To update

It is not possible to plot data for each line.

All the data is there. One way to trace it from the extracted data is

p1 = ListPlot[Transpose[{data[[All, 1]]data[[All, 2, 1]]}], PlotStyle -> Red];
p2 = ListPlot[Transpose[{data[[All, 1]]data[[All, 2, 2]]}], PlotStyle -> Blue];
p3 = ListPlot[Transpose[{data[[All, 1]]data[[All, 2, 3]]}], PlotStyle -> Black];
Show[{p1, p2, p3}, AxesOrigin -> {0, 0}, PlotRange -> All]

Mathematical graphics

There is probably a better way to plot the data again, but this becomes a question to plot. The point is, all the data is there.

python – Extract information from the Egyptian national identification

I did a script to extract information from the national ID of Egypt, p. Eg National ID is 14 digits ex (29501023201952). It could be divided as described below:

2 - 990115 - 01 - 0192 - 1

x - yymmdd - ss - iiig - z
  • x (2) it is the century of birth (2 represent 1900 to 1999, 3 represent 2000 to 2099, etc.)

  • yymmdd (200115) is the date of birth, yy (99) year, mm (01) month, dd (15) day

  • ss (01) coda of the governorate of birth (88 for people born in a foreign country, 01 for people born in Cairo, … etc)

  • iiig (0192) The sequence in the computer between births on this birthday and

  • g (2) It represents the gender (2,4,6,8 for females and 1,3,5,7,9).

  • z (1) Ministry of the Interior added it to validate if the national identification is false or not (1 to 9)

I'm looking for some general comments on how I can improve the structure and efficiency of my code.

import argparse
from datetime import datetime
import text

governorates = {& # 39; 01 & # 39 ;: & # 39; Cairo & # 39 ;,
& # 39; 02 & # 39 ;: & # 39; Alexandria & # 39 ;,
& # 39; 03 & # 39 ;: & # 39; Port Said & # 39 ;,
& # 39; 04 & # 39 ;: & # 39; Suez & # 39 ;,
& # 39; 11 & # 39 ;: & # 39; Damietta & # 39 ;,
& # 39; 12 & # 39 ;: & # 39; Dakahlia & # 39 ;,
& # 39; 13 & # 39 ;: & # 39; Ash Sharqia & # 39 ;,
& # 39; 14 & # 39 ;: & # 39; Kaliobeya & # 39 ;,
& # 39; 15 & # 39 ;: & # 39; Kafr El - Sheikh & # 39 ;,
& # 39; 16 & # 39 ;: & # 39; Gharbia & # 39 ;,
& # 39; 17 & # 39 ;: & # 39; Monoufia & # 39 ;,
& # 39; 18 & # 39 ;: & # 39; The Beheira & # 39 ;,
& # 39; 19 & # 39 ;: & # 39; Ismailia & # 39 ;,
& # 39; 21 & # 39 ;: & # 39; Giza & # 39 ;,
& # 39; 22 & # 39 ;: & # 39; Beni Suef & # 39 ;,
& # 39; 23 & # 39 ;: & # 39; Fayoum & # 39 ;,
& # 39; 24 & # 39 ;: & # 39; El Menia & # 39 ;,
& # 39; 25 & # 39 ;: & # 39; Assiut & # 39 ;,
& # 39; 26 & # 39 ;: & # 39; Sohag & # 39 ;,
& # 39; 27 & # 39 ;: & # 39; Qena & # 39 ;,
& # 39; 28 & # 39 ;: & # 39; Aswan & # 39 ;,
& # 39; 29 & # 39 ;: & # 39; Luxor & # 39 ;,
«31»: «Red Sea»,
& # 39; 32 & # 39 ;: & # 39; New Valley & # 39 ;,
& # 39; 33 & # 39 ;: & # 39; Matrouh & # 39 ;,
& # 39; 34 & # 39 ;: & # 39; North Sinai & # 39 ;,
& # 39; 35 & # 39 ;: & # 39; South Sinai & # 39 ;,
& # 39; 88 & # 39 ;: & # 39; Foreigner & # 39;

fake_national_id_message = & # 39; This ID is not valid & # 39;

def extract_birth_century (birth_century_code: int) -> int:
""
extract the century of birth from the national identification is in index 0
: param birth_century_code: one digit
: return: birth century
""
affirm the type (birth_century_code) == int, & # 39; the code of the birth century must be int value & # 39;
current_century = get_century_from_year (int (datetime.now (). year))
birth_century = birth_century_code + 18
affirm (birth_century> = 19) and (birth_century <= current_century), fake_national_id_message
    return birth_century


def get_century_from_year(year):
    return year // 100 + 1


def convert_birthdate(birthdate: str) -> str:
""
Convert birthday into national ID from fromat yymmdd to yyyy - mm - dd format
is from index 0 to 6 in the national identification of EG
: param date of birth: str
Format cyymmdd, c represents the birth century code
: return: str
aaaa-mm-dd
""
affirm len (str (date of birth)) == 7, "the date of birth must be 7 digits"
birth_century = extract_birth_century (int (date of birth)[0]))
birth_year = date of birth[1:3]
    birth_month = date of birth[3:5]
    birth_day = date of birth[5:]
    birth_full_year = (birth_century * 100) - 100 + int (birth_year)
birthdate_str = & # 39; {0} - {1} - {2} & # 39 ;. format (birth_full_year, birth_month, birth_day)
birthdate_date = datetime.strptime (birthdate_str, & # 39;% Y-% m-% d & # 39;)
affirm date of birth <= datetime.now() and birthdate_date >= datetime.strptime (& # 39; 1900-01-01 & # 39 ;, & # 39;% Y-% m-% d & # 39;), fake_national_id_message
back birthdate_str


def get_birth_governorate (birth_governorate_coda: str) -> str:
""
: param birth_governorate_coda:
Index 7 and 8 in national ID of EG
: return: str
Birth governorship

""
affirm type (birth_governorate_coda) == str, & # 39; The birth control coda must be a non-whole string & # 39;
affirm len (birth_governorate_coda) == 2, & # 39; The coda of the birth government must have 2 digits & # 39;
affirm birth_governorate_coda in governorates, & # 39; Coda of birth government is not valid & # 39;
return governorates[birth_governorate_coda]


def get_gender (gender_code: int) -> str:
""
: param gender_code:
Index 12 in EG National ID

: return: str
Gender
""
Assign type (gender code) == int and gender code> 0 and gender_code <= 9, & # 39; invalid gender code & # 39;
if gender_code% 2 == 0:
come back & # 39; feminine & # 39;
plus:
come back & # 39; Man & # 39;


def extract_info_from_national_id (national_id: int):
""
Extract national ID information from national EG
: param national_id: int
National ID of EG must be a 14-digit number
: back: dict
birth center
birthdate
birth_governorate
sequence_in_computer
gender
""
affirm the type (national_id) == int, "The national ID must be non-string numbers"
affirm len (str (national_id)) == 14, "The national ID must be number 14"
national_id_str = str (national_id)
info = {}
info['birth_century'] = extract_birth_century (int (national_id_str[0]))
info['date_of_birth'] = convert_birthdate (national_id_str[0:7])
info['birth_governorate'] = get_birth_governorate (national_id_str[7:9])
info['sequence_in_computer'] = national_id_str[9:13]
    info['gender'] = get_gender (int (national_id_str)[12]))
# last_number = national_id_str[13]
    return information


def print_info (information):
print (& # 39; Century of birth: & # 39 ;, information['birth_century'])
print (& # 39; Date of birth: & # 39 ;, information['date_of_birth'])
print (& # 39; Birth Governorate: & # 39 ;, information['birth_governorate'])
print (& # 39; Genre: & # 39 ;, information['gender'])


yes __name__ == & # 39; __ main __ & # 39;
parser = argparse.ArgumentParser (formatter_class = argparse.RawDescriptionHelpFormatter,
description = textwrap.dedent (& # 39; & # 39; & # 39; 
Extract information from the national identification of Egypt
-----------------------------------------
Century of birth
Birthdate
Birth governorship
Gender

& # 39; & # 39; & # 39;))
parser.add_argument (& # 39; national_id & # 39 ;, type = int,
help = "Add the Egyption National ID 14 digits")
args = parser.parse_args ()
info = extract_info_from_national_id (args.national_id)
print_info (info)

How can I extract coins in the bitcoin sv test node?

I have created a test node with Bitcoin SV but I can not get coins from any tap.

Is there any way to mine currency in node?

javascript – Extract useMemo to your own personalized hook

I wanted to know if the useMemo function extracted in this way is valid at all. This is a complete component (forgiveness for imports) used by useMemo to obtain data that is extracted from the server through GraphQL and react-apollo-hooks.

I extracted the useMemo to avoid swelling in the real component.

/ **
* The list of qualifications that the teacher must choose first.
* /

import React, {useMemo, memo} from & # 39; react & # 39 ;;
to import {
Paper,
Table,
Tablehead,
Row of the table,
TableCell,
TableBody,
Button,
} from & # 39; @ material-ui / core & # 39 ;;
import {useQuery} from & # 39; react-apollo-hooks & # 39 ;;

import the container from & # 39; ../../../ components / Container & # 39 ;;
import {GET_ALL_GRADES, Qualifications} from & # 39; ../../../ graphql / grades & # 39 ;;
import {useAuth} from & # 39; ../../../ auth / index & # 39 ;;
amount {RouteComponentProps, NavigateFn} from & # 39; @ reach / router & # 39 ;;

UseGradesData function (data: Qualifications[], navigate: NavigateFn) {
returns useMemo (() => {
yes (! data) {
return & # 39; & # 39 ;;
}
returns data.map (grade => {
he came back {
async listSubjectFromGrades () {
wait to navigate (`/ list / $ {grade.gradeId}`);
}
...grade,
};
});
} [data, navigate]);
}

Grade function (props: RouteComponentProps) {
const tenantId =
useAuth (). tenantIds[0] || & # 39; c96bcd70-70bc-4e66-b47d-88a066912a77 & # 39 ;;
const {data, loading} = useQuery (GET_ALL_GRADES, {
variables: {
tenant
}
}) as {data: qualifications[]; loading: boolean};

const mappedData = useGradesData (data, props.navigate!);

if (loading) {
he came back 

Loading

; } he came back ( # Name of the Degree Action {!! mappedData && mappedData.map ((degree, index) => ( {index + 1} {grade.name} ))}
); } export by default memo (Grade);

In addition, we invite you to detect any other improvement in the entire code.

The search API with Solr will not show extract

I am creating a search results page using the search API with a Solr backend provided by Pantheon.

I can not make the extract appear on the results page based on views. I have disabled all processors for the index. I have the extract and highlighting features enabled for the server.

While playing, I found that the extract will appear if I enable the Stemmer processor. However, all the words are incomplete, only the first letters show. For example, a search for "athleticism" is shown as "athleticism".

Any idea why Solr is not serving a usable extract?

encryption – Question: Tool to extract a password from a long string of characters?

This could be a silly and strange question, but I'm curious …

Are there tools / techniques to distinguish passwords from a long string of characters?

For example, in the following character string, there are user names and passwords:

Facebook, stack exchange, tutanote, some personal mailboxes, ebay, github, paypal, binance, coinbase, proton, expressvpn.

| R4I | kRe: dY $ mic4K7Ky {R% 7 $ v]E |Y ^ 2u; *% MPmDSK ^ bkgtrNM @ m% b | qzO | andxWMwisehWsS 7! | RiC[2pSeghb:IvdR5Bg)>jQL/|bUs[2pSeghb:IvdR5Bg)>jQL/|bUsjQL / | bUs <i "zH8Tj! 9R3 $ iXBTCXwZqC4 || # knP5Nfbkx[Physicaleducation[pe[Educaciónfísica[pe_FY90R7y | RY5Ft "NJcbse2 2 ^ Xqq1mZI15I | Gnm" Lq2wStonD.l3V.sz $ WS) | W) RiMy2mtutaq2 \ J.% iI) FDB | @ yzngK @ _6fcb .., qDS "NDVQ]V | Ffh% a ~ <DavBfix3O5J * 3RGE5f | rlSX @ iK0brk "Y7GLsryMI = c[O|4evNIv?Skch[O|4evNIv?Skch[O|4evNIv?Skch[O|4evNIv?skchx6dt_Mk | 3? p *> $ SK5vbnceh & E3w1oBE]P | 3m; Y1T / bayweS 2% nn? h $ – ~ k |) L7LdO "L (expr, $ b! btic2 / + @ 6 | QrT! & 9P rheart]IQ ,.) UjaNycU |

(No real passwords, just one example.) The original file consists of more than 30 passwords, but is in the exact model)

I can easily take each of these codes and use them for any account that I need.
All this is in plain text in a password protected file, placed on my desktop (for quick access through the terminal)

If my system based on Debian is compromised, is it possible for someone to obtain this file and decrypt these passwords and take charge of my accounts?

  1. The way I use passwords is to copy / paste. Not sure if this is being stored somewhere in the system?

  2. The way I extract these passwords with commands in the terminal is saved in the .bash_history file and maybe in another place? As if someone were reading the bash history, it will be quite easy to discover how I break down the passwords of each account. So, I guess I can stop the bash to record and store commands, or assign it to be owned and accessed only by root?

Has anyone thought of this way of storing passwords instead of using password managers?

Or should I not use it this way and delete the file, if it is vulnerable?

Anyway, to extract Sharepoint lists directly with a Java program to extract large amounts of data without first exporting to Excel?

Does anyone know if there is any way to extract SharePoint lists directly using a Java program? I would like my program to automatically extract SharePoint data from time to time that I would configure on my own, however, I am having problems trying to recover the data in the first place, even to start doing something with that data. I'm sorry if some of this is vague, but my main question is again: does it exist anyway to extract data with a Java program directly from SharePoint? Thank you.

jquery – How to extract the properties of a named function in javascript?

var detalle_subgrid = function (index, parentElement, gridElement, record) {

var values_detalle;
var datafields_detalle = new Array ();
var columns_detalle = new Array ();
ID of var = $ ("# gvData"). iqxGrid (& # 39; getrowdata & # 39 ;, index)['id_Perona'];
var grid = $ ($ (parentElement) .children ()[0]);

$ .ajax ({
type: "POST",
Data type: "json",
url: "frm¨Persona.aspx / ListarPersona",
contentType: "application / json; charset = utf-8",
date: & # 39; {id_person: & # 39; & # 39; + id + & # 39; & # 39;} & # 39 ;,
asynchronous: false,
success: function (date) {


yes (data! = & # 39; & # 39;) {

values_detalle = data.d;
values_detalle = JSON.parse (values_detalle);
console.log (details_values);
for (var x in values_detalle[0]) {
datafields_detalle.push ({name: x});
columns_detalle.push ({text: x, data field: x, align: & # 39; center & # 39 ;, minwidth: 100});

}

}

var nestedGridSource =
{

Data type: & # 39; json & # 39 ;,
Data fields: datafields_detalle,
localdata: values_detalle, //data.d
asynchronous: false
};

var nestedGridAdapter = new $ .jqx.dataAdapter (nestedGridSource);

yes (grid! = null) {
grid.jqxGrid ({
Source: nestedGridAdapter,
width: & # 39; 94% & # 39 ;,
Height: 220,
columnsresize: true,
Automatic height: false,
autorowheight: false,
altrows: truth,
columns: detail_colors

});
}

}
error: function (error) {
alert (error.responseText);
console.log (error.responseText);
jsonValue = jQuery.parseJSON (Error.responseText);
alert (error.respose.Text);
alert ("Error");
}
});
}


// Here, outside the operation, I try to access its properties but it does not show me the result it contains.

console.log (detail_subgrid.values_detalle);