Skip to content

Instantly share code, notes, and snippets.

@erev0s
erev0s / README.md
Last active November 3, 2023 07:49
@erev0s
erev0s / docker-compose.yml
Created April 9, 2020 18:56
docker-compose for Wordpress development with Phpmyadmin and custom configuration for memory limit/time limit/upload filesize etc
version: "3"
services:
wordpress:
container_name: 'Wordpress'
image: 'wordpress:latest'
depends_on:
- mysql
environment:
- WORDPRESS_DB_PASSWORD=wordpressPS
ports:
@erev0s
erev0s / network_stats_firebase.sh
Created May 17, 2019 22:04
extract clean network statistics from firebase after copying them manually from the source of the page
#!/bin/bash
sed "s/<tr>//g" < $1 | sed "s/<\/tr>//g" | sed "s/<td>//g" | sed "s/<\/td>//g" | sed '/^[[:space:]]*$/d' | sed "s/<tbody>//g" | sed "s/<\/tbody>//g" | tr -d '[:blank:]' | tail -n +4 > check
awk '
/[0-9]{2}:[0-9]{2}:[0-9]{2}\.*/ {
if (NR > 1) p()
a[i = 1] = $0
next
}
{ a[++i] = $0 }
END { p() }
@erev0s
erev0s / cpu_ram_firebase.sh
Created May 17, 2019 22:03
extract clean cpu and ram statistics from firebase after copying them manually from the source of the page
#!/bin/bash
sed "s/<tr>//g" < $1 | sed "s/<\/tr>//g" | sed "s/<td>//g" | sed "s/<\/td>//g" | sed '/^[[:space:]]*$/d' | sed "s/<tbody>//g" | sed "s/<\/tbody>//g" | tr -d '[:blank:]' | sed -r '/^.{,3}$/d' | awk -F, 'length($1) < 8 { print f; print} {f=$1}' | sed "s/00://g" | tail -n +3 > tmp
awk 'NR % 2 == 1' tmp > times.txt
awk 'NR % 2 == 0' tmp > values.txt
rm tmp
@erev0s
erev0s / comparisonOpenID.md
Last active April 8, 2019 15:26
Comparison between known Identity Management and Access Management solutions (OpenID, OAuth)
@erev0s
erev0s / csf_install.sh
Created March 29, 2019 11:47
script to isntall csf on ubuntu
#!/bin/bash
wget http://download.configserver.com/csf.tgz
tar -xzf csf.tgz
ufw disable #in case it is on
cd csf
sh install.sh
#run the test to see if it passed
perl /usr/local/csf/bin/csftest.pl
@erev0s
erev0s / docker_install.sh
Last active November 7, 2019 15:42
install docker in ubuntu
#!/bin/bash
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce
sudo curl -L https://github.com/docker/compose/releases/download/1.25.0-rc4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
@erev0s
erev0s / isitdone.sh
Last active December 10, 2018 21:14
small check if some process is done, to send you email
#!/bin/bash
#*/5 * * * * /root/isitdone.sh
ps -ef | grep -v grep | grep "java"
if [ $? -ne 0 ]; then
echo "Process done" | mail -s "Process done" example@mail.com
fi
@erev0s
erev0s / synonyms.py
Created November 2, 2018 15:16
small thing to change into synonyms the words of a text
import thesaurus as th
wordlist = []
with open('test.txt') as f:
wordlist = ([word for line in f for word in line.split()])
changedw = []
for word in wordlist:
tmpword = th.Word(word).synonyms(relevance=3)
if not tmpword:
@erev0s
erev0s / verbtamp.sh
Created September 6, 2018 16:02
http verb tampering check, you can use it like ===> ./verbtamp.sh http://google.com
#!/bin/bash
for method in GET HEAD POST PUT DELETE CONNECT OPTIONS TRACE; do
echo curl -v -X $method $1
done