0

I've checked event log etc. If this helps, some programs that run in the notification area have occasional animated icons; when I must restart the computer those notification icons stop animating they stick.

I was asking about the event log to understand if there is a report of something crashing while these processes are running, like a driver or a PCI resource conflict. Have you added or changed hardware since this issue raised?

When download a large file or backing up my computer, it's typical the computer restarts; if this information helps ?

It could be the network adapter, see if you can find a tool to make a specific diagnostic of it, as suggested before. However to be sure about the integrity of the card you should test another one or, if attached to a PCI interface, try to move it to another slot and see if it makes any difference (in case of resource conflict).

@downvoter
I don't know what to do with a downvote, downvote if you want, but explain me what's wrong with my answer, otherwise I cannot improve. Thank you!

2

Hi,

probably putting the server offline, removing the disk and accessing it in readonly mode from an OS that will not execute any of the code in that disk could be a starting point to backup what is still available.

It's important to make sure it cannot spread in your lan, through wifi or shared folders.

For the removal and recovering it depends on the version that affected your server, see if this helps: https://www.pcrisk.com/removal-guides/11217-amnesia-ransomware

Bye.

1

In other words you want to return back the new name of the uploaded file? In the PHP script you can send a JSON response with the filename, so move line 12 to 11 and replace the echo with:

header('Content-type: application/json');
echo json_encode(['target_file' => $targetFile]);

and use the success event in DropzoneJS to get the response from the server:

Then use javascript to parse JSON and compile a list of uploaded files as (hidden) inputs... but start with something easier: print the response.

By the way, time() will not prevent overwrites.

0

The name is well defined, otherwise you would get an exception:

Route [navcolor] not defined.

The error message says Call to undefined function routes(), which in other words means that the function you are trying to call does not exists. Have you read the documentation? I posted the link for you in my previous message. You already have the solution, you could have solved this hours ago.

0

Hi,

supposing you are not trying to load a user defined function named routes(), have you read the documentation? https://laravel.com/docs/5.5/routing#named-routes and the source in which this function should be defined? Does exists?

Use an editor that can autocomplete the code, in SublimeText for example, when you hover a method/function it shows you in which files this is defined and you can click it to see the code. Also add a linter plugin to enlight obvious mistypes and forgotten operators.

1

Hi!

I remember reading that there was a failure point on SSL as antiviruses were performing a MITM against browsers to verify the contents of connected pages. In practice they used to replace certificates in the client machine. Is this still an issue? See: http://ieeexplore.ieee.org/document/6956558/

Anyway, just a drop in the ocean.

Votes + Comments
AV vendors installing their own root certificates was always a recipe for disaster. I don't use AV products so I'm not really up to date on this
2

This board has been most helpful to me! I learned that the term "serial numbers", although not a big deal to me, can be taken very seriously by scammers and I need to simply change serial numbers to first and last names when asking for help, to weed out any potential scammers asking why, why, why, why and hiding behind XY problem. Of course they are going to ask why, they want to know if I am stupid enough to give out "real serial numbers".

uh :o are you sure it was not just too young and eager to help? A part Skype & co. I had few questions too about your task, because, for example, for me it was not clear enough how input was structured (basically type and size: alphanumeric, integer, with spaces, splitted in multiple files and to be considered as a whole or repetitions and uniqueness for each file...) and how to output. For example, depending on method awk, from command line could work fine to identify repetitions. Along with rproffitt's suggest about uniq.

0

It's a shared hosting, , so I don't have access to a server config file

Okay, then you may want to ask to their support. The AllowOverride property is not always enabled for security and performance purposes, as Apache needs to scan the contents of each .htaccess along the folder tree and reset the rules accordingly.

virtualhost then got the <Directory>

oh my «got» o_o

0

Hi!

If you have access to the configuration file for the virtualhost then got the <Directory> and set AllowOverride to All:

<Directory /path/to/www/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
</Directory>

Remember to adjust the options to your needs, the above example will show directory contents and so on... If you can choose the web server, then try Caddy, the community version is free and works good. It supports HTTP/2 and LetsEncrypt by default: https://caddyserver.com/

0

Whoops, now I see , sorry I was distracted by the null values. The redirect does not solve the problem, it just overrides. The warning happens because in your view the loop starts anyway and you are suppling a string when instead it expects an array or an object:

foreach ($result as $record):

Instead of $query->result() from the model return the object:

function read($where, $length, $start) {
    $this->db->limit($length, $start);
    return $this->db->get_where('myguestbook', $where);
}

this way you can cache it, use the custom result object and, in your controller, use the attached methods like num_rows():

$li = [];
$int = 0;
$template = '<li>user: %s<br>email: %s<hr></li>';

if(0 < $result->num_rows())
{
    foreach ($result as $record)
    {
        $li[$int++] = sprintf($template, $record->user, $record->email);
    }
}

$data['result'] = $li;
$data['result_count'] = $result->num_rows();

And in the view just run:

if(0 < $result_count)
{
    echo implode(PHP_EOL, $result);
}

else
{
    echo '<p>No record exists</p>';
}

Thanks to you for your reply, bye!

0

Hi Andris,

you may want to use SELECT ... INTO OUTFILE 'file_name_here' and perhaps use CONCAT() to create the query, if you do:

set @file = concat('/tmp/file_', UNIX_TIMESTAMP(), '.log');
select 'hello' into outfile @file;

It will not work, so you have to do:

set @file := concat("/tmp/file_", UNIX_TIMESTAMP(), ".log");
set @query := concat("select 'hello' into outfile '", @file, "'");
prepare stmt from @query;
execute stmt;
deallocate prepare stmt;

As suggested here:

But it's mandatory that the destination file does not exists, otherwise the query will fail, this is done to avoid overwriting files with random content. The alternative, if you want to append results, for example, is to use mysqldump or something like this:

mysql -uVAR -pVAR -e "SELECT 'hello';" > /tmp/random.log

To execute, if using PHP, from exec().

// Edit
But looking at previous answers, now I'm not sure is this you where searching for.

0

Hi,

according to the source of the get_where() method in system/database/DB_query_builder.php, sending NULL is acceptable as it would skip to set the WHERE conditions. So looking at your code:

$data['result'] = $this->myguestbook_model->read(null, null, null);

It seems it should work fine. So, in order to debug, change the configuration so that it returns to you the last performed query: in application/config/database.php set save_queries to boolean TRUE, then go back to your model and right after line 3, i.e. where you perform the $query, write:

print $this->db->last_query();
die;

And see what you get. Then try to run the query into a MySQL client and see if you get results. Once you end the debugging process set save_queries to FALSE again, as it slows down the execution of the code. Also, for a better debug process I suggest you to add Kint:

Can I ask why you are using CodeIgniter? It's for a new project or just maintaining legacy?

0

It happens because the POST request write is executed at the end of the script, in practice your write block (file_put_contents()) is placed after the reading block (file_get_contents()), so when a POST request is performed the script:

  1. reads the contents of the file which has not still been modified
  2. it prints the contents to the textarea
  3. and then it saves the input to the file

Move all the PHP logic in top of the file and set only print variables inside the HTML:

<?php

// Initialize
$alert = '';

// Write
if(isset($_POST['submit']))
{
    $newtext = $_POST['PHP_testing']; // <- Sanitize! See filter_input()
    file_put_contents('filltext.txt', $newtext);
    $alert = '<p>The modified text has been saved.</p>';
}

// Read
$oldtext = file_get_contents('filltext.txt');

?>
<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
</head>
<body>

<form name="for PHP" method="POST">
    <textarea name="PHP_testing" cols="60" rows="10" id="testing">
    <?php

    echo $oldtext;

    ?>
    </textarea>
    <input type="submit" name="submit" value="Save Text">
</form>

<?php

echo $alert;

?>

</body>
</html>
1

@RJ

most is still true, I read the same on forums for years, about people changing system every month like scarves, but I suspect it comes only from those which have time to waste. I have never had to put my hands on kernel, to be honest I don't even know from where to start. I use Ubuntu because it's different from other distros, which I agree are not friendly with new users, but Ubuntu is easy to install and configure, it's all graphical and supports a lot of hardware.

You can always open the terminal and compile a source if needed, most of the time it's easy, but not always because it happens that you have to find which library satisfies an obscure dependency but it's rare that an average user will ever need that software. I bought the laptop from which I'm writing in 2008, installed and never formatted. I do upgrades to follow the LTS (Long Time Support) versions which are supported for 5 years, now I'm on 16.04. Yes, I don't get the edgy versions of softwares but I gain in stability. I do reboots only because systemd, the new process manager, in practice an equivalent of your svchost.exe, sometimes requires to reboot the machine after an update (sigh), but otherwise I don't even need to do it for weeks.

1

It may be true that Linux offers a smaller surface attack with the default configuration, but as RJ states, it depends a lot more on how you use the system. Lately I read about a user hit by a ransomware on Linux, he was running Mozilla Firefox as root, who knows why, and got infected through an extension of the browser (seemingly Adobe Flash).

Disclaimer: I use Linux since 2001 and abandoned Microsoft OS since 2004.

0

The code seems to be okay, are you sure opcache is disabled? If you are using PHP 7.0 then it's enabled by default, so if you ran the delete.php script and this was cached by the engine, then even after changing the code you still hit the cached version, until expiration, so while developing you can get an unexpected result. If this is the case you should disable it.

Run:

print var_dump(opcache_get_status());
die;

To see the current status, it does not matter from which script you run it, if enabled, it will return the list of cached scripts