Skip to content

Instantly share code, notes, and snippets.

View ehcaning's full-sized avatar

Ehsan Seyedi ehcaning

View GitHub Profile

SSH Server Hardening Steps

7 SSH Security Tips I Wish I Knew Before Getting Hacked!

1. Change Default Port

  1. Edit SSH configuration:
    vi /etc/ssh/sshd_config

Change the Port:

@ehcaning
ehcaning / folder_magic.py
Created July 16, 2021 07:27
Create folder with name of files
# Create a folder for this file:
# Thor.The.Dark.World.2013.1080p.6CH.x265.HEVC.mkv
# With this name:
# Thor The Dark World (2013)
# And put movie in created folder
import re
import os
import shutil
@ehcaning
ehcaning / gogs-dark.css
Created March 4, 2021 18:29
Gogs Dark Mode
body {
background-color: #1d1f21 !important;
color: #e0e0e0;
}
body:not(.full-width) {
background-color: #1d1f21 !important;
}
footer {
@ehcaning
ehcaning / fancy-bash-promt.sh
Created June 15, 2019 17:53
fancy-bash-promt.sh
#!/bin/sh
## +-----------------------------------+-----------------------------------+
## | |
## | FANCY BASH PROMT |
## | |
## | Copyright (c) 2018, Andres Gongora <[email protected]>. |
## | |
## | This program is free software: you can redistribute it and/or modify |
## | it under the terms of the GNU General Public License as published by |
@ehcaning
ehcaning / BBQ.php
Last active August 31, 2019 04:28
PHP Security Stuff
<?php
/*
Plugin Name: Block Bad Queries (BBQ)
Plugin URI: https://perishablepress.com/block-bad-queries/
Description: Automatically protects WordPress against malicious URL requests.
Author: Jeff Starr
Author URI: https://monzillamedia.com/
Version: (standalone)
License: GPL v2
Usage: No configuration necessary. Upload, activate and done. BBQ blocks bad queries automically to protect your site against malicious URL requests.
@ehcaning
ehcaning / jdf.php
Created April 16, 2019 06:52
jdf Class
<?php /* In the name of Allah = بسم اللّه الرّحمن الرّحیم */
/**
* @فارسی : توابع زمان و تاریخ هجری شمسی (جلالی) در پی اچ پی
* @name: Hijri_Shamsi,Solar(Jalali) Date and Time Functions
* @Author : Reza Gholampanahi & WebSite : http://jdf.scr.ir
* @License: GNU/LGPL _ Open Source & Free : [all functions]
* @Version: 2.70 =>[ 1395/11/22 = 1438/05/12 = 2017/02/10 ]
*/
@ehcaning
ehcaning / Singleton Database Class.php
Last active October 15, 2019 06:04
My personal DB Class (Including Singleton)
<?php
# v2.2
class dbM {
private static $pdo;
private static $instance;
private function __construct() {
}
public static function init() {