Skip to content

Instantly share code, notes, and snippets.

View acosonic's full-sized avatar
💭
I may be slow to respond.

Aleksandar Pavić acosonic

💭
I may be slow to respond.
View GitHub Profile
@acosonic
acosonic / mysql-drop-all-tables.sh
Created November 14, 2018 06:51 — forked from cweinberger/mysql-drop-all-tables.sh
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@acosonic
acosonic / fail2ban_wp.sh
Created March 5, 2019 13:48
Protecting ubuntu 14.04 server virtualmin websites against wordpress login attack bots
#!/bin/bash
# this script will install fail2ban and enable apache-wp-login rule
# you will notice once it's done that fail2ban-client status shows apache-wp-login rule as active
apt install fail2ban
JAIL=''
JAIL="${JAIL}\n"
JAIL="${JAIL}[apache-wp-login]\n"
JAIL="${JAIL}enabled = true\n"
JAIL="${JAIL}port = http,https\n"
JAIL="${JAIL}filter = apache-wp-login\n"
@acosonic
acosonic / attack_urls.txt
Last active November 16, 2021 13:29
Comprehensive list of attack/probe URL's
#This was done by some tool, don't know which one, and our custom built app captured theese URL's, after filtering
#for unique URL's, here is list of URL's in original form, I will later try to create some protection
/3B1728A10D221805D2CABE58B095D353.php
/manager/html
/wp-content/plugins/portable-phpmyadmin/wp-pma-mod/index.php
/mysql/mysqlmanager/index.php
/mysql/sqlmanager/index.php
/mysql/dbadmin/index.php
/mysql/admin/index.php
/phpmy/index.php
@acosonic
acosonic / txt
Created March 26, 2019 06:34
Multidimensional array in php
Array
(
[0] => Array
(
[90] => Array
(
[50] => 708
[80] => 823
[110] => 210
[140] => 97
@acosonic
acosonic / etc-hosts-on-win.md
Last active May 15, 2019 12:13 — forked from zenorocha/etc-hosts-on-win.md
/etc/hosts on Windows

1. Modify your hosts file

notepad

For Windows 10 and 8
  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
@acosonic
acosonic / faker.yml
Last active August 21, 2019 08:00
faker for redmine lang
faker:
name:
male_first_name: [Aaron, Abdul, Abe, Abel, Abraham, Abram, Adalberto, Adam, Adan, Adolfo, Adolph, Adrian, Agustin, Ahmad, Ahmed, Al, Alan, Albert, Alberto, Alden, Aldo, Alec, Alejandro, Alex, Alexander, Alexis, Alfonso, Alfonzo, Alfred, Alfredo, Ali, Allan, Allen, Alonso, Alonzo, Alphonse, Alphonso, Alton, Alva, Alvaro, Alvin, Amado, Ambrose, Amos, Anderson, Andre, Andrea, Andreas, Andres, Andrew, Andy, Angel, Angelo, Anibal, Anthony, Antione, Antoine, Anton, Antone, Antonia, Antonio, Antony, Antwan, Archie, Arden, Ariel, Arlen, Arlie, Armand, Armando, Arnold, Arnoldo, Arnulfo, Aron, Arron, Art, Arthur, Arturo, Asa, Ashley, Aubrey, August, Augustine, Augustus, Aurelio, Austin, Avery, Barney, Barrett, Barry, Bart, Barton, Basil, Beau, Ben, Benedict, Benito, Benjamin, Bennett, Bennie, Benny, Benton, Bernard, Bernardo, Bernie, Berry, Bert, Bertram, Bill, Billie, Billy, Blaine, Blair, Blake, Bo, Bob, Bobbie, Bobby, Booker, Boris, Boyce, Boyd, Brad, Bradford, Bradley, Bradly, Brady, Brain,
@acosonic
acosonic / redmine_generate_users_via_console.txt
Last active August 21, 2019 07:59
Using Faker gem, to create 99 test users in Redmine using rails console
This code will produce users with first/last names and emails for English language and assumes that English is default
for your Redmine installation
1. Add faker gem to Redmine's Gemfile
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'
2. Run bundle install again
3. Append following to en.yml
https://gist.github.com/acosonic/4569608db998c80fee6a37c104fc352b
@acosonic
acosonic / tamper.js
Created September 12, 2019 13:26
Tampermonkey script for Office web access to improve unread message
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mail.yourserver/owa/
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@acosonic
acosonic / tampermonkey
Created September 18, 2019 09:56
Tampermonkey ErsteBank Novi Sad LOGIN VIA TAN (Automated)
/ ==UserScript==
// @name ersteLogin
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://netbanking.erstebank.rs/Prijava/PrijavaTan.aspx
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@acosonic
acosonic / siege.md
Last active September 24, 2019 12:11
Siege testing of docker vs virtualmin

Server hosted on docker EC2 Micro (1 CPU, 100 IOPS)

Lifting the server siege...
Transactions:		        5198 hits
Availability:		      100.00 %
Elapsed time:		      220.36 secs
Data transferred:	       79.87 MB
Response time:		        1.06 secs
Transaction rate:	       23.59 trans/sec
Throughput: 0.36 MB/sec