Skip to content

Instantly share code, notes, and snippets.

View sohay666's full-sized avatar
🥴
to much eating fish

Sohay sohay666

🥴
to much eating fish
View GitHub Profile
@sohay666
sohay666 / Simple Setup Tomcat Server
Last active July 11, 2025 01:13
Simple Setup Tomcat Server
context.xml
---
<Context antiResourceLocking="true" privileged="true" >
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
<Realm className="org.apache.catalina.realm.CombinedRealm">
<Realm className="org.apache.catalina.realm.LockOutRealm"
failureCount="50" lockOutTime="1" >
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
Setup RDP in mac
1. install macport https://www.macports.org/install.php
2. sudo port install rdesktop
3. install xquartz from this https://www.xquartz.org
4. export DISPLAY=:0
5. open -a XQuartz
6. echo $DISPLAY | output will: /private/tmp/com.apple.launchd.dqt8pNIhty/org.xquartz:0
7. rdesktop -u Administrator -p XXXX 192.168.1.194:1490
@sohay666
sohay666 / php_upgrade.md
Created September 6, 2024 07:40 — forked from bvalerin/php_upgrade.md
Upgrade from PHP 7.3 to PHP 8 on Mac Os with Homebrew

Upgrading with Homebrew

Start by making sure brew is up-to-date:

brew update

Install Xcode Dev Tools

xcode-select --install

Upgrade with tap shivammathur/homebrew-php

brew tap shivammathur/php

@sohay666
sohay666 / gist:cda88ddaed9eb6a446db58ea00af0d0e
Created October 22, 2023 16:02
Cracking .zip passwords with John The Ripper (Mac OS)
/opt/homebrew/Cellar/john-jumbo/1.9.0/share/john/
$ brew install john-jumbo
$ export PATH=$PATH:/usr/local/share/john
$ zip2john YOUR_FILE.ZIP > zip_hash.txt
$ john --format=PKZIP --wordlist YOUR_WORDLIST_HERE zip_hash.txt
$ john --show zip_hash.txt
@sohay666
sohay666 / app-upload-patch.py
Created August 29, 2023 03:50
Example secure code for upload Flask
import os, imghdr, uuid
from flask import Flask, request, send_from_directory
from werkzeug.utils import secure_filename
app = Flask(__name__)
UPLOAD_FOLDER = 'uploads'
app.config['UPLOAD_EXTENSIONS'] = ['.jpg', '.png', '.gif']
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['MAX_CONTENT_LENGTH'] = 1 * 1024 * 1024 #max 1 mb
@sohay666
sohay666 / curl.md
Created August 19, 2023 03:27 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

/.git/config
/wp-admin/js/widgets/index.php
/wp-content/uploads/2020/10/casper_speed.php
/wp-logout.php
/gk.php
/wp-content/0day.php
/autoload_sitemap.php
/comment.php
/wp-content/uploads/archieving.php
/js/logs.php
@sohay666
sohay666 / xss-proctect.go
Last active December 23, 2022 13:04
xss sanitze for labstack
// secure code for middleware
example :
```
// only POST method can be overridden
e.Pre(middleware.MethodOverride())
// protect from xss
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
XSSProtection: "1; mode=block",
ContentTypeNosniff: "nosniff",
@sohay666
sohay666 / Learn CSS
Created June 25, 2022 07:47
Learn CSS
CSS Syntax
----------------------------------------
Css is for styling the HTML page, it's not a programing language
basicly it's only like this:
selector {
property1 : value;
property2 : value;
}
@sohay666
sohay666 / selenium
Last active June 25, 2022 07:46
Setup selenium in Ubuntu Server
sudo apt update
sudo apt -y upgrade
sudo apt-get -y install python3-pip python3-dev build-essential libssl-dev libffi-dev xvfb
pip3 install selenium
wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar -xvzf geckodriver*
mv -v geckodriver /usr/local/bin
cd /usr/local/bin
chmod +x geckodriver
#checking geckodriver only execute like this: ./geckodriver