Difference between revisions of "FoolFuuka/Housekeeping"

(Created page with "== Undelete post == Deleted posts by moderators are thrown in the deleted table. It is a hassle to grab stuff, but its not gone forever. # Get mysql workbench and login # ty...")
 
(Undelete post)
Line 12: Line 12:
 
* Single posts: {{ic|<nowiki>INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE doc_id = <doc_id>);</nowiki>}}
 
* Single posts: {{ic|<nowiki>INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE doc_id = <doc_id>);</nowiki>}}
 
* Entire thread: {{ic|<nowiki>INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE thread_num = <thread_num>);</nowiki>}}
 
* Entire thread: {{ic|<nowiki>INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE thread_num = <thread_num>);</nowiki>}}
 +
 +
== Delete Ghost Posts by search query ==
 +
 +
* modify  /home/atc/delete-by-search-query.php
 +
* Under the profiler:
 +
** 27 Start: SphinxQL: SELECT id, board, tnum FROM a_ancient, a_main, a_delta WHERE MATCH('(@comment mado mami)') AND is_internal = 1 ORDER BY timestamp DESC LIMIT 0, 25 OPTION max_matches = 5000, reverse_scan = 1
 +
** you have no idea how angry it has made us to see the words "mado mami" and their accomplices be spammed on our ghostposts
 +
* Replace $querymatch with the highlighted portion
 +
** You can also include AND if there is more to filter by
 +
 +
== Deleting by ghost posts by IP range ==
 +
 +
Example: 148.74.* (first IP: 148.74.0.0, last IP 148.74.255.255)
 +
 +
* Search for 1st IP in range in FF - Look at query in Profiler
 +
** Take the `pip` out
 +
*** Example for 148.74.0.0 - WHERE pip = 2487877632
 +
* Search for last IP in range
 +
** Take the `pip` out
 +
*** Example for 148.74.255.255 - WHERE pip = 2487943167
 +
* Edit /home/atc/delete-by-search-query.php
 +
* Set $dry = true; to test
 +
* Comment the line after NORMAL QUERY
 +
* Uncomment line after IP RANGE
 +
** Edit PIP numbers. First IP is first, Last IP goes second
 +
* Test with php /home/atc/delete-by-search-query.php
 +
* If it looks good, set $dry = false; and run again
 +
 +
== Deleting all ghostposts in a thread ==
 +
 +
* {{ic|$use_specificboard = true;}}                                                                                                                                       
 +
* {{ic|$specificboard = 'a';}}
 +
* {{ic|$querymatch = "tnum = 1234141"; // Delete by thread num}}
 +
 +
    php /home/atc/delete-by-search-query.php

Revision as of 05:01, 2 January 2019

Undelete post

Deleted posts by moderators are thrown in the deleted table. It is a hassle to grab stuff, but its not gone forever.

  1. Get mysql workbench and login
  2. type in the command SELECT * FROM asagi.a_deleted;
  3. Click that lightning button
  4. The results are the posts. Observe if they are the posts you want.

These commands can be run in mysql console or the mysql workbench

  • Single posts: INSERT INTO `asagi`.`&lt;board&gt;` (SELECT * FROM `asagi`.`&lt;board&gt;_deleted` WHERE doc_id = &lt;doc_id&gt;);
  • Entire thread: INSERT INTO `asagi`.`&lt;board&gt;` (SELECT * FROM `asagi`.`&lt;board&gt;_deleted` WHERE thread_num = &lt;thread_num&gt;);

Delete Ghost Posts by search query

  • modify /home/atc/delete-by-search-query.php
  • Under the profiler:
    • 27 Start: SphinxQL: SELECT id, board, tnum FROM a_ancient, a_main, a_delta WHERE MATCH('(@comment mado mami)') AND is_internal = 1 ORDER BY timestamp DESC LIMIT 0, 25 OPTION max_matches = 5000, reverse_scan = 1
    • you have no idea how angry it has made us to see the words "mado mami" and their accomplices be spammed on our ghostposts
  • Replace $querymatch with the highlighted portion
    • You can also include AND if there is more to filter by

Deleting by ghost posts by IP range

Example: 148.74.* (first IP: 148.74.0.0, last IP 148.74.255.255)

  • Search for 1st IP in range in FF - Look at query in Profiler
    • Take the `pip` out
      • Example for 148.74.0.0 - WHERE pip = 2487877632
  • Search for last IP in range
    • Take the `pip` out
      • Example for 148.74.255.255 - WHERE pip = 2487943167
  • Edit /home/atc/delete-by-search-query.php
  • Set $dry = true; to test
  • Comment the line after NORMAL QUERY
  • Uncomment line after IP RANGE
    • Edit PIP numbers. First IP is first, Last IP goes second
  • Test with php /home/atc/delete-by-search-query.php
  • If it looks good, set $dry = false; and run again

Deleting all ghostposts in a thread

  • input
  • input
  • input
   php /home/atc/delete-by-search-query.php