Skip to content

Instantly share code, notes, and snippets.

@gadoi
gadoi / clean.sh
Created March 1, 2024 07:43 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@gadoi
gadoi / gist:017b05e1ed46331cab11070569f43ac9
Last active October 14, 2022 14:13 — forked from dstf/gist:2c3310e2095da096de31e05eacaa032a
Secure your server debian / wordpress
Creating strong passwords i would recommend using a browser extensions as password generator.
-Configuring Auto-Update:
apt install unattended-upgrades
systemctl enable unattended-upgrades
systemctl status unattended-upgrades
nano /etc/apt/apt.conf.d/50unattended-upgrades
@gadoi
gadoi / nginx-wordpress.conf
Created June 13, 2022 02:49 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@gadoi
gadoi / kali.md
Created June 29, 2021 15:36 — forked from dvdknaap/kali.md
RootTricks

install all tools

  • apt install kali-linux-all

.git folder downloader

  • git clone https://github.com/internetwache/GitTools.git

Check ports with nmap

  • nmap -sC -sV -oA initial 10.10.10.78
  • nmap -sV -sC -oA nmap-tcp 10.10.10.84
  • nmap -T4 -A -v -p 0-10000 10.10.10.8
@gadoi
gadoi / nginxproxy.md
Created January 19, 2021 02:40 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@gadoi
gadoi / mysql_cheat_sheet.md
Created December 31, 2020 02:24 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH