8 – composer require error: can’t delete default.services.yml

Make your “local” machine work as intended

This approach will fix the issue on your local machine. The default .gitignore will limit the change to your local (it will persist on your local without affecting anyone else; don’t make this change to settings.php to avoid affecting other instances, including PROD).

Steps

  1. enable settings.local.php (here are the instructions from the docblock in settings.local.php):
 * To activate this feature, copy and rename it such that its path plus
 * filename is 'sites/default/settings.local.php'. Then, go to the bottom of
 * 'sites/default/settings.php' and uncomment the commented lines that mention
 * 'settings.local.php'.
 *
 * If you are using a site name in the path (... read about exceptions in file)
  1. set file permissions to allow user to write to the file:

    $ chmod u+w {name_of_docroot}/sites/default

  2. find and change $settings('skip_permissions_hardening'); make it = TRUE;

Step #3 tells Drupal not to reset permissions on the default folder only on your local, and allows you to work more smoothly with composer on your local without loosening permissions on any other copy of the codebase.

Does Google Gsuite require both the domain and hosting?


I have had gsuite for about 7 yrs now and have the free legacy plan, i recently retired and canceled my business, my domain and the hosting both expired on the 27th and that is when i stopped getting emails through gmail. I logged into ******** to check my domain settings and found that it was pointed to cloudflare, and in there i noticed the google MX settings were set.

This particular email address has been my main for well 7 yrs so i dont want to lose it, do i need to renew the domain, the hosting or both in order to have emails come through again?

I can still send emails though, i did a test and it went to another account i have, why does sending work?

python – Rewriting code so functions don’t require super long entries

I have 2 scripts, one is a tkinter GUI script where the user gives specific inputs, the 2nd script takes those inputs, does some modification, and then sends it back to the GUI script to be written/results printed. However, in dealing with multiple user inputs, the entries for the functions started getting longer and longer, and uglier. As you’ll see in the GUI script, when I use the function I imported, it has 7 entries which make it quite long. Is there a better way to call user inputs from one script to another?

#GUI Script (NOTE: I'm not posting all the global and input functions, since they are basically the same thing. Don't want to be reptitious)
#basic tkinter setup root=tk.Tk() with the loop and everything setup

#globals where filenames and directories to files are saved, to be called on in the functions
sparta_file=()
sparta_directory=()
seq_file=()
seq_directory=()
#browse options to choose files
def input_file():
    fullpath = filedialog.askopenfilename(parent=root, title='Choose a file')
    global sparta_directory
    global sparta_file
    sparta_directory=os.path.dirname(fullpath)
    sparta_file= os.path.basename(fullpath)
    label2=Label(root,text=fullpath).grid(row=0,column=1)

def input_seq():
    fullpath = filedialog.askopenfilename(parent=root, title='Choose a file')
    global seq_file
    global seq_directory
    seq_directory=os.path.dirname(fullpath)
    seq_file= os.path.basename(fullpath)
    label3=Label(root,text=fullpath).grid(row=1,column=1)
#All the user inputs are designed more or less the same, user browses, clicks on file, and files directory and filename are saved as globals. 

#function that will be run to use user inputs, modify them, and then write modifications
def sparta_gen_only():
        from sparta_file_formatter import check_sparta_file_boundaries
        os.chdir(save_directory)
        with open(save_file_sparta,'w') as file:
            for stuff_to_write in check_sparta_file_boundaries(seq_file,seq_directory,mutation_list1,mutation_list2,sparta_file,sparta_directory,seq_start):
                file.write(stuff_to_write+'n')

So right off the bat, you can see the exact issue I’m having (check_sparta_file boundaries has a lot of inputs).

#2nd sparta_file_formatter
import re
import os



def create_seq_list(seq_file,seq_directory,seq_start):
    os.chdir(seq_directory)
    amino_acid_count=(0+seq_start)-1
    sequence_list=()
    with open(seq_file) as sequence_file:
        for amino_acid in sequence_file:
            stripped_amino_acid=amino_acid.strip().upper()
            for word in stripped_amino_acid:
                amino_acid_count+=1
                sequence_list.append(str(amino_acid_count)+word)
    return sequence_list

def format_sparta(sparta_file,sparta_directory):
    os.chdir(sparta_directory)
    sparta_file_list1=()
    proline_counter=0
    with open(sparta_file) as sparta_predictions:
        for line in sparta_predictions:
            modifier=line.strip().upper()
            if re.findall('^d+',modifier):
                A=modifier.split()
                del A(5:8)
                del A(3)
                A(0:3)=("".join(A(0:3)))
                joined=" ".join(A)
                proline_searcher=re.search('BP',joined)
                if proline_searcher != None:
                    proline_counter+=1
                    if proline_counter<2:
                        proline_count=re.search('^d+',joined)
                        sparta_file_list1.append(f'{proline_count.group(0)}PN'+' 1000'+' 1000')
                    else:
                        if proline_count == 4:
                            proline_count=re.search('^d+',joined)
                            sparta_file_list1.append(f'{proline_count.group(0)}PHN'+' 1000'+' 1000')
                            proline_counter=0
                sparta_file_list1.append(joined)
    return sparta_file_list1

#Each function the entries get longer and longer as they start using the outputs of the previous functions
def add_mutation(mutation_list1,mutation_list2,sparta_file,sparta_directory):
    sparta_file_list2=()
    if mutation_list1==() or mutation_list2==():
        for amino_acids in format_sparta(sparta_file,sparta_directory):
            sparta_file_list2.append(amino_acids)
    else:
        for mutations,mutations2 in zip(mutation_list1,mutation_list2):
            for amino_acids in format_sparta(sparta_file,sparta_directory):
                if re.findall(mutations,amino_acids):
                    splitting=amino_acids.split()
                    mutation=re.sub(mutations,mutations2,splitting(0))
                    mutation_value=re.sub('d+.d+',' 1000',splitting(1))
                    mutation_value2=re.sub('d+.d+',' 1000',splitting(2))
                    mutation_replacement=mutation+mutation_value+mutation_value2
                    sparta_file_list2.append(mutation_replacement)
                else:
                    sparta_file_list2.append(amino_acids)
    return sparta_file_list2

def filter_sparta_using_seq(seq_file,seq_directory,mutation_list1,mutation_list2,sparta_file,sparta_directory,seq_start):
    sparta_file_list3=()
    sparta_comparison=create_seq_list(seq_file,seq_directory,seq_start)
    for aa in add_mutation(mutation_list1,mutation_list2,sparta_file,sparta_directory):
        modifiers=aa.strip()
        splitter=modifiers.split()
        searcher=re.search('^d+(A-Z)',splitter(0))
        compiler=re.compile(searcher.group(0))
        sparta_sequence_comparison=list(filter(compiler.match,sparta_comparison))
        if sparta_sequence_comparison != ():
            sparta_file_list3.append(aa)

    return sparta_file_list3


def check_sparta_file_boundaries(seq_file,seq_directory,mutation_list1,mutation_list2,sparta_file,sparta_directory,seq_start):
    temp_list=()
    temp_counter=0
    sparta_filtered_list=filter_sparta_using_seq(seq_file,seq_directory,mutation_list1,mutation_list2,sparta_file,sparta_directory,seq_start)
    for checker in sparta_filtered_list:
        temp_modifier=checker.strip()
        temp_split=temp_modifier.split()
        temp_finder=re.search('^d+',temp_split(0))
        temp_list.append(temp_finder.group(0))
        temp_counter+=1
        if temp_counter==5:
            if int(temp_finder.group(0))==int(temp_list(0)):
                break
            else:
                del sparta_filtered_list(0:4)
                break
    if len(sparta_filtered_list)%6 != 0:
        del sparta_filtered_list(-5:-1)

    return sparta_filtered_list

Edit:

In terms of exactly what sparta is and what my code is doing. I won’t go into too much detail regarding sparta, outside of it is a text file with information we want. This is the format:

REMARK SPARTA+ Protein Chemical Shift Prediction Table
REMARK  All chemical shifts are reported in ppm:
....

   3    Y   HA     0.000     4.561     4.550     0.018     0.000     0.201
   3    Y    C     0.000   175.913   175.900     0.021     0.000     1.272
   3    Y   CA     0.000    58.110    58.100     0.017     0.000     1.940
   3    Y   CB     0.000    38.467    38.460     0.011     0.000     1.050
   4    Q    N     3.399   123.306   119.800     0.179     0.000     2.598
...

We only care about the lines with the numbers, so I use a regex search to only extract that. Now the info I want is the first 3 columns, with the 4 column. I want each data formatted 3YHA 4.561 (2nd function). Now every number should have 6 values associated with it, those that are P, will only have 4, so I add 2 extra values (you may note in the above, the format is HA,C,CA,CB,etc. So I add the values so the format of P is N,HA,C,CA,CB.

Sometimes the user will wish to change a specific letter (mutation). So they indicate which letter, the number, and what to change it to (3rd loop).

Finally, these files can sometimes have extra info we don’t care about. The user specifies the range of info they want by using a seq file (1st and 4rd loop).

As stated, every letter should have 6 values. However, the first letter will always have 4. The last letter will also only have 5. So these need to be removed (loop 5).

Here is some sample input files as examples:

seq_number=1
#seq.txt
MSYQVLARKW
#sparta_pred.tab
   3    Y   HA     0.000     4.561     4.550     0.018     0.000     0.201
   3    Y    C     0.000   175.913   175.900     0.021     0.000     1.272
   3    Y   CA     0.000    58.110    58.100     0.017     0.000     1.940
   3    Y   CB     0.000    38.467    38.460     0.011     0.000     1.050
   4    Q    N     3.399   123.306   119.800     0.179     0.000     2.598
   4    Q   HA     0.146     4.510     4.340     0.039     0.000     0.237
   4    Q    C    -2.091   173.967   176.000     0.097     0.000     0.914
   4    Q   CA    -0.234    55.623    55.803     0.092     0.000     1.065
   4    Q   CB     3.207    32.000    28.738     0.092     0.000     1.586
   4    Q   HN     0.131     8.504     8.270     0.173     0.000     0.484
   5    V    N     0.131   120.091   119.914     0.078     0.000     2.398
   5    V   HA     0.407     4.575     4.120     0.080     0.000     0.286
   5    V    C     0.162   176.322   176.094     0.109     0.000     1.026
   5    V   CA    -1.507    60.840    62.300     0.078     0.000     0.868
   5    V   CB     0.770    32.625    31.823     0.052     0.000     0.982
   5    V   HN     0.418     8.642     8.190     0.057     0.000     0.443
   6    L    N     7.083   128.385   121.223     0.130     0.000     2.123
   6    L   HA    -0.504     4.085     4.340     0.415     0.000     0.217
   6    L    C     1.827   178.814   176.870     0.195     0.000     1.081
   6    L   CA     3.308    58.271    54.840     0.205     0.000     0.772
   6    L   CB    -1.005    41.051    42.059    -0.005     0.000     0.890
   6    L   HN     0.241     8.694     8.230     0.097    -0.164     0.437
   7    A    N    -4.063   118.812   122.820     0.092     0.000     2.131
   7    A   HA    -0.337     4.023     4.320     0.067     0.000     0.220
   7    A    C     0.433   178.071   177.584     0.090     0.000     1.158
   7    A   CA     2.471    54.552    52.037     0.073     0.000     0.665
   7    A   CB    -0.332    18.690    19.000     0.036     0.000     0.795
   7    A   HN    -0.517     7.889     8.150     0.063    -0.219     0.460
   8    R    N    -4.310   116.247   120.500     0.096     0.000     2.191
   8    R   HA    -0.056     4.313     4.340     0.048     0.000     0.196
   8    R    C     2.152   178.488   176.300     0.060     0.000     0.991
   8    R   CA     1.349    57.485    56.100     0.060     0.000     1.075
   8    R   CB     0.834    31.147    30.300     0.023     0.000     1.040
   8    R   HN     0.244     8.408     8.270     0.109     0.172     0.526
   9    K    N     0.144   120.608   120.400     0.108     0.000     2.283
   9    K   HA    -0.130     4.148     4.320    -0.069     0.000     0.202
   9    K    C     0.691   177.214   176.600    -0.129     0.000     1.048
   9    K   CA     2.415    58.707    56.287     0.008     0.000     0.948
   9    K   CB    -0.114    32.430    32.500     0.074     0.000     0.742
   9    K   HN    -0.617     7.728     8.250     0.159     0.000     0.458
  10    W    N    -4.007   117.283   121.300    -0.016     0.000     2.846
  10    W   HA     0.195     4.850     4.660    -0.009     0.000     0.391
  10    W    C    -1.455   175.056   176.519    -0.013     0.000     1.011
  10    W   CA    -1.148    56.191    57.345    -0.011     0.000     1.832
  10    W   CB     0.166    29.622    29.460    -0.007     0.000     1.151
  10    W   HN    -0.634     7.728     8.180     0.377     0.045     0.582
  11    R    N     1.894   122.475   120.500     0.134     0.000     2.483
  11    R   HA    -0.096     4.293     4.340     0.083     0.000     0.329
  11    R    C    -1.368   174.959   176.300     0.045     0.000     0.961
  11    R   CA    -0.713    55.431    56.100     0.073     0.000     1.041
  11    R   CB     0.187    30.506    30.300     0.033     0.000     0.930
  11    R   HN    -0.880     7.272     8.270     0.107     0.182     0.413
  12    P   HA    -0.173     4.278     4.420     0.051     0.000     0.257
  12    P    C    -1.027   176.281   177.300     0.014     0.000     1.162
  12    P   CA     0.741    63.865    63.100     0.040     0.000     0.762
  12    P   CB     0.046    31.768    31.700     0.036     0.000     0.753
  13    Q    N     1.152   120.951   119.800    -0.001     0.000     2.396
  13    Q   HA     0.193     4.514     4.340    -0.032     0.000     0.220
  13    Q    C     0.275   176.261   176.000    -0.024     0.000     0.900
  13    Q   CA     0.394    56.181    55.803    -0.027     0.000     0.925
  13    Q   CB     2.516    31.223    28.738    -0.051     0.000     1.065
  13    Q   HN     0.012     8.472     8.270     0.002    -0.188     0.535

california – COVID-19: Does driving from Lee Vining to Fresno require a Yosemite Reservation?

I’m planning an RV trip from San Diego and we have RV Site reservations on the western Sierra, near Oakhurst.

There are many attractions we’d like to see on the Eastern side of the Sierra Nevada, so I’m considering taking an extra day and going “the long way” up Highway 395, instead of straight-shooting through Bakersfield and Fresno.

The website says that even entering Yosemite for day-use requires a reservation (we are in June 2020, “phased reopening” stage of the coronavirus pandemic).

My point of confusion is this: Does traveling through the Tioga Pass along Highway 120, and then south on Highway 41, require actually entering and traversing Yosemite National Park, and hence requiring a reservation that I don’t have and is very hard to get? Or can we just stay on the public highway and never enter the park?

Why does Integer Based SQL Injection still require single quote in the parameter (‘)?

This is the source code of Damn Vulnerable Web Application (DVWA).

nl /var/www/dvwa/vulnerabilities/sqli/source/low.php

 7      $id = $_GET('id');
 8  
 9      $getid = "SELECT first_name, last_name FROM users WHERE user_id = '$id'";

mysql

mysql> DESC users;
+------------+-------------+------+-----+---------+-------+
| Field      | Type        | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| user_id    | int(6)      | NO   | PRI | 0       |       | 
| first_name | varchar(15) | YES  |     | NULL    |       | 
| last_name  | varchar(15) | YES  |     | NULL    |       | 
| user       | varchar(15) | YES  |     | NULL    |       | 
| password   | varchar(32) | YES  |     | NULL    |       | 
| avatar     | varchar(70) | YES  |     | NULL    |       | 
+------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> 

The user_id or id in users table is actually an integer type. So, this is an Integer based SQL Injection.

Based on Joe McCray presentation in Def Con on page 23, ' not required for Integer based injection.

However, when I tested it on DVWA without ', I did not get Unknown column '100' in 'order clause' message.

http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1 ORDER BY 100-- &Submit=Submit#

Output (No error)

ID: 1 ORDER BY 100-- 
First name: admin
Surname: admin

Then, I decided to test it with ' and it worked.

http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1' ORDER BY 100-- &Submit=Submit#

Error Message

Unknown column '100' in 'order clause'

Didn’t ' not required in this example (integer based injection)?

shadowrun sr5 – A sustained spell should require multiples drain resistance checks?

We are playing a Shadowrun 5 campaign. When a mage cast a spell, it should roll a Drain resistance check. The GM is requiring multiple drain checks, one for each turn the mage sustain the spell (in case of sustained spells). But I don’t think that a spell requires multiples checks, just one right after casting the spell. What’s the correct rule?

http – Getting numerous HEAD requests by Java user agents to resources that require authentication to view within a web application. Should I block them?

I have recently started using Cloudflare’s firewall in front of a web application. This app has a limited user base of selected applicants and they must log in to view anything. There is no public registration form and nothing within the portal can be accessed without an account.

Since moving the DNS to Cloudflare I can see we are receiving numerous daily HEAD requests to paths that are only accessible within the portal.

These requests come from one of two groups of IP addresses from the United States (we are not a US-based company; our own hosting is based in AWS Ireland region and we’re pretty sure at least 99% of our users have never been US-based):

Java User Agents

Empty User Agent

  • No user agent string.
  • The ASN is listed as Amazon Web Services.
  • The IP addresses have very little reported activity and do not seem at all connected to the Java requests.

Other Notes

  • The resources being requested are dynamic URLs containing what are essentially order numbers. We generate new orders every day, and they are visible to everyone using the portal.
  • I was unable to find any of the URLs indexed by Google. They don’t seem to be publicly available anywhere. There is only one publicly accessible page of the site, which is indexed.
  • We have potentially identified one user who seems to have viewed all the pages that are showing up in the firewall logs (we know this because he shows up in our custom analytics for the web app itself). We have a working relationship with our users and we’re almost certain he’s not based in the US.

I am aware that a HEAD request in itself is nothing malicious and that browsers sometimes make HEAD requests. Does the Java user agent, or lack of a user agent in some cases, make this activity suspicious? I already block empty user agents and Java user agents through the firewall, although I think Cloudflare by default blocks Java as part of its browser integrity checks.

Questions

  1. Is there any reason why these might be legitimate requests that I shouldn’t block? The fact it’s a HEAD request from a Java user agent suggests no, right?

  2. One idea we had is that one of the users is sharing links to these internal URLs via some outside channel, to outsource work or something. Is it possible some kind of scraper or something has picked up these links and is spamming them now? As I say, I was unable to find them publicly indexed.

  3. Is it possible the user we think is connected has some sort of malware on their machine which is picking up their browser activity and then making those requests?

  4. Could the user have some sort of software that is completely innocent which would make Java based HEAD requests like this, based on their web browsing activity?

Any advice as to how I should continue this investigation? Or other thoughts about what these requests are?

dnd 3.5e – Does “Claw at the Moon” require the character to make a normal attack roll in addition to the Jump check?

Claw at the Moon’s description states the following:

ToB p.86

As part of this maneuver, you attempt a Jump check to leap into the
air and make a melee attack
that targets your foe’s upper body, face,
and neck. The Jump check’s DC is equal to your target’s AC. If this
check succeeds, your attack deals an extra 2d6 points of damage. If
this attack threatens a critical hit, you gain a +4 bonus on your roll
to confirm the critical hit.

If your check fails, you can still attack, but you do not deal extra
damage or gain a bonus on a roll to confirm a critical hit. The
maneuver is still considered expended.

I have two interpretations of this maneuver’s effect:

  1. You get to make a Jump check and a normal attack roll, if the check fails, you only take into account the normal attack roll and don’t have any additional bonuses.
  2. You only make the Jump check to determine the attack roll (since the DC of the roll is the enemy’s AC, it would make sense), and only if you fail, you can make a normal attack roll and attack normally.

Logic dictates that the first interpretation is the correct one and that the second one is a tad overpowered, but I’ve been wrong before. Which interpretation is the correct one?

Does SQL Server really require fully qualified object references to match a statement to a cached execution plan

From SQL Server Docs, section Execution Plan Caching and Reuse:

The algorithms to match new SQL statements to existing, unused execution plans in the cache require that all object references be fully qualified. For example, the first of these SELECT statements is not matched with an existing plan, and the second is matched:

SELECT * FROM Contact

SELECT * FROM Person.Contact

Is the above statement also true for object references that use the default dbo? The reason I ask is because I personally never fully qualify object references (and I assume most people don’t) even when using a driver like JDBC. Does this mean that all of my SQL statements are being re-compiled every time they’re executed?